Bare Metal Recovery
First, do your normal backups on their regular schedule. This article is useless if you don't do that.
Next, build yourself a rescue disk. I use tomsrtbt, available at http://www.toms.net/~toehser/rb/. It is well documented and packs a lot of useful tools onto one floppy diskette. There is an active list for it, and the one question I had was quickly and accurately answered. I like that in a product my shop may depend on one day.
Next, figure out how to do the operating system backup you will need so that you can restore your normal backup. I followed Preston's advice and used an Iomega parallel port Zip drive. They get approximately 90MB of useful storage to a disk. Since the scripts I developed for the stage one backup save about 30MB of data, one Zip disk should be plenty for the job at hand.
Much of this is covered in the Zip Drive HOWTO (www.linuxdoc.org/HOWTO/mini/ZIP-Drive.html), so I'll show you exactly what I did. Your mileage may vary. You may have already done a lot of this, in which case your setup may vary. For me the procedure was simplified by not having a printer share the parallel port with the Zip drive.
First, install the driver for the Zip drive, and make a mount point for it:
[root@tester /etc]# modprobe ppa [root@tester /etc]# mkdir /mnt/zip
Insert a suitable line into your fstab:
/dev/sda4 /mnt/zip vfat noauto 0 0Save fstab. Put a Zip disk in the drive. Then you should be able to mount the Zip drive:
[root@tester /etc]# mount /mnt/zip [root@tester /etc]# ls -l /mnt/zip total 277 drwxr-xr-x 2 root root 16384 Dec 31 1969 . drwxr-xr-x 7 root root 1024 May 11 08:34 .. -rwxr-xr-x 1 root root 265728 Jan 30 1998 50ways.exe
Zip drives come formatted for MS-DOS or Windows (FAT) or the Mac. The FAT format is somewhat inefficient for what we are doing, although not fatally so. Our test computer setup put about 26MB onto the Zip disk, so you can skip installing the ext2fs on your Zip disk.
Here is how to replace the FAT file system on the Zip disk with an ext2fs. First, unmount the Zip drive:
[root@tester /etc]# umount /mnt/zip
Then run fdisk and see what you have:
[root@tester /etc]# fdisk /dev/sda Command (m for help): p Disk /dev/sda: 64 heads, 32 sectors, 96 cylinders Units = cylinders of 2048 * 512 bytes Device Boot Start End Blocks Id System /dev/sda4 * 1 96 98288 6 DOS 16-bit >=32M Command (m for help):For reasons known only to Murphy and Iomega, FAT Iomega Zip disks have only one partition, partition four. Delete the offending partition:
Command (m for help): d Partition number (1-4): 4 Command (m for help): p Disk /dev/sda: 64 heads, 32 sectors, 96 cylinders Units = cylinders of 2048 * 512 bytes Device Boot Start End Blocks Id SystemPer the Zip drive HOWTO, we will make a new partition as partition 1:
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-96): 1 Last cylinder or +size or +sizeM or +sizeK (-96): 96Displaying the partition table indicates that it was marked as a Linux ext2fs partition for us, so we don't have to change the file system id:
Command (m for help): p Disk /dev/sda: 64 heads, 32 sectors, 96 cylinders Units = cylinders of 2048 * 512 bytes Device Boot Start End Blocks Id System /dev/sda1 1 96 98288 83 Linux nativeUse the w command to write the partition table and exit. We now have to make a file system on the freshly minted partition:
[root@tester /etc]# mke2fs /dev/sda1 mke2fs 1.12, 9-Jul-98 for EXT2 FS 0.5b, 95/08/09 Linux ext2 file system format File system label= 24576 inodes, 98288 blocks 4914 blocks (5.00%) reserved for the super user First data block=1 Block size=1024 (log=0) Fragment size=1024 (log=0) 12 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 16385, 24577, 32769, 40961, 49153, 57345, 65537, 73729, 81921, 90113 Writing inode tables: done Writing superblocks and file system accounting information: doneNow we go back to fstab and add a new entry:
/dev/sda1 /mnt/zip ext2 noauto 0 0This lets us specify which file system we have on the Zip disk by mounting the device file rather than the mount point. For example:
[root@tester /etc]# mount /dev/sda1The order in which you place the two lines in /etc/fstab is important. The first one determines whether the default partition mount will try to mount if you specify /mnt/zip. So put this line above the entry you made earlier. We will use this in the script that saves the stage one data to the Zip disk.
- The Ubuntu Conspiracy
- Science on Android
- A First Look at IBM's New Linux Servers
- Vigilante Malware
- Disney's Linux Light Bulbs (Not a "Luxo Jr." Reboot)
- Vagrant Simplified
- Bluetooth Hacks
- System Status as SMS Text Messages
- Libreboot on an X60, Part I: the Setup
- October 2015 Issue of Linux Journal: Raspberry Pi