Section 11.6. Live Method


11.6. Live Method

This example uses tar to back up and recover the system at the partition level, which allows the system to be online. The procedure was tested on a Linux system. We did not test this on a Windows system because we could not identify a single utility available in Windows and Knoppix that preserves ACLs. Your experience may be different.

11.6.1. Create the Bare-Metal Backup

Use the following steps to create a bare-metal backup of your system.

11.6.1.1. Back up the important metadata

Back up the MBR by running the following command:

# dd if=/dev/hda of=/backups/mbr bs=512 count=1

11.6.1.2. Back up the operating system with a native utility

Create a mount point, and mount a NFS directory as /backups:

# mkdir /backups # mount nfsserver:/data08/curtis /backups

See the previous section "Assumptions"if either DHCP or NFS isn't available.


You can use whatever method you like to back up the operating system at this point. For this example, we chose tar. Our example has one partition mounted as /boot, and the rest of the OS on /.

# cd /boot # tar cf /backups/boot.tar . # cd / # tar cf /backups/system.tar --exclude /mnt --exclude /proc --exclude /boot --exclude /backups .

Alternatively, you could use compression. This may speed up or slow down the backup, depending on where the bottleneck is.

# cd /boot # tar cfz /backups/boot.tar.gz . # cd / # tar cfz /backups/system.tar.gz --exclude /mnt --exclude /proc --exclude /boot --exclude /backups .

11.6.2. Perform a Bare-Metal Recovery

Use the following steps to recover your system from bare metal.

11.6.2.1. Boot the system from alternate media

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, open a terminal window and switch to the root user, then mount your NFS directory:

knoppix@0[knoppix]$ su - # mkdir /backups # mount nfsserver:/data08/curtis /backups

See the previous section "Assumptions"if either DHCP or NFS isn't available.


11.6.2.2. Restore the boot block information and prepare the new root drive

For restoring by partition, you need to restore the MBR and partition table and then restore each partition. 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 also need to prepare the partitions for a filesystem restore. If the fstab backup shows they were ext2 filesystems, run the following commands. (Obviously, this part varies based on the types of filesystems you're using.)

# mkfs t ext2 /dev/hda1 -L /boot # mkfs t ext2 /dev/hda2 -L /

11.6.2.3. Restore the operating system

You are now ready to restore the operating system. Mount the partitions:

# mount /dev/hda1 # mount /dev/hda2

Knoppix, by default, creates a mount point for each partition it sees, so you should already have /mnt/hda1 and /mnt/hda2 available, and the command mount /dev/hda1 mounts that partition to /mnt/hda1. If you don't, you need to create them first.


cd to the location of the new root filesystem and run the restore commands.

# cd /mnt/hda1 # tar xpkf /backups/boot.tar # cd /mnt/hda2 # tar xpkf /backups/system.tar

Or, if you chose compression, run these commands:

# cd /mnt/hda1 # tar xpkfz /backups/boot.tar.gz # cd /mnt/hda2 # tar xpkfz /backups/system.tar.gz

All you need to do now is eject the Knoppix CD and reboot.




Backup & Recovery
Backup & Recovery: Inexpensive Backup Solutions for Open Systems
ISBN: 0596102461
EAN: 2147483647
Year: 2006
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net