Hits : 9439



In our business there are times that you have to work with windows boxes.
The main problem with that is that they are constantly broken.


So is there a efficient way to build a proper backup image ?


The answer is YES, by using SystemRescueCd and ntfsclone


For this example lets say that our primary disk is /dev/sda
and our backup disk is: /dev/sdb


(in the real world, my windows disk is a lvm partition)

Boot your SystemRescue CD or USB 


easy peasy


top


Verify your disks


eg. fdisk -l


Device Boot Start End  Blocks Id  System
/dev/sda1 * 63 10458314 5229126 7 HPFS/NTFS/exFAT
/dev/sdb1
2048 10485759 5241856 83 Linux

Be careful


ntfsresize --info /dev/sda1


The result of the above command will determine the next step.
If there are errors, you must reboot to windows and check your disk, defragment or what ever process you must run to fix your disk.


top


Backup MBR and Partition Table

You should/must take backup of MBR (Master Boot Record) or even the boot loader using dd command


dd if=/dev/sda of=sda.mbr bs=512 count=1

dd if=/dev/sda of=sda.vbr bs=512 count=63


It is also a good idea to dump to a file your existing partition table:


sfdisk -d /dev/sda > sda.ptab


if you want to restore the partition table from your backup file:


sfdisk /dev/sda < sda.ptab


top


Perform Ntfs Clone


Mount your backup disk to an empty directory,
eg


mount /dev/sdb1 /mnt/custom/


and start ntfsclone


ntfsclone --save-image --output /mnt/custom/winxp.ntfsclone /dev/sda1


And simple wait for a minute or two (or ten or an hour – depends of the disk size).


top


Restore your ntfs clone backup


ntfsclone --restore-image --overwrite /dev/sda1  /mnt/custom/winxp.ntfsclone


top