[selfnote] Cloning/Backing up NTFS systems

For some reasons, you may need to clone/backup NTFS based systems. Lets say your NTFS system is located at /dev/sda1 and /dev/sdb1 is a spare partition where you can store your image.

At first you need to boot a live system to take an image:

# mount /dev/sdb1 /mnt/sdb1
# dd bs=512 count=1 if=/dev/sda of=/mnt/sdb1/xp_vbox.mbr
# ntfsclone -s -o - /dev/sda1 | bzip2 -9 -c > \
   /mnt/sdb1/xp_vbox.img.bz2

To restore the image you just need:

# mount /dev/sdb1 /mnt/sdb1
# dd count=1 bs=446 if=/mnt/sdb1/xp_vbox.mbr of=/dev/sda
# cat /mnt/sdb1/xp_vbox.img.bz2 | bunzip2 -c | \
	   ntfsclone -r -O /dev/sda1 -