Sunday, July 19, 2009

Booting Slackware with GRUB (GNU Grand Unified Bootloader)

GRUB is an alternative bootloader to LILO. As you know, Slackware comes with LILO as default. Slackware has legacy version of GNU GRUB package in /extra section. This package also includes Ken Robotti's 'grubconfig' tool similar to 'liloconfig' tool. Now we are going to simply remove LILO package and install GRUB package (I assume that you have configured 'slackpkg' utility).

# removepkg lilo
# slackpkg install grub

Run grubconfig by:

# grubconfig

I prefer expert GRUB setup menu.

Start to create GRUB config file with a GRUB header.

Choose frame buffer console size.

Select GRUB target location. I had installed LILO onto the master boot record of my hard drive. Choosing GRUB install location as MBR overwrites LILO.

Choose the GRUB files save location. This is the location where /boot directory is located. In my case, /dev/sda1 is the root partition of my Slack and consists of /boot directory.

Add your Slackware partition with Linux option. Using Linux and Other options, you can add other operating systems you have to GRUB configuration file.

Finally install GRUB with Install option.

You can change GRUB VGA resolution for more readable booting by editing /boot/grub/menu.lst file.

# nano /boot/grub/menu.lst

# GRUB configuration file '/boot/grub/menu.lst'.
# generated by 'grubconfig'. Sun Jul 19 01:55:59 2009
# The backup copy of the MBR for drive '/dev/sda' is
# here '/boot/grub/mbr.sda.3676'. You can restore it like this.
# dd if=mbr.sda.3676 of=/dev/sda bs=512 count=1
# Start GRUB global section
#timeout 30
#color light-gray/blue black/light-gray
# End GRUB global section
# Linux bootable partition config begins
title Slackware-current on (/dev/sda1)
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sda1 ro vga=794
# Linux bootable partition config ends
title --- For help press 'c', type: 'help'
root (hd0)
title --- For usage examples, type: 'cat /boot/grub/grub.txt'
root (hd0)

Find vga=xxx part in /boot/grub/menu.lst file and replace xxx with a suitable VGA code from the below table.


  1. Thanks just what I needed ...

  2. Well I must say it worked first time. This is my first time installing slackware and I must have spent 6 hrs trying to get lilo to work without any joy. So credit to you

  3. nice articel btw i can't install grub using slackpkg......
    ??? any idea?

  4. Have you configured slackpkg? What error message(s) you get?

  5. You don't *have* to use slackpkg to install grub. (although it IS highly reccomended) Grub can be installed via the "installpkg" utility. (installpkg /path/to/pkg/pkgname)