Mittwoch, 10. Juni 2015

Backups: cloning whole disks (easier and faster than dd)

Important: do not clone disks that are actively used (e.g. your system disk) because the contents on the disk might change while you copy them and the clone could end up corrupted. Therefore:

  • Start a Linux Live System (maybe from an USB Stick)
  • Check the disk names and sizes* carefully (e.g. with the program disk)
  • Start cloning

For cloning many people advise to use "dd", but if you do not use the right block size it is slow. A faster and easier option is to use

cat /dev/sdX > /dev/sdY

wich copies all bits from the device sdX to the device sdY, just like dd. You probabliy need to use sudo:

sudo sh -c 'cat /dev/sdX > /dev/sdY'

Get the progress in bytes like this: grep the pid of cat and then see where the output file descriptor is
top | grep cat
cat /proc/yourCatPid/fdinfo/1


* If the target device is bigger than the source device then you can use gparted to resize the partitions on the new disk after the cloning is finished.


Keine Kommentare:

Kommentar veröffentlichen