Difference between revisions of "Syslinux"

From ArchWiki
Jump to: navigation, search
m (Automatic Install: Clarification: "script" is not part of the command)
(various improvements. Also, "syslinux-install_update" is already in $PATH. Seriously, run "echo $PATH". I don't know what bonehead decided to go with the full path)
Line 25: Line 25:
 
==Installation==
 
==Installation==
 
===Automatic Install ===
 
===Automatic Install ===
The syslinux-install_update script will install Syslinux, copy COM32 modules to {{ic|/boot/syslinux}}, set the boot flag, and install the MBR. It can handle MBR and GPT disks along with softraid.
+
The {{ic|syslinux-install_update}} script will install Syslinux, copy/symlink {{ic|*.c32}} modules to {{ic|/boot/syslinux}}, set the boot flag and install the boot code in the MBR. It can handle MBR and GPT disks along with softraid.
 
   
 
   
1. Install {{Pkg|syslinux}}:
+
1. Install the {{Pkg|syslinux}} package:
  pacman -S syslinux
+
  # pacman -S syslinux
2. Make sure {{ic|/boot}} is mounted<br/>
+
2. If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you don't see a {{ic|/boot}} mountpoint, mount it before you go any further.<br/>
3. Run {{ic|syslinux-install_update}} with flags {{ic|-i}} (install) {{ic|-a}} (set boot flag) {{ic|-m}} (install mbr)
+
3. Run {{ic|syslinux-install_update}} with flags: {{ic|-i}} (install the files), {{ic|-a}} (mark the partition ''active'' with the ''boot'' flag), {{ic|-m}} (install the ''MBR'' boot code):
  /usr/sbin/syslinux-install_update -iam
+
  # syslinux-install_update -iam
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}
+
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}.
  
 
===Manual Install ===
 
===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:
 
{{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
+
  # fdisk -l /dev/sda
  
 
or alternatively:
 
or alternatively:
  sgdisk -l /dev/sda
+
  # sgdisk -l /dev/sda
  
 
will show "GPT: not present" if it is not a GPT disk.
 
will show "GPT: not present" if it is not a GPT disk.
Line 48: Line 48:
 
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.
 
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.
 
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:
 
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:
  mkdir /boot/syslinux
+
  # mkdir /boot/syslinux
  extlinux --install /boot/syslinux  
+
  # extlinux --install /boot/syslinux  
  
 
====MBR Partition Table====
 
====MBR Partition Table====
 
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|(g)parted}}. It should look like this:
 
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|(g)parted}}. It should look like this:
fdisk -l /dev/sda
+
{{hc|# fdisk -l /dev/sda|
[...]
+
[...]
  Device Boot      Start        End      Blocks  Id  System
+
  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *        2048      104447      51200  83  Linux
+
/dev/sda1  *        2048      104447      51200  83  Linux
/dev/sda2          104448  625142447  312519000  83  Linux
+
/dev/sda2          104448  625142447  312519000  83  Linux
 +
}}
 +
 
 +
Install the MBR:
  
Install the master boot record:
+
  # dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda
  dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda
