From ArchWiki
Revision as of 05:11, 15 May 2011 by Mic92 (talk | contribs) (→‎Chainloading: fix layout, add use case for grub2)
Jump to navigation Jump to search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary end

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.

Note: Since Syslinux 4, Extlinux and Syslinux are the same thing.

Syslinux Boot Process

At boot, the computer loads the MBR (Template:Filename). Then the MBR looks for the partition that is marked as active (boot flag). Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of Template:Filename is hard-coded into the VBR. The VBR will execute (Template:Filename). Therefore, if the location of Template:Filename changes, syslinux will no longer boot. In the case of btrfs, the above method will not work since files move around resulting in the sector location of Template:Filename changing. Therefore, the entire Syslinux code needs to be stored outside the filesystem. The code is stored in the sectors following the VBR. Once Syslinux is fully loaded, it looks for a configuration file, either Template:Filename or Template:Filename. If one is found, the configuration file is loaded. If no configuration file is found you will be given a syslinux prompt.


Automatic Install - syslinux

The syslinux-install_update script will install Syslinux, copy COM32 modules to Template:Filename, set the boot flag and install the MBR. It can handle MBR and GPT disks along with softraid.

1. Install Syslinux

pacman -Syu syslinux

2. Make sure Template:Filename is mounted
3. Run syslinux-install_update script -i (install) -a (set boot flag) -m (install mbr)

/usr/sbin/syslinux-install_update -iam

4. Edit Template:Filename

Manual Install - syslinux

Note: If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time, GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:
# fdisk -l /dev/sda

or alternatively

# sgdisk -l /dev/sda

will show " GPT: not present" if it is not a GPT disk.

Note: If you are trying to rescue an installed system with a live CD, be sure to chroot into it before executing these commands. If you do not chroot first, you must prepend all file paths (not /dev/ paths) with the mount point.

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

# mkdir /boot/syslinux
# extlinux --install /boot/syslinux #run on a mounted directory (not /dev/sdXY)
/boot/syslinux/ is device /dev/sda1

MBR Partition Table

Next, you need mark your boot partition active in your partition table. Applications capable of doing this include fdisk, cfdisk, sfdisk, (g)parted. It should look like this:

# 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

Install the master boot record:

# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sda

GUID Partition Table aka GPT

Main article GUID_Partition_Table

Bit 2 of the attributes for the /boot partition need to be set.

# sgdisk /dev/sda --attributes=1:set:2

This would toggle the attribute legacy bios bootable on partition 1


# sgdisk /dev/sda --attributes=1:show
1:2:1 (legacy BIOS bootable)

Install the master boot record:

# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda


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

Configuring syslinux

The syslinux configuration file, Template:Filename should be created in the same directory where you installed syslinux. In our case '/boot/syslinux/'

The bootloader will look for either Template:Filename (preferred) or Template:Filename


  • Instead of LINUX, the keyword KERNEL can also be used. KERNEL tries to detect the type of the file, while LINUX always expects a Linux kernel.
  • TIMEOUT value is in units of 1/10 of a second.


Basic Syslinux Config

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

LABEL archfallback
        LINUX ../vmlinuz26
        APPEND root=/dev/sda2 ro
        INITRD ../kernel26-fallback.img

If you want to boot directly without seeing a prompt, set PROMPT to 0.

Text 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/


UI menu.c32


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

LABEL archfallback
        MENU LABEL Arch Linux Fallback
        LINUX /vmlinuz26
        APPEND root=/dev/sda2 ro
        INITRD /kernel26-fallback.img

For more details about the menu system, see;a=blob;f=doc/menu.txt.

Graphical Boot menu

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

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

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

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

This config uses the same menu design as the Arch Install CD: syslinux.cfg

The background file can be found here: splash.png


UI vesamenu.c32


# Refer to

MENU COLOR border       30;44   #40ffffff #a0000000 std
MENU COLOR title        1;36;44 #9033ccff #a0000000 std
MENU COLOR sel          7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel        37;44   #50ffffff #a0000000 std
MENU COLOR help         37;40   #c0ffffff #a0000000 std
MENU COLOR timeout_msg  37;40   #80ffffff #00000000 std
MENU COLOR timeout      1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07        37;40   #90ffffff #a0000000 std
MENU COLOR tabmsg       31;40   #30ffffff #00000000 std

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

LABEL archfallback
        MENU LABEL Arch Linux Fallback
        LINUX ../vmlinuz26
        APPEND root=/dev/sda2 ro
        INITRD ../kernel26-fallback.img

Since Syslinux 3.84 vesamenu.c32 supports the "MENU RESOLUTION $WIDTH $HEIGHT" directive. To use it, insert "MENU RESOLUTION 1440 900" into your config for a 1440x900 resolution. The background picture has to have exactly the right resolution however as syslinux will otherwise refuse to load the menu.


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 [1].

If you have grub2 installed in your boot partition, you can chainload it by using:

LABEL grub2
       MENU LABEL Grub2
       COM32 chain.c32
       append file=../grub/boot.img

This maybe required for booting from iso images.

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/. For pci info either copy or symlink Template:Filename to Template:Filename

        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


I have a Syslinux Prompt - Yikes!

You can type in the LABEL name of the entry that you want to boot (as per your syslinux.cfg). If you used the example configs just type

boot: arch

If you get an error that the config file could not be loaded you can pass your needed boot parameters

boot: vmlinuz26 root=/dev/sda2 ro initrd=/kernel26.img

Windows boots up! No Syslinux!

Solution: Make sure the partition that contains /boot has the boot flag enabled. Also, make sure the boot flag is not enabled on the windows partition. See the installation section above.

The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The windows partition was likely found first and had the boot flag set. If you wanted you could use the MBR that windows or msdos fdisk provides.

Menu Entries do nothing

You select a menu entry and it does nothing. It "refreshes" the menu
This usually means that you have an error in your configuration. Hit Template:Keypress to edit your boot parameters. Alternatively, press Template:Keypress and type in the LABEL of your boot entry (Example: arch)

Can't remove ldlinux.sys

ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled. To remove:

chattr -i /boot/syslinux/ldlinux.sys
rm /boot/syslinux/ldlinux.sys

External link