[plug] Backimg up entire drive

Craig Ringer craig at postnewspapers.com.au
Mon Jan 5 17:53:15 WST 2004


caston at arach.net.au wrote:

> dd if=/dev/hdc of=/backup/seagate20gb.img 
>  
> I expect to do: 
>  
> dd if=/backup/seagate20gb.img of=/dev/hdc  
>  
> to restore. 
>  
> Is it this simple? 

Yes, but I strongly prefer to do:

# sfdisk --dump /dev/hdc > /backup/back-hdc-ptable
# for part in find /dev/hdc? ; do
# 	dd if=$part of=/backup/back-$part bs=4M
# done

as this way the partition can be loopback mounted, restored to any other 
disk, etc. If you do the entire disk, you face issues of different disk 
geometry if you're restoring to a different disk.

OTOH, doing it in one block saves the trouble of having to rescue the 
partition table.

This has been discussed repeatedly in the archives; you can find more 
information there.

Craig Ringer




More information about the plug mailing list