A Sample Bare-Metal Recovery

This example uses pax (emulating tar), gzip, fdisk, lilo, and tomsrtbt to back up and recover a complete Linux system on an (Intel) Toshiba Satellite Pro laptop.

Performing the Backup

As mentioned earlier, I backed up the metadata by running the command:

# fdisk -l >/etc/fdisk-l.txt

We then backed up the operating system using pax (emulating tar) to a Zip drive mounted on /backup:

# cd / ; tar cf - . |gzip -c >/backup/root.tar.gz

Now it’s time to blow it up! The following dd command blows away both the lilo boot block and the disk’s partition information. Although the root filesystem is still there, we couldn’t find it if we wanted to!

# dd if=/dev/zero of=/dev/hda bs=512 count=1
# reboot
Insert system disk in drive
Press any key when ready.

Perform the Recovery

As mentioned in the preceding explanation, we will need to boot the system, partition its drives, create the root filesystem, restore the system, and reinstall the boot image.

Boot the system

The first step in recovering this system is to place the tomsrtbt floppy into the floppy drive and press any key. Here’s what it displays while it is booting:

Welcome to tomsrtbt-1.7.134 http://www.toms.net/rb ##### ####### ##O#O## #VVVVV# ## VVV ## # ## # ## ~ # ### . . QQ# ##Q /V\ QQQQQQ# #QQQQQQ // \\ QQQQQQQ# #QQQQQQ /( )\ QQQQQ#######QQQQ ^`~'^ Other distributions tomsrtbt (15 seconds...) boot: Loading zImage.............. Press <RETURN> to see video modes available, <SPACE> to continue or wait 30 secs ...

Get Unix Backup and Recovery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.