Professional Web Applications Themes

Can I Resize A Partition With dd? - Linux Setup, Configuration & Administration

I modified my /dev/hda3 partition to occupy more physical space with fdisk and dd by doing this: dd if=/dev/hda3 of=<NFS_path>/hda3.img bs=4096 fdisk /dev/hda I resized /dev/hda3 to be bigger mkfs.ext3 /dev/hda3 dd if=<NFS_path>/hda3.img of=/dev/hda3 bs=4096 Everything on the system appears to work. My questions is: Q1: Would there be any problem with the file system? Suggestions? Comments? Thanks, Jack...

  1. #1

    Default Can I Resize A Partition With dd?

    I modified my /dev/hda3 partition to occupy more physical space with
    fdisk and dd by doing this:

    dd if=/dev/hda3 of=<NFS_path>/hda3.img bs=4096
    fdisk /dev/hda
    I resized /dev/hda3 to be bigger
    mkfs.ext3 /dev/hda3
    dd if=<NFS_path>/hda3.img of=/dev/hda3 bs=4096

    Everything on the system appears to work. My questions is:

    Q1: Would there be any problem with the file system?

    Suggestions? Comments?

    Thanks,
    Jack

    Hank Kingwood Guest

  2. #2

    Default Re: Can I Resize A Partition With dd?

    Hank Kingwood wrote:
    > I modified my /dev/hda3 partition to occupy more physical space with
    > fdisk and dd by doing this:
    >
    > dd if=/dev/hda3 of=<NFS_path>/hda3.img bs=4096
    > fdisk /dev/hda
    > I resized /dev/hda3 to be bigger
    > mkfs.ext3 /dev/hda3
    > dd if=<NFS_path>/hda3.img of=/dev/hda3 bs=4096
    >
    > Everything on the system appears to work. My questions is:
    >
    > Q1: Would there be any problem with the file system?
    I think I would have used "tar" or even "cp -a" to do it since
    "dd" includes the empty disk space as well as the files.

    --
    Confucius: He who play in root, eventually kill tree.
    Registered with The Linux Counter. [url]http://counter.li.org/[/url]
    Slackware 9.0 Kernel 2.4.22 i686 (GCC) 3.3
    Uptime: 32 min, 1 user, load average: 1.34, 1.20, 1.02

    David Guest

  3. #3

    Default Re: Can I Resize A Partition With dd?

    Hank Kingwood wrote:
    >
    > I modified my /dev/hda3 partition to occupy more physical space with
    > fdisk and dd by doing this:
    >
    > dd if=/dev/hda3 of=<NFS_path>/hda3.img bs=4096
    > fdisk /dev/hda
    > I resized /dev/hda3 to be bigger
    > mkfs.ext3 /dev/hda3
    > dd if=<NFS_path>/hda3.img of=/dev/hda3 bs=4096
    >
    > Everything on the system appears to work. My questions is:
    >
    > Q1: Would there be any problem with the file system?
    Yes, AFAIK. Does 'df' show the total size of the old filesystem or the
    new one?

    'dd' copies everything bit by bit (including critical filesystem-level
    data structures). When you copied the image back, you also copied back
    those filesystem data structures (overwriting the new filesystem you
    made with mkfs) from the smaller filesystem. You now have a filesystem
    smaller than the partition it resides on.

    You either need to use 'cp -a' or 'tar' or some such to copy only the
    data (as opposed to the complete image you used) *or* you need to find a
    way to resize the ext3 filesystem. 'resize2fs' may work on your ext3
    partition. GNU 'parted' may also be able to resize the filesystem.
    John-Paul Stewart Guest

Similar Threads

  1. partition streaming
    By cary15 in forum Macromedia Flash Player
    Replies: 0
    Last Post: March 13th, 05:36 PM
  2. Resize a ufs partition
    By Soheil Hassas Yeganeh in forum FreeBSD
    Replies: 1
    Last Post: February 16th, 01:50 PM
  3. Cheap Way To Resize Partition?
    By Novice Techie in forum Windows Server
    Replies: 2
    Last Post: June 19th, 07:35 AM
  4. [Sol9] How can I resize a partition?
    By Frank in forum Sun Solaris
    Replies: 9
    Last Post: August 4th, 07:28 PM
  5. Partition sharing
    By alex in forum Debian
    Replies: 3
    Last Post: August 3rd, 02:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139