Next Previous Contents

1. Introduction

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.

1.1 Quick Steps to recovery

Follow these steps to recover from LILO or system failures.

  1. SCENE 1: If your system does not boot -

    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
    

  2. SCENE 2: If LILO is not working..

    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

  3. SCENE 3: If 1 and 2 above fails and you do not have boot disk

    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
    

    Edit the /etc/lilo.conf and put the root partition name as you obtained in 'scene 1' above and insert a blank floppy and give -
    bash# mkbootdisk /dev/fd0
    

    Take this floppy and goto scene 2

  4. SCENE 4: If scenes 1, 2 and 3 above fails then

    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
    

    Edit the /etc/lilo.conf and put the root partition name as you obtained in 'scene 1' above and insert a blank floppy and give -
    bash# mkbootdisk /dev/fd0
    

    Test this boot floppy to see that this works and then restore back the all the files which you backedup using tar on /b1/root-a4.tar as in step 1 above.

1.2 Precautionary measures

You should take the following pre-cautionary measures to tackle the problems in future.

1.3 Removing LILO

You can replace the boot sector with the DOS boot loader by issuing the DOS command:


        FDISK  /MBR

where MBR stands for "Master Boot Record".

See also LILO documentation on linux at /usr/doc/lilo* for other methods of uninstalling the LILO. And see also 'man lilo'.


Next Previous Contents