Monday, September 29, 2008

Windows Backup made easy with SystemRescueCD

Quick solution to add an 'open source' automatic recovery option from the windows boot manager.
Steps:

1- Download SystemRescueCD iso from http://www.sysresccd.org/Download
2 - Extract sysrcd.dat, rescuecd, initram.igz and place them on C:
3 - Download Grub4Dos from https://gna.org/projects/grub4dos/ (tested with version grub4dos-0.4.3-2007-08-27.zip) extract the file grldr to C:\
4 - Modify C:\boot.ini adding in the section [operating systems] the statement:
C:\grldr="SystemRescueCd"
5 - Add the following file to C:\


#======================menu.lst=======================
default 2
timeout 30

# This is a sample menu.lst file for SystemRescueCd
title Create Backup
root (hd0,0)
kernel /rescuecd ar_nowait autoruns=0 setkmap=it docache
initrd /initram.igz

# This is a sample menu.lst file for SystemRescueCd
title Restore Backup
root (hd0,0)
kernel /rescuecd ar_nowait autoruns=1 setkmap=it docache
initrd /initram.igz

# This is a sample menu.lst file for SystemRescueCd
title SystemRescueCd from the NTFS disk
root (hd0,0)
kernel /rescuecd ar_disable setkmap=it docache
initrd /initram.igz
#================================================



#===========================autorun0=============
#!/bin/sh
#Create Backup Script
ntfs-3g /dev/sda2 /mnt/windows
partimage --compress=2 --overwrite --nodesc --batch save /dev/sda1 /mnt/windows/win_backup.bz2
umount /mnt/windows
reboot
#================================================



#===========================autorun1=============
#!/bin/sh
#Restore Backup Script
ntfs-3g /dev/sda2 /mnt/windows
partimage --batch restore /dev/sda1 /mnt/windows/win_backup.bz2
umount /mnt/windows
reboot
#================================================

6 - Resize you C partition and create another one which will contain the backup.