HomeSupportKnowledge Base Products

Knowledge Base

Look for:inSearch tips
Topics:

Products

Backup and Deployment
Disk Management
Security and Privacy

Reactivating Linux Loaders (GRUB, LILO)

 Printer Friendly
Last update: October 28, 2008
How to reactivate Linux loaders GRUB and LILO

Solution

GRUB

  1. Boot from Linux installation CD and enter rescue mode;

  2. Mount all partitions and change root from the temporary root to the root partition of the installed system:

    • #mkdir /mnt/tmp
    • #mount /dev/sdXY /mnt/tmp (/dev/sdXY is the root partition)
    • #chroot /mnt/tmp

  3. Generate /etc/mtab:

    • #grep -v rootfs /proc/mounts > /etc/mtab

  4. Check if the GRUB configuration file is correct:

    GRUB stores its configuration in either /boot/grub/grub.conf or /boot/grub/menu.lst depending on the distribution you are using.

  5. Reactivate GRUB automatically:

    Run the following command:

    • #grub-install /dev/[device name]

    where /dev/[device name] is the name of disk/partition where you are going to install GRUB.

      For example, the following command will install GRUB to the MBR of disk /dev/sda:
    • #grub-install /dev/sda

  6. Reactivate GRUB manually in case Step 5 fails:

    • #/sbin/grub

    You will receive a prompt:

      grub>

    Please issue the commands (4 is the root partition in this example):

      grub>root (hd0,4)
      grub> setup (hd0)

    You will see the output:

      Checking if "/boot/grub/stage1" exists... yes
      Checking if "/boot/grub/stage2" exists... yes
      Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
      Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"... 18 sectors are embedded
      .
      succeeded
      Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p (hd0,4)/boot/grub/stage2
      /boot/grub/grub.conf"... succeeded
      Done.
      grub>

  7. Reboot.

LILO

  1. Boot from Linux installation CD and enter rescue mode;

  2. Mount all partitions and change root from the temporary root to the root partition of the installed system:

    • #mkdir /mnt/tmp
    • #mount /dev/sdXY /mnt/tmp (/dev/sdXY is the root partition)
    • #chroot /mnt/tmp
  3. Run the following command to reactivate LILO:

    • #/sbin/lilo

More information

See also:



Article keywords:
Linux     LILO     GRUB     Boot     Activate     Loader
Operating Systems:
Linux Distribution

 
 
Contact us