From ArchWiki
Revision as of 17:41, 8 October 2010 by Brain0 (talk | contribs) (Initial syslinux HOWTO)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syslinux is a collection of boot loaders capable of booting from hard drives, CDs and over the network via PXE. It supports the fat, ext2, ext3, ext4 and btrfs file systems.

Using syslinux to boot your Arch Linux system

Installing syslinux

Make sure you have the syslinux package installed. Then install syslinux onto your boot partition, which must contain a ext2, ext3, ext4 or btrfs file system.

# mkdir /boot/syslinux
# extlinux --install /boot/syslinux
/boot/syslinux/ is device /dev/sda1

Next, you need mark your boot partition active in your partition table:

# fdisk -l /dev/sda
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      104447       51200   83  Linux
/dev/sda2          104448   625142447   312519000   83  Linux

Once that is the case, install a master boot record:

# cat /usr/lib/syslinux/mbr.bin > /dev/sda

When you reboot your system now, you will have a syslinux prompt. To automatically boot your system, you still need to create a configuration file.

Configuring syslinux

The syslinux configuration file is syslinux.cfg in the syslinux folder, in our case /boot/syslinux/syslinux.cfg.

Booting Arch Linux

This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.


LABEL arch
        LINUX /vmlinuz26
        APPEND root=/dev/sda2 ro
        INITRD /kernel26.img

This example assumes that /boot is a separate mount point. If /boot is the same partition as /, you have to replace /vmlinuz26 by /boot/vmlinuz26 and so on.

If you want to boot directly without seeing a prompt, set PROMPT to 0 above. Instead of LINUX, the keyword KERNEL can also be used. KERNEL tries to detect the file type of the file, while LINUX always expects a Linux kernel.

Boot menu

Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux folder:

# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/

If /boot is the same partition as /, a symlink will also work

# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/

Now, adjust the configuration file:

UI menu.c32


LABEL arch
        MENU LABEL Arch Linux
        LINUX /vmlinuz26
        APPEND root=/dev/sda2 ro
        INITRD /kernel26.img

For more details about the menu system, see [1].


If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the chain.c32 module to the syslinux folder (for details, see the instructions in the previous section). Then, create a section in the configuration file:

LABEL windows
        MENU LABEL Windows
        COM32 chain.c32
        APPEND hd0 3

hd0 3 is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [2].

Using memtest

Use this LABEL section to launch memtest (install the memtest86 package):

LABEL memtest
        MENU LABEL Memtest86+
        LINUX /memtest86+/memtest.bin


HDT (Hardware Detection Tool) displays hardware information. Like before, the .c32 file has to be copied or symlinked from /boot/syslinux/.

        MENU LABEL Hardware Info
        COM32 hdt.c32

Reboot and power off

Use the following sections to reboot or power off your machine.

LABEL reboot
        MENU LABEL Reboot
        COM32 reboot.c32

LABEL poweroff
        MENU LABEL Power Off