+
<!-- conv=notrunc helps if {{ic|/dev/sda}} is actually a file not a block device -->
+
  
 
{{Note|1=An alternate MBR doesn't work properly in '''Syslinux 4.05''' - it always invokes first partition. This bug was fixed in this commit: https://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=794ff174175734a0974e1846f0db29040b096e45.}}
 
{{Note|1=An alternate MBR doesn't work properly in '''Syslinux 4.05''' - it always invokes first partition. This bug was fixed in this commit: https://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=794ff174175734a0974e1846f0db29040b096e45.}}
Line 67: Line 68:
 
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 {{ic|altmbr.bin}} can be copied into position:
 
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 {{ic|altmbr.bin}} can be copied into position:
  
  printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 iflag=fullblock conv=notrunc of=/dev/sda
+
  # printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 iflag=fullblock conv=notrunc of=/dev/sda
  
 
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.
 
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.
Line 74: Line 75:
 
Main article [[GUID Partition Table]].
 
Main article [[GUID Partition Table]].
  
Bit 2 of the attributes for the {{ic|/boot}} partition need to be set.
+
Bit 2 of the attributes for the {{ic|/boot}} partition needs to be set.
  
  sgdisk /dev/sda --attributes=1:set:2
+
  # sgdisk /dev/sda --attributes=1:set:2
  
This would toggle the attribute legacy BIOS bootable on partition 1.
+
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:
  
Verify:
+
  # sgdisk /dev/sda --attributes=1:show
  sgdisk /dev/sda --attributes=1:show
+
 
  1:2:1 (legacy BIOS bootable)
 
  1:2:1 (legacy BIOS bootable)
  
Install the master boot record:
+
Install the MBR:
  dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda
+
  # dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda
  
 
====Rebooting====
 
====Rebooting====
Line 227: Line 227:
 
{{ic|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 [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].
 
{{ic|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 [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].
  
If you have [[grub2]] installed in your boot partition, you can chainload it by using:  
+
If you have [[GRUB]] installed on the same partition, you can chainload it by using:  
  
 
  LABEL grub2
 
  LABEL grub2
Line 270: Line 270:
  
 
First you have to create a compatible keymap (for example a german one):
 
First you have to create a compatible keymap (for example a german one):
  cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./
+
  # cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./
  cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./
+
  # cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./
  gunzip {de,us}.map.gz
+
  # gunzip {de,us}.map.gz
  mv de.{,k}map
+
  # mv de.{,k}map
  mv us.{,k}map
+
  # mv us.{,k}map
  keytab-lilo de > de.ktl
+
  # keytab-lilo de > de.ktl
  
 
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:
 
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:
  chown root:root /boot/syslinux/de.ktl
+
  # chown root:root /boot/syslinux/de.ktl
  
 
Now edit {{ic|syslinux.conf}} and add
 
Now edit {{ic|syslinux.conf}} and add
Line 295: Line 295:
 
1) Create temp directory, in order to mount your root partition (if it does not exist already):
 
1) Create temp directory, in order to mount your root partition (if it does not exist already):
  
   mkdir -p /new_root
+
   # mkdir -p /new_root
  
 
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):
 
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):
 
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}
 
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}
 
   
 
   
   mount /dev/sd[a-z][1-9] /new_root
+
   # mount /dev/sd[a-z][1-9] /new_root
  
 
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.
 
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.
Line 308: Line 308:
 
===No Default or UI found on some computers===
 
===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 {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with  
 
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 {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with  
  pacman -S dosfstools
+
  # pacman -S dosfstools
  mkfs.msdos -F 16 /dev/sda1
+
  # mkfs.msdos -F 16 /dev/sda1
  
 
then install and configure syslinux.
 
then install and configure syslinux.
Line 316: Line 316:
  
 
If you get this message, check if the partition that contains {{ic|/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  
 
If you get this message, check if the partition that contains {{ic|/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
+
  # 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
 
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
+
  # cp -a /boot.bak/* /boot
 
Check if /etc/fstab is correct.  Then run
 
Check if /etc/fstab is correct.  Then run
  /usr/sbin/syslinux-install_update -iam
+
  # syslinux-install_update -iam
 
and reboot.
 
and reboot.
  

Revision as of 08:16, 15 August 2012

Summary help replacing me
Describes installing and configuring Syslinux, a collection of bootloaders.
Overview
Template:Boot process overview

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.
Note: Syslinux does not support UEFI as of May 2012. According to upstream, UEFI support will be eventually added to Syslinux, but there is no time-frame as to when it will be functional.

Syslinux Boot Process

  1. Load MBR. At boot, the computer loads the MBR (/usr/lib/syslinux/mbr.bin).
  2. Search active partition. The MBR looks for the partition that is marked as active (boot flag).
  3. 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.
  4. 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.)
  5. Search configuration file. Once Syslinux is fully loaded, it looks for a configuration file, either extlinux.conf or syslinux.cfg.
  6. 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 softraid.

1. Install the syslinux package:

# pacman -S syslinux

2. 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.
3. Run syslinux-install_update with flags: -i (install the files), -a (mark the partition active with the boot flag), -m (install the MBR boot code):

# syslinux-install_update -iam

4. Edit /boot/syslinux/syslinux.cfg.

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

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 MBR:

# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda
Note: An alternate MBR doesn't work properly in Syslinux 4.05 - it always invokes first partition. This bug was fixed in this commit: https://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=794ff174175734a0974e1846f0db29040b096e45.

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:

# printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 iflag=fullblock conv=notrunc of=/dev/sda

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.

GUID Partition Table aka GPT

Main article GUID Partition Table.

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

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

This would toggle the attribute legacy BIOS bootable on partition 1. To check:

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

Install the MBR:

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

Rebooting

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.

Configuration

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

The bootloader will look for either syslinux.cfg (preferred) or extlinux.conf

Tips:

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

Examples

Basic Config

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

Note: the partition in question needs to be whatever you have as / (root), not /boot.

Config:

PROMPT 1
TIMEOUT 50
DEFAULT arch

LABEL arch
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux.img

LABEL archfallback
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux-fallback.img

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

If you want to use UUID for persistent device naming instead of device names, change:

APPEND root=/dev/sda2 ro

to:

APPEND root=UUID=<uuid here> ro

Text Boot menu

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

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

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

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

Config:

UI menu.c32
PROMPT 0

MENU TITLE Boot Menu
TIMEOUT 50
DEFAULT arch

LABEL arch
        MENU LABEL Arch Linux
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux.img

LABEL archfallback
        MENU LABEL Arch Linux Fallback
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux-fallback.img

For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;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. The background file can be found there too.

Config:

UI vesamenu.c32
DEFAULT arch
PROMPT 0
MENU TITLE Boot Menu
MENU BACKGROUND splash.png
TIMEOUT 50

MENU WIDTH 78
MENU MARGIN 4
MENU ROWS 5
MENU VSHIFT 10
MENU TIMEOUTROW 13
MENU TABMSGROW 11
MENU CMDLINEROW 11
MENU HELPMSGROW 16
MENU HELPMSGENDROW 29

# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32

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 ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux.img


LABEL archfallback
        MENU LABEL Arch Linux Fallback
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux-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.

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:

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 GRUB installed on the same partition, you can chainload it by using:

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

This may be 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

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

LABEL hdt
        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
        COMBOOT poweroff.com

Clear Menu

To clear the screen when exiting the menu, add the following line:

MENU CLEAR

Keyboard remapping

If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.

First you have to create a compatible keymap (for example a german one):

# cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./
# cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./
# gunzip {de,us}.map.gz
# mv de.{,k}map
# mv us.{,k}map
# keytab-lilo de > de.ktl

Copy de.ktl as root to /boot/syslinux/ and set ownership to root:

# chown root:root /boot/syslinux/de.ktl

Now edit syslinux.conf and add

KBDMAP de.ktl

Troubleshooting

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, e.g.:

boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img

If you do not have access to boot: in ramfs, and therefore temporarily unable to boot kernel again,

1) Create temp directory, in order to mount your root partition (if it does not exist already):

 # mkdir -p /new_root

2) Mount / under /new_root (in case /boot/ is on the same partition, otherwise you will need to mount them both):

Note: If /boot is on its own ext2 partition then busybox cannot mount it.
 # mount /dev/sd[a-z][1-9] /new_root

3) Use vim and edit syslinux.cfg again to suit your needs and save file.

4) Reboot.

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 with

# pacman -S 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. Then run

# syslinux-install_update -iam

and reboot.

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

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

A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu

Brain0 said: 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:

APPEND root=/dev/sda6 ro 5 vga=current quiet splash

See also