Added by ermo | Rune Morling, last edited by Alexandre Franke on Mar 31, 2010  (view change)

Labels:

grub grub Delete
syslinux syslinux Delete
Edit
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Migrating from grub to syslinux/extlinux in fl:2

From alpha2 and onwards, fl:2 has included the syslinux/extlinux bootloader created by H. Peter Anvin (hpa in #foresight).

This short HOWTO describes how to migrate from a grub based setup to the new syslinux/extlinux setup as per hpa's suggestions.

Check prerequisites

NOTE: Unless otherwise stated, files and versions correspond to alpha3

First of all, syslinux/extlinux only works if the following conditions are met:

  • The partition containing /boot is a real partition, not an LVM partition.
  • The partition containing /boot is formatted with an ext2 or ext3 filesystem.

Assuming that the above conditions are met, proceed to check that syslinux and extlinux are installed:

[ermo@gizmo ~]$ conary q syslinux extlinux
syslinux=3.61_pre1-1-1
extlinux=3.61_pre1-1-1

Then check that your /etc/bootman.conf looks roughly like this:

[ermo@gizmo ~]$ cat /etc/bootman.conf 
# Set the boot loader here
BOOTLOADER=syslinux
#BOOTLOADER=grub

# Bootloader-specific options
SYSLINUX_MENU=vesamenu

The kernel packages include configuration files for the bootloader. Check that the configuration file looks something like this:

[ermo@gizmo ~]$ cat /etc/bootloader.conf 
default 2.6.23.14-0.0.1.smp.gcc4.1.x86.i686
include '/etc/bootloader.d/*'
linux 2.6.23.14-0.0.1.smp.gcc4.1.x86.i686 'Foresight Linux 1.9.9.alpha3+20080117 (2.6.23.14-0.0.1.smp.gcc4.1.x86.i686)' /boot/vmlinuz-2.6.23.14-0.0.1.smp.gcc4.1.x86.i686 /boot/initrd-2.6.23.14-0.0.1.smp.gcc4.1.x86.i686.img

Transfer the new Master Boot Record (MBR) bootloader code to your boot disk

Check that the size of the new syslinux/extlinux MBR (/usr/share/syslinux/mbr.bin) is < 440 bytes in size. If it is any larger, it is corrupt and installing it will hose your partition table. You have been warned.

(In the instructions below, the primary boot disk is assumed to be /dev/sda)

[root@gizmo ~]$ ls -l /usr/share/syslinux/mbr.bin 
-rw-r--r-- 1 root root 410 2007-11-20 22:03 /usr/share/syslinux/mbr.bin
[ermo@gizmo etc]$ sudo su -
Password:
[root@gizmo ~]# cat /usr/share/syslinux/mbr.bin > /dev/sda

Mark your /boot partition active

Use fdisk, parted, or any partitioning program to set your /boot partition active (in the example, the /boot partition is already active, so no changes need to be made):

[root@gizmo ~]# fdisk -l /dev/sda

Disk /dev/sda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       14946   119949322+  8e  Linux LVM

Initialize extlinux and the boot menu

[root@gizmo ~]# extlinux --install /boot/extlinux
/boot/extlinux is device /dev/sda1
[root@gizmo ~]# /sbin/bootman

NOTE: OgMaciel reports that the extlinux command returns /dev/root, not /dev/sda1 in his VMWare install.

That's it!

You should now try to reboot your system and check that the new configuration works. You might want to keep a bootable foresight DVD handy just in case