Linux - GeneralThis forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you copy the whole drive (if=/dev/hda), then it copies the MBR, partition tables, and all partitions. Going from 40 to 120, you will wind up with an image of your 40GB drive at the front of the 120. I assume you can then resize and/or create new partitions to fill the excess space.
When you clone just a partition (if=/dev/hdaX), then that's all you get. I assume that you have to copy to a target partition which is at least big enough.
fdisk can increase the size of the partition, but you need to know exactly how big the disk is to be able to tell it (because it only knows what is on the partition table, that is from the small disk). It is very easy to screw everything up beyond repair while doing this. Read the man page for more info.
After that is done resize2fs (or the tool for your fs type) can increase the size of the file system to match that of the new partition.
Since this is the only thread I found on the dd resizing, I will add my solution :
Tested with ext2 on ubuntu 8.10 with 4gb (almost full) sd card to 8gb sdhc card.
I simply opened gparted, reduced the size of the partition of about 10mb (gparted was saying I had a 7.x gb partition almost full), and then expanded it to full size again (gparted now says I got a 7.x gb partition with 4gb free, df tells me the same). Took 3 minutes
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.