Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

recently I made a backup 120 GB disk image using dd:

dd if=/dev/sda of=backup.img

Now I have a new 320 GB hard disk and want to restore that backup image to that new disk. Will running

dd if=backup.img of=/dev/sdb

do what I want? Will I be able to use remaining 200 GB of new disk?

(/dev/sda - old 120 GB disk, /dev/sdb - new 320 GB disk, backup.img - image file of 120 GB disk)

share|improve this question
1  
Experiment with blocksize (bs=) for faster write speed. Try 1M, 4M, 8M and possibly higher. –  3molo May 12 '11 at 8:02
    
you can use command resize2fs to expand your disk size after dd finished –  kenji 2 days ago

2 Answers 2

up vote 3 down vote accepted

Sure you can. It's not the best way, but you can do it. dd will not auto expand the partitions to fill up the extra disk space. You can use gparted to resize the partitions after you restore. I use gparted on an Ubuntu install/boot/live cd since I always have a disk with me anyway.

share|improve this answer

Yes, it will work. But ideally you'd be using partimage or something more intelligent (including perhaps gparted) to make the image/clone the disk anyway. Perhaps a Parted Magic live CD/USB?

See also Using DD for disk cloning if you can plug both disks in at once.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.