Tvorba image systému

Save the ENTIRE PARTITION TABLE to a file using sfdisk.
sfdisk –d /dev/hda > /mnt/images/backup/partfile
Save the MBR to a file...
dd if=/dev/hda of=/mnt/images/backup/mbrfile bs=512 count=1

The clone script will restore that partition table and MBR from files to the new hard drive using the commands:
sfdisk /dev/hda < /mnt/images/backup/partfile
dd if=/mnt/images/backup/mbrfile of=/dev/hda bs=512 count=1



#!/bin/bash
#
clear
echo
echo "********************************************************************"
echo " Caution!!! This program will erase your hard drive"
echo
echo -n " Do you want to proceed (Y/N)?"
read answer
if test "$answer" != "Y" -a "$answer" != "y";
then exit 0;
fi
#
clear
#
#Erase the old boot sector
dd if=/dev/zero if=/dev/hda bs=512 count=1
#
#Restore the partition table from file
sfdisk /dev/hda < /mnt/images/backup/partfile
#
#Restore the MBR from file
dd if=/mnt/images/backup/mbrfile of=/dev/hda bs=512 count=1
clear
#
#Restore the images with Partimage
partimage restore -b -z2 -f3 /dev/hda1 /mnt/images/backup/windows.000
#
partimage restore -b -z2 -f3 /dev/hda2 /mnt/images/backup/linux.000
#
clear
echo "Image restore is complete"
echo
#
#End