11.5.
|
|
You then back up the operating system to the NFS directory using dd . You can find which partitions you need and back up just those partitions using these commands:
# fdisk -l Disk /dev/hda: 41.1 GB, 41174138880 bytes 255 heads, 63 sectors/track, 5005 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 4874 39045982+ 83 Linux /dev/hda3 4875 5005 1052257+ 82 Linux swap / Solaris # dd if=/dev/hda1 of=/backups/hda1.dd # dd if=/dev/hda2 of=/backups/hda2.dd
|
Alternatively, you can also use compression. Depending on where your bottlenecks are, this may speed things up or slow them down.
# dd if=/dev/hda1 gzip c > of=/backups/hda1.dd.gz # dd if=/dev/hda2 gzip c > of=/backups/hda2.dd.gz
You can place an
&
(ampersand) at the end to allow the backups to occur
Use the following steps to recover your system from bare metal.
The first step in recovering this system is to place the Knoppix CD into the CD drive and boot up the system. A check of the partition table at this point shows the following:
# fdisk -l Disk /dev/hda: 41.1 GB, 41174138880 bytes 16 heads, 63 sectors/track, 79780 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Disk /dev/hda doesn't contain a valid partition table
As before,
knoppix@0[knoppix]$ su - # mkdir /backups # mount nfsserver:/data08/curtis /backups
|
For restoring by partition, you need to restore the MBR and partition table and then restore each partition. You can restore the MBR and partition table by running the following command:
# dd if=/backups/mbr of=/dev/hda bs=512 count =1
In order to get Knoppix to recognize without a reboot that we had recovered the MBR, we found it was necessary to actually run fdisk /dev/hda and then choose w to write the partition to disk. A reboot works as well but takes longer.
You are now ready to actually restore the operating system. Use dd in the reverse order that you used to back up the operating system:
# dd if=/backups/hda1.dd of=/dev/hda1 # dd if=/backups/hda2.dd of=/dev/hda2
If you used the compression option in the backup, you should use these commands:
# gzip dc /backups/hda1.dd.gz dd of=/dev/hda1 # gzip dc /backups/hda2.dd.gz dd of=/dev/hda2
Again, we knew that there was nothing of value in /dev/hda3 .
You can place an
&
at the end to allow the
All you have to do now is remove the Knoppix CD and reboot.