Windows Backup/Restore works
Bernd Broermann
bernd at broermann.com
Sun May 16 19:04:47 CEST 2004
Hallo ,
I can now backup/restore Windows machines.
Thanks to Thomas Lange.
Here a description:
I.
/etc/fai/fai.conf
NFSROOT_PACKAGES="expect libbz2-1.0 partimage"
I used partimage 0.6.1-13 which ist in stable Debian.
6.4 , which is in KNOPPIX 3.3 can backup ntfs ( experimental ) too.
II. A script for moving CLASS Names
#!/bin/sh
# Bernd Broermann
# 8.5.2004
# ~/faiclassmove DEFAULT DEBIAN | sh
for I in $(find /usr/local/share/fai -name *$1*)
do
NEW=`echo $I | sed s/$1/$2/`
echo "mv " $I $NEW
done
switch of standard Routines,which access the harddisk with NO_DISK_TASK.
III. Hook scripts
faiserver:/usr/local/share/fai# find . -name *NO_DISK_TASK
./hooks/mirror.NO_DISK_TASK
./hooks/confdir.NO_DISK_TASK
./hooks/chboot.NO_DISK_TASK
./hooks/mountdisks.NO_DISK_TASK
./hooks/extrbase.NO_DISK_TASK
./hooks/finish.NO_DISK_TASK
./hooks/instsoft.NO_DISK_TASK
./hooks/partition.NO_DISK_TASK
./hooks/updatebase.NO_DISK_TASK
the scripts look like
# !/bin/bash
SCRIPTNAME=`basename $0`
skiptask=`echo $SCRIPTNAME | sed "s/\..*$//"`
skiptask $skiptask
IV. classes WINDOWS_BACKUP and WINDOWS_RESTORE
Two classes WINDOWS_BACKUP and WINDOWS_RESTORE are defined
./class/WINDOWS_BACKUP
./class/WINDOWS_RESTORE
./class/WINDOWS_BACKUP.var
FAI_ACTION="install"
partimage_nfsdir="nfsserver:/scratch"
./class/WINDOWS_RESTORE.var
FAI_ACTION="install"
partimage_nfsdir="nfsserver:/scratch"
./scripts/WINDOWS_BACKUP/S9partimage
#!/bin/sh
# Bernd Broermann
# 7.5.2004
#
# $partimage_nfsdir set in class/WINDOWS_BACKUP.var
mount $partimage_nfsdir /mnt
dd if=/dev/hda of=/mnt/windows-${HOSTNAME}_${IPADDR}.mbr count=1 bs=512
partimage --batch -f3 -V 10000000 -z1 -o -d save /dev/hda1
/mnt/windows-${HOSTNAME}_${IPADDR}.tgz > /dev/tty1
./scripts/WINDOWS_RESTORE/S9partimage
#!/bin/sh
# Bernd Broermann
# 7.5.2004
#
# $partimage_nfsdir set in class/WINDOWS_BACKUP.var
mount $partimage_nfsdir /mnt
[ -r /mnt/windows-${HOSTNAME}_${IPADDR}.tgz.000 ] || exit 1
echo "Restore MBR from ${HOSTNAME}"
partimage --batch -f3 restmbr /mnt/windows-${HOSTNAME}_${IPADDR}.tgz.000
> /dev/tty1
# or dd if=/mnt/windows-${HOSTNAME}_${IPADDR}.mbr of=/dev/hda
#
partimage --batch -f3 restore /dev/hda1
/mnt/windows-${HOSTNAME}_${IPADDR}.tgz.000 > /dev/tty1
V. The class for the windowsclient contains
NO_DISK_TASK
WINDOWS_BACKUP
Like this it works.
One can make some better scripts , because my are looking ugly.
cu
bernd
--
Broermann Technologie-Beratung
Brillkamp 65
22339 Hamburg
Tel: 040/53888870
< Sichere E-Mails mit freier Software : Empfohlen und unterstützt vom
Bundesministerium für Wirtschaft und Technologie.
[ http://www.gnupp.de ] >
More information about the linux-fai
mailing list