Replace Lilo with Grub

I updated the kernel image via aptitude on one of my Debian Sarge servers but after a reboot it didn’t come up again. My first thought was that maybe there was something wrong with the boot loader and since I already wanted to switch from Lilo to Grub I took the opportunity and did just that.

Luckily the changeover is very easy, just follow those steps:

  1. aptitude install grub
  2. grub-install /dev/hda (Replace /dev/hda with the disk you want to install your bootloader on)
  3. update-grub to create the file menu.lst which holds all the information for booting with Grub
  4. Now we have to remove Lilo: aptitude purge lilo

That’s all folks! :)

If you want to automatically update the menu.lst whenever you install a new kernel, add the following to /etc/kernel-img.conf:
do_bootloader = no
do_initrd = Yes
postinst_hook = /sbin/update-grub
postrm_hook = /sbin/update-grub

…and now, reboot!

About Florian Beer

I am running my own company 42dev where I provide web application development & hosting services for my clients.

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>