Reply to comment

Setup Extlinux Instead of GRUB for Booting Ubuntu

Last Updated: 16-Aug-2011

After installing Ubuntu on a desktop PC, you may want use a bootloader other than GRUB for some reasons. For me, GRUB is not (yet?) able to boot my Intel DG965RY motherboard properly. (Check this for details.) You can choose to use extlinux [syslinux.zytor.com], which is a variant of the famous syslinux [syslinux.zytor.com] bootloader for ext2/ext3/ext4 filesystems. The steps here have been tested on from Ubuntu 8.10 to Ubuntu 11.04 (Natty) (wow, time flies!) but should be applicable to other Linux distros as well.

1. Preparation

You need to have a Ubuntu Live Installation CD / USB stick to do the job.

2. Installation

2.1. Install Extlinux on Bootable Ext3/Ext4 Partition

  1. Boot the Ubuntu Live Installation CD / USB stick.
  2. Set the bootable flag of the partition you want to install extlinux to be active. The partition must use the ext2/ext3/ext4 filesystem, and should contain the /boot directory. You can use fdisk and its command 'a' to toggle the bootable flag of each partition.
  3. Open a terminal. Type extlinux to check if you have it. If not, you have to connect to the internet, enable the 'Universe' repository, reload the package information, and install it. If internet is not available, consider using other rescue CDs to do the job.
  4. Mount the partition you want to install extlinux. For example, if the partition is /dev/sda3, then do:
    $ sudo mount /dev/sda3 /mnt
    
  5. Install the extlinux on the partition.
    $ sudo mkdir -p /mnt/boot/extlinux/
    $ sudo extlinux -i /mnt/boot/extlinux/
    

    This will install a file extlinux.sys under /boot/extlinux/ and update the boot sector of the bootable partition.

  6. Install the Master Boot Record
    $ sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda
    

    (I tried to use 'cat' but encounter 'Permission denied' problem.)

2.2 Create a Simple Extlinux Configuration File

Create a simple extlinux configuration file /boot/extlinux/extlinux.conf in the bootable partition. No need to rush for a sophisticated one because it is better to test if extlinux really works first. Below is a simple but working configuration file:

DEFAULT Ubuntu
LABEL Ubuntu
  KERNEL /boot/vmlinuz-2.6.38-8-generic
  APPEND initrd=/boot/initrd.img-2.6.38-8-generic root=UUID=82498ebf-f596-45b7-b81a-940bf73a6d6a ro quiet splash
TIMEOUT 30
PROMPT 1

This asks extlinux to give you a prompt, and wait for your for 3 seconds before it boots the default image. If you give the PROMPT a value of 0, then the prompt will be displayed only if the Shift or Alt key is pressed, or Caps Lock or Scroll lock is set.

If your are using an old Ubuntu system which is still using GRUB1 instead of GRUB2, then you can refer to /boot/grub/menu.lst and 'translate' the entry for extlinux easily. What about GRUB2? It is better that you figure out the information required by hand.

  • Kernel File: Use the latest kernel file name in /boot/vmlinuz-*.
  • initrd=: Use the latest initrd file name in /boot/initrd.img-*. It should match the kernel file.
  • root=UUID=: The root partition, which is the UUID for /dev/sda3 in our example. The easiest way to get the UUID is by issuing $ sudo blkid. You can also get it by visiting /dev/disk/by-uuid/. (Can you refer to /dev/sda* instead of using UUID? You can, but you may encounter some problems if you use several hard disks. Especially if some use SATAs, or you need to change your hard disk(s).)

2.3. Reboot and Further Enhancement

Reboot the computer, and extlinux should work! Done!
Once it is working properly, you may want to customize the configuration file more according to suit your need.

3. Useful Notes & Tips

  • If Ubuntu updates the latest kernel image, you have to update the extlinux.conf file manually. For safety, create a new entry instead of replacing the existing one!
  • Ubuntu will not overwrite the MBR after installing new kernel images, unless it updates its grub to a new version.
  • If the MBR is overwritten by something else, just boot from the Ubuntu Live CD / USB stick again and reinstall the MBR.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions. (Case-insensitive)