Syslinux Boot Process

Load MBR. At boot, the computer loads the MBR (/usr/lib/syslinux/mbr.bin).

Search active partition. The MBR looks for the partition that is marked as active (boot flag).

Execute volume boot record. 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 ldlinux.sys is hard-coded into the VBR.

Execute ldlinux.sys. The VBR will execute (ldlinux.sys). Therefore, if the location of ldlinux.sys 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 ldlinux.sys changing. Therefore, the entire Syslinux code needs to be stored outside the filesystem. The code is stored in the sectors following the VBR.)

Search configuration file. Once Syslinux is fully loaded, it looks for a configuration file, either extlinux.conf or syslinux.cfg.

Load configuration. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a Syslinux prompt.

Installation

Automatic Install

The syslinux-install_update script will install Syslinux, copy/symlink *.c32 modules to /boot/syslinux, set the boot flag and install the boot code in the MBR. It can handle MBR and GPT disks along with software RAID.

1. If you use a separate boot partition make sure that it is mounted. Check with lsblk; if you don't see a /boot mountpoint, mount it before you go any further.

Note: For this to work with GPT, the gptfdisk package is needed as the backend for setting the boot flag.

Manual Install

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 -p /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.

Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory—not a /dev/sdXY device. You do not have to install it on the root directory of a file system, e.g., with device /dev/sda1 mounted on /boot. You can install Syslinux in the syslinux directory:

# mkdir /boot/syslinux
# extlinux --install /boot/syslinux

This is assuming the target partition is ext[345]. If it is FAT, the syslinux command must be used instead.

An alternate MBR which Syslinux provides is: altmbr.bin. This MBR does not scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how altmbr.bin can be copied into position:

In this case, a single byte of value 5 is appended to the contents of altmbr.bin and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition (/dev/sda5) of the disk.

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. The background file can be found there too. To make sure that your system can boot with this config, check that it is pointing to the correct partition.

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.

Auto Boot

If you don't want to see the Syslinux menu at all, comment out all UI commands and make sure there is a DEFAULT set in your syslinux.cfg.

Chainloading

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

/boot/syslinux/syslinux.cfg

...
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.

If you are unsure about which drive your BIOS thinks is "first", you can instead use the MBR identifier, or if you are using GPT, the filesystem labels. To use the MBR identifier, run the command

Chainloading other Linux systems

Chainloading another bootloader such as Windows' is pretty obvious, as there is a definite bootloader to chain to. But with Syslinux, it is only able to load files residing on the same partition as the configuration file. Thus, if you have another version of Linux on a separate partition, without a shared /boot, it becomes necessary to employ Extlinux. Essentially, Extlinux can be installed on the partition superblock and be called as a separate bootloader from the MBR installed by Syslinux. Extlinux is part of the Syslinux project and is included with the syslinux package.

The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of /boot/syslinux is being used and the chainloaded / is on /dev/sda3.

From a booted Linux (likely the partition that Syslinux is set up to boot), mount the other root partition to your desired mount point. In this example this will be /mnt. Also, if a separate /boot partition is used on the second operating system, that will also need to be mounted. The example assumes this is /dev/sda2.

Using memtest

HDT

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 /usr/share/hwdata/pci.ids to /boot/syslinux/pci.ids and add the following to your configuration file:

No Default or UI found on some computers

Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a FAT16 partition. To prevent an older machine from loading ldlinux and failing to read syslinux.cfg, use cfdisk to create a FAT16 partition (<=2GB) and format using dosfstools:

# mkfs.msdos -F 16 /dev/sda1

then install and configure Syslinux.

Missing Operating System

If you get this message, check if the partition that contains /boot has the boot flag enabled. If the flag is enabled, then perhaps this partition starts at sector 1 rather than sector 63 or 2048. Check this with fdisk -l. If it starts at sector 1, you can move the partition(s) with gparted from a rescue disk. Or, if you have a separate boot partition, you can back up /boot with

# cp -a /boot /boot.bak

and then boot up with the Arch install disk. Next, use cfdisk to delete the /boot partition, and recreate it. This time it should begin at the proper sector, 63. Now mount your partitions and chroot into your mounted system, as described in the beginners guide. Restore /boot with the command

# cp -a /boot.bak/* /boot

Check if /etc/fstab is correct, run:

# syslinux-install_update -iam

and reboot.

Windows boots up, ignoring 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 MS-DOS fdisk provides.

Menu entries do nothing

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

Cannot remove ldlinux.sys

The ldlinux.sys file has the immutable attribute set, which prevents it 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 it, run:

White block in upper left corner when using vesamenu

Problem:
As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having Syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in Syslinux (the white block is actually an attempt to keep the Syslinux menu, but the driver fails to capture the picture from vesa graphics mode).

If you have a custom resolution and a vesamenu with early modesetting, try to append the following in syslinux.cfg to remove the white block and continue in graphics mode: