Friday, May 6, 2011

How to Install GRUB Legacy

All major distributions are switching over or have already switched over to GRUB2 , but there are few which are still using GRUB Legacy. Below is a simple method of installing GRUB Legacy on debian which can be used on other distros also using their own package managers .

  •  Install grub package    
       # apt-get install grub

  • Edit /boot/grub/menu.lst (Use can use for sample /usr/share/doc/grub-0.97/menu.lst) 
# Sample boot menu configuration file
   # Boot automatically after 5 secs.
    timeout 5
# By default, boot the first entry.
     default 0

      title Linux
  kernel /boot/vmlinuz root=/dev/sda5
  initrd /boot/initrd.img
(replace /dev/sda5 with your root partition name)
  • Install loader to MBR
# grub-install /dev/sda
  • Reboot system to check that bootloader works properly
    or not 


Muzzammil Khan said...

Salaam .. How are you doctor sahab ? Hope your health is better now . Keep posting. Duas :)

iasdbu said...

I don't know if you have actually tried what you describe here. In debian squeeze (currently the stable branch of debian), 'apt-get install grub' pulls grub-pc which is grub2 and which comes pre-installed. If you want to install grub legacy you'll have to do something like 'apt-get purge grub-pc && apt-get install grub-legacy'. Then you'll have to enter some grub commands in order to have the grub files (stage files, menu.lst etc) under /boot generated, set the root partition, and install on MBR. For me it didn't work, it always complained something about the stage1 file couldn't be read properly, although the stage file was where it supposed to be. I couldn't get grub legacy to work on debian, and if you ask me, I think they messed this up from the moment they chose grub2 as default.

Dr.Saleem Khan said...

Thank you Muzzammil Khan , I am much better by the grace of Allah .

iasdbu,I understand what you mean , but as I said in my post there are many distros still using grub legacy e.g Arch Linux , PCLinuxOS , Unity and few others I use . Ofcourse for those who have switched to grub2 its a different story.apt is used by PCLinuxOS and ALT Linux also not just debian . I still use grub legacy and ext 3 with testing repos on my debian installation , I used antiX core for building up this system . First I thought GRUB2 was a mistake but now with time I have learned how to boot distros with either grub or grub 2 as multiboot system , so it doesn`t matter . Its just matter of tweaking it , imho grub/grub2 is the easiest thing in linux computing .