Do you want to know how to reactivate Linux loaders GRUB and LILO? Then please read on.
GRUB
- Boot from Linux installation CD and enter rescue mode;
- 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
- Generate /etc/mtab:
- #grep -v rootfs /proc/mounts > /etc/mtab
- 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. - 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
- 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>
- Reboot.
LILO
- Boot from Linux installation CD and enter rescue mode;
- 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
- Run the following command to reactivate LILO:
- #/sbin/lilo
- #grub-install /dev/
[…] Reactivate boot loader. See Reactivating Linux Loaders (GRUB, LILO). […]