sfdisk -d /dev/sda | sfdisk /dev/sdb (clone partition table sda to sdb)
Backing up the MBR
The MBR is stored in the the first 512 bytes of the disk. It consist of 3 parts:
- The first 446 bytes contain the boot loader.
- The next 64 bytes contain the partition table (4 entries of 16 bytes each, one entry for each primary partition).
- The last 2 bytes contain an identifier
If you only want to restore the boot loader, but not the primary partition table entries, just restore the first 446 bytes of the MBR: dd if=/dev/sda of=/dev/sdb bs=446 count=1 dd if=/dev/sda | ssh username@host "dd of=/mnt/hdd.img" (dump image over network) ssh username@host "dd if=/mnt/hdd.img" | dd of=/dev/sda (clone network image to ur drive) dd if=/dev/sda1 of=/dev/sdb1 bs=4096 conv=notrunc,noerror (copy partition ) To increase the speed use bs=100M for instance To view the copy progress find dd PID and watch -n 5 'kill -USR1 PID' or install pv and use :
dd if=/dev/sda1 bs=4M | pv -s 60G | dd of=/dev/sdb1 bs=4MThe b
s=4Margument sets the blocksize for dd operations to 4MB, which drastically improves the clone speed. And the
-s 60Gargument tells
pvhow big the operation is expected to be, so it can give you an ETA as well as a current speed.