[NBLUG/talk] dd for different size partitions?

Bob Blick bblick at sonic.net
Tue Aug 10 13:16:58 PDT 2004


I want to resize partitions. I'm starting with a hard disk that has
multiple partitions.

For a starting place, let's say I want to make the / partition (/dev/hda1)
bigger and an adjacent partiton (/dev/hda2) smaller. I care about the /
partition and don't care about the other partition although I will retain
it with a new smaller size. So far so good.

I have plenty of room on /home, so I figured I'd copy the / partition onto
a file on /home, resize and reformat the two other partitions, and copy
the / partition back.

OK, so could I do this:

boot from a knoppix or other CD
dd if=/dev/hda1 of=/dev/hda3/home/bob/my_partition_file
then do my resizing and do this
dd if=/dev/hda3home/bob/my_partition_file

But then I got to thinking that this really wouldn't work, because dd will
screw up the partition because it is writing to a different size partition
- basically I will end up with the same size partition, but it will take
more room on the drive.

Any and all info on this is welcomed.

Cheerful regards,

Bob






More information about the talk mailing list