You cannot avoid accidents and if it happens to linux systems then it may damage the master boot record (MBR) or LILO (Linux boot Loader). There may be cases where linux will not boot due to hard disk failures. The LILO may also fail if you accidentally re-partition the hard disk or you install another additional operating system like Windows 98/NT on the linux computer.
This document gives you some ideas, tips and quick guide to recover fast without wading through hundreds of pages of documentation on LILO or Linux.
Follow these steps to recover from LILO or system failures.
Get the tomsrtbt floppy http://www.toms.net/rb Boot with tomsrtbt floppy Use fdisk /dev/hda to find the partitions Edit /etc/fstab and put (sample code given here) -
/dev/hda4 /a4 ext2 defaults 1 1 /dev/hda1 /a1 vfat defaults 1 1 On my computer hda4 contains the linux boot/root partition and hda1 has windows 95 vfat system. bash# mkdir /a4 /a1 bash# mount /a4 bash# mount /a1 and repair the system
Follow scene 1 above, if that fails then If you made the boot disk with 'mkbootdisk' (during install or by using 'man mkbootdisk'), boot with it and repair your partitions
If you have another computer running linux, then login as root and do -
bash$ man mkbootdisk bash# cp /etc/lilo.conf /etc/lilo-original.conf
bash# mkbootdisk /dev/fd0
Step 1: Boot tomsrtbt and mounts the partitions and backup the root partition to another partition having space with comamnd - Edit /etc/fstab and put (sample code given here) -
/dev/hdb1 /a1 vfat defaults 1 1 bash$ mkdir /b1; mount /b1 bash$ cd / bash$ tar cvf /b1/root-a4.tar a4
Step 2: Insert Linux cdrom, reboot and install the redhat linux on /dev/hda4 (but DO NOT install any extra packages, you just need to install only the root, boot systems and LILO manager that is, a very bare minimum). This will also install the LILO on hard disk. Boot linux now and login as root and do -
bash$ man mkbootdisk bash# cp /etc/lilo.conf /etc/lilo-original.conf
bash# mkbootdisk /dev/fd0
You should take the following pre-cautionary measures to tackle the problems in future.
bash$ man mkbootdisk The mkbootdisk is in mkbootdisk*.rpm package, you must install this. bash$ mkbootdisk --help bash$ mkbootdisk --device /dev/fd0 2.2.12-20
You can replace the boot sector with the DOS boot loader by issuing the DOS command:
FDISK /MBR
See also LILO documentation on linux at /usr/doc/lilo* for other methods of uninstalling the LILO. And see also 'man lilo'.