https://wiki.archlinux.org/api.php?action=feedcontributions&user=Gohran&feedformat=atomArchWiki - User contributions [en]2024-03-28T18:18:44ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Syslinux&diff=278600Syslinux2013-10-13T17:52:23Z<p>Gohran: </p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[es:Syslinux]]<br />
[[fr:Syslinux]]<br />
[[it:Syslinux]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
[[Wikipedia:SYSLINUX|Syslinux]] is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the [[Wikipedia:File Allocation Table|FAT]], [[Wikipedia:ext2|ext2]], [[Ext3|ext3]], [[Ext4|ext4]], and [[Btrfs]] file systems.<br />
<br />
== Syslinux boot process ==<br />
<br />
# '''Load MBR'''. At boot, the computer loads the [[MBR]] ({{ic|/usr/lib/syslinux/mbr.bin}}). <br />
# '''Search active partition'''. The MBR looks for the partition that is marked as active (boot flag). <br />
# '''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 {{ic|ldlinux.sys}} is hard-coded into the VBR.<br />
# '''Execute ldlinux.sys'''. The VBR will execute ({{ic|ldlinux.sys}}). Therefore, if the location of {{ic|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 {{ic|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.) <br />
# '''Search configuration file'''. Once Syslinux is fully loaded, it looks for a configuration file, either {{ic|extlinux.conf}} or {{ic|syslinux.cfg}}. <br />
# '''Load configuration'''. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a Syslinux prompt.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|syslinux}} from the [[official repositories]]. If your boot partition is FAT, you will also need {{Pkg|mtools}}.<br />
{{Note|<br />
* Since Syslinux 4, Extlinux and Syslinux are the same thing.<br />
* UEFI support was added in the 6.x branch. See [[UEFI_Bootloaders#SYSLINUX]] for more info.<br />
* {{Pkg|gptfdisk}} is required for [[wikipedia:GUID_Partition_Table|GPT]] support using the automated script.<br />
}}<br />
<br />
=== Automatic Install ===<br />
<br />
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 [[Master Boot Record|MBR]] and [[GUID Partition Table|GPT]] disks along with software RAID.<br />
<br />
:1. If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you do not see a {{ic|/boot}} mountpoint, mount it before you go any further.<br />
<br />
:2. 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):<br />
# syslinux-install_update -i -a -m<br />
<br />
:3. Edit {{ic|/boot/syslinux/syslinux.cfg}}.<br />
<br />
<br />
If you have just cloned your disk to say `/mnt/clone`, install syslinux by issuing from the Arch installation medium:<br />
<br />
# syslinux-install_update.sh -i -a -m -c /mnt/clone<br />
<br />
=== Manual install ===<br />
<br />
{{Note|<br />
* 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 {{ic|0xEE}}) using the whole disk which will be displayed with the following command:<br />
# fdisk -l /dev/sda<br />
<br />
: or alternatively:<br />
# sgdisk -p /dev/sda<br />
<br />
: will show "GPT: not present" if it is not a GPT disk.<br />
* If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.<br />
}}<br />
<br />
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 {{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 {{ic|syslinux}} directory:<br />
# mkdir /boot/syslinux<br />
# extlinux --install /boot/syslinux<br />
This is assuming the target partition is ext[234]. If it is FAT, the syslinux command must be used instead.<br />
<br />
==== MBR partition table ====<br />
<br />
{{Box||See the main article: [[Master Boot Record]]|#E5E5FF|#FCFCFC}}<br />
<br />
Next you need to mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|parted/gparted}}. It should look like this:<br />
{{hc|# fdisk -l /dev/sda|<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<br />
An alternate MBR which Syslinux provides is: {{ic|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:<br />
# printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | \<br />
dd bs=440 count=1 iflag=fullblock conv=notrunc of=/dev/sda<br />
<br />
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 {{ic|sda}}. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
==== GUID partition table aka GPT ====<br />
<br />
{{Box||See the main article: [[GUID Partition Table]]|#E5E5FF|#FCFCFC}}<br />
<br />
Bit 2 of the attributes for the {{ic|/boot}} partition needs to be set.<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:<br />
{{hc|<nowiki># sgdisk /dev/sda --attributes=1:show</nowiki>|<br />
1:2:1 (legacy BIOS bootable)<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
If this does not work you can also try:<br />
# syslinux-install_update -i -m<br />
<br />
==== Rebooting ====<br />
<br />
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.<br />
<br />
== Configuration ==<br />
<br />
The Syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed Syslinux. In our case, {{ic|/boot/syslinux/}}.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic|extlinux.conf}}<br />
<br />
{{Tip|<br />
* Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
* {{ic|TIMEOUT}} value is in units of '''1/10''' of a second.<br />
}}<br />
<br />
=== Examples ===<br />
<br />
==== Basic configuration ====<br />
<br />
This is a simple configuration file that will show a {{ic|boot:}} prompt and automatically boot after 5 seconds.<br />
<br />
{{Note|The partition in question needs to be whatever you have as {{ic|/}} (root), not {{ic|/boot}}.}}<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change the {{ic|APPEND}} line to your equivalent {{ic|UUID}} of the root partition:<br />
APPEND root='''UUID='''978e3e81-8048-4ae1-8a06-aa727458e8ff rw<br />
<br />
If you use encryption [[LUKS]] change the {{ic|APPEND}} line to use your encrypted volume:<br />
APPEND root=/dev/mapper/''group''-''name'' cryptdevice=/dev/sda2:''name'' rw<br />
<br />
If you are using software [[Wikipedia:RAID|RAID]] using [http://neil.brown.name/blog/mdadm mdadm], change the {{ic|APPEND}} line to accommodate your RAID arrays. As an example the following accommodates three RAID 1 array's and sets the appropriate one as root:<br />
APPEND root=/dev/md1 rw md=0,/dev/sda2,/dev/sdb2 md=1,/dev/sda3,/dev/sdb3 md=2,/dev/sda4,/dev/sdb4<br />
<br />
If booting from a software raid partition fails using the kernel device node method above an alternative, a more reliable, way is to use partition labels:<br />
APPEND root=LABEL=THEROOTPARTITIONLABEL rw<br />
<br />
==== Text Boot menu ====<br />
<br />
Syslinux also allows you to use a boot menu. To use it, copy the {{ic|menu}} COM32 module to your Syslinux directory:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is in the same partition as {{ic|/usr}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
For more details about the menu system, see [http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt the Syslinux documentation].<br />
<br />
==== Graphical boot menu ====<br />
<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the {{ic|vesamenu}} COM32 module to your Syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is the same partition as {{ic|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[https://projects.archlinux.org/archiso.git/tree/configs/releng/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.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as Syslinux will otherwise refuse to load the menu.<br />
<br />
=== Auto boot ===<br />
<br />
If you do not want to see the Syslinux menu at all, comment out all {{ic|UI}} commands and make sure there is a {{ic|DEFAULT}} set in your {{ic|syslinux.cfg}}.<br />
<br />
=== Chainloading ===<br />
<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the {{ic|chain.c32}} module to the Syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
...<br />
}}<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. <br />
<br />
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<br />
{{hc|# fdisk -l /dev/sdb|<nowiki><br />
Disk /dev/sdb: 128.0 GB, 128035676160 bytes <br />
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xf00f1fd3<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2048 4196351 2097152 7 HPFS/NTFS/exFAT<br />
/dev/sdb2 4196352 250066943 122935296 7 HPFS/NTFS/exFAT</nowiki><br />
}}<br />
<br />
replacing {{ic|/dev/sdb}} with the drive you wish to chainload. Using the hexadecimal number under Disk identifier: {{ic|0xf00f1fd3}} in this case, the syntax in {{ic|syslinux.cfg}} is<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xf00f1fd3<br />
...<br />
}}<br />
<br />
For more details about chainloading, see [http://www.syslinux.org/wiki/index.php/Comboot/chain.c32 the Syslinux wiki].<br />
<br />
If you have [[GRUB]] installed on the same partition, you can chainload it by using: <br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
...</nowiki><br />
}}<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Chainloading other Linux systems ===<br />
<br />
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 {{ic|/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 {{Pkg|syslinux}} package.<br />
<br />
The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of {{ic|/boot/syslinux}} is being used and the chainloaded {{ic|/}} is on {{ic|/dev/sda3}}. <br />
<br />
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 {{ic|/mnt}}. Also, if a separate {{ic|/boot}} partition is used on the second operating system, that will also need to be mounted. The example assumes this is {{ic|/dev/sda2}}.<br />
# mount /dev/sda3 /mnt<br />
# mount /dev/sda2 /mnt/boot (only necessary for separate /boot)<br />
Install Extlinux and copy necessary {{ic|*.c32}} files<br />
# extlinux -i /mnt/boot/syslinux<br />
# cp /usr/lib/syslinux/{chain,menu}.c32 /mnt/boot/syslinux<br />
<br />
Create {{ic|/mnt/boot/syslinux/syslinux.cfg}}. Below is an example:<br />
{{hc|/boot/syslinux/syslinux.cfg '''on /dev/sda3'''|<nowiki><br />
timeout 10<br />
<br />
ui menu.c32<br />
<br />
label Other Linux<br />
linux /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
append root=/dev/sda3 rw quiet<br />
<br />
label MAIN<br />
com32 chain.c32<br />
append hd0 0</nowiki><br />
}}<br />
<br />
taken from [[User:Djgera|Djgera's user wiki page]].<br />
<br />
=== Using memtest ===<br />
<br />
Install {{Pkg|memtest86+}} from the [[official repositories]].<br />
<br />
Use this {{ic|LABEL}} section to launch [[Wikipedia:Memtest86|memtest]]:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
...<br />
}}<br />
<br />
=== HDT ===<br />
<br />
[http://hdt-project.org/ HDT (Hardware Detection Tool)] displays hardware information. Like before, the {{ic|.c32}} file has to be copied or symlinked from {{ic|/boot/syslinux/}}.<br />
For PCI info, either copy or symlink {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}} and add the following to your configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
}}<br />
<br />
=== Reboot and power off ===<br />
<br />
Use the following sections to reboot or power off your machine:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
}}<br />
<br />
=== Clear menu ===<br />
<br />
To clear the screen when exiting the menu, add the following line:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU CLEAR<br />
}}<br />
<br />
=== Keyboard remapping ===<br />
<br />
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.<br />
<br />
First you have to create a compatible keymap (for example a German one):<br />
# cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./<br />
# cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./<br />
# gunzip {de,us}.map.gz<br />
# mv de.{,k}map<br />
# mv us.{,k}map<br />
# keytab-lilo de > de.ktl<br />
<br />
The last command has to be run as root, otherwise it will not work.<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
# chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
KBDMAP de.ktl<br />
}}<br />
<br />
=== Hiding the menu ===<br />
<br />
Use the option:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU HIDDEN<br />
}}<br />
to hide the menu while displaying only the timeout. Press any key to bring up the menu.<br />
<br />
=== Pxelinux===<br />
{{Note|Syslinux at present has no UEFI networking stack, so you'll be unable to use {{AUR|syslinux-efi-git}} (as is possible with [[#GRUB]]) and still expect to be able to tftp your kernel and initramfs; pxelinux still works fine for legacy PXE booting}}<br />
<br />
[[Syslinux|Pxelinux]] is provided by {{Pkg|syslinux}}.<br />
<br />
Copy the pxelinux bootloader (provided by the syslinux package) to the boot directory of the client.<br />
<br />
# cp /usr/lib/syslinux/pxelinux.0 "$root/boot"<br />
# mkdir "$root/boot/pxelinux.cfg"<br />
<br />
We also created the {{ic|pxelinux.cfg}} directory, which is where pxelinux searches for configuration files by default. Because we don't want to discriminate between different host MACs, we then create the {{ic|default}} configuration.<br />
<br />
{{hc|# vim "$root/boot/pxelinux.cfg/default"|<nowiki><br />
default linux<br />
<br />
label linux<br />
kernel vmlinuz-linux<br />
append initrd=initramfs-linux.img quiet ip=:::::eth0:dhcp nfsroot=10.0.0.1:/arch<br />
</nowiki>}}<br />
<br />
Or if you are using NBD, use the following append line:<br />
<br />
{{bc|<nowiki>append ro initrd=initramfs-linux.img ip=:::::eth0:dhcp nbd_host=10.0.0.1 nbd_name=arch root=/dev/nbd0</nowiki>}}<br />
<br />
{{Note|You will need to change {{ic|nbd_host}} and/or {{ic|nfsroot}}, respectively, to match your network configuration (the address of the NFS/NBD server)}}<br />
<br />
The pxelinux configuration syntax identical to syslinux; refer to the upstream documentation for more information.<br />
<br />
The kernel and initramfs will be transferred via TFTP, so the paths to those are going to be relative to the TFTP root. Otherwise, the root filesystem is going to be the NFS mount itself, so those are relative to the root of the NFS server.<br />
<br />
To actually load pxelinux, replace {{ic|filename "/grub/i386-pc/core.0";}} in {{ic|/etc/dhcpd.conf}} with {{ic|filename "/pxelinux.0"}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Using the Syslinux prompt===<br />
<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configurations, just type:<br />
boot: arch<br />
<br />
If you get an error that the configuration file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 rw initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in [[Ramdisk|ramfs]], and therefore temporarily unable to boot kernel again,<br />
:1. Create a temporary directory, in order to mount your root partition (if it does not exist already):<br />
# mkdir -p /new_root<br />
:2. Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|Busybox cannot mount {{ic|/boot}} if it is on its own ext2 partition.}}<br />
# mount /dev/sd[a-z][1-9] /new_root<br />
<br />
:3. Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
:4. Reboot.<br />
<br />
=== Fsck fails on root partition ===<br />
<br />
In the case of a badly corrupted root partition (in which the journal is damaged), in the ramfs emergency shell, mount the root file system:<br />
<br />
# mount /dev/''root partition'' /new_root<br />
And grab the tune2fs binary from the root partition (it is not included in Syslinux):<br />
# cp /new_root/sbin/tune2fs /sbin/<br />
<br />
Follow the instructions at [[Fsck#ext2fs_:_no_external_journal|ext2fs: no external journal]] to create a new journal for the root partition.<br />
<br />
=== No Default or UI found on some computers ===<br />
<br />
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 {{ic|ldlinux}} and failing to read {{ic|syslinux.cfg}}, use {{ic|cfdisk}} to create a FAT16 partition (<=2GB) and format using {{Pkg|dosfstools}}:<br />
# mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure Syslinux.<br />
<br />
=== Missing operating system ===<br />
<br />
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 {{ic|fdisk -l}}. If it starts at sector 1, you can move the partition(s) with {{ic|gparted}} from a rescue disk. Or, if you have a separate boot partition, you can back up {{ic|/boot}} with <br />
# cp -a /boot /boot.bak<br />
and then boot up with the Arch install disk. Next, use {{ic|cfdisk}} to delete the {{ic|/boot}} partition, and recreate it. This time it should begin at the proper sector, '''63'''. Now mount your partitions and {{ic|chroot}} into your mounted system, as described in the beginners guide. Restore {{ic|/boot}} with the command<br />
# cp -a /boot.bak/* /boot<br />
Check if {{ic|/etc/fstab}} is correct, run:<br />
# syslinux-install_update -iam<br />
and reboot.<br />
<br />
You will also get this error if you are trying to boot from a md [[RAID]] 1 array and created the array with a too new version of the metadata that Syslinux doesn't understand. As of August 2013 by default mdadm will create an array with version 1.2 metadata, but Syslinux doesn't understand metadata newer than 1.0. If this is the case you'll need to recreate your [[RAID]] array using the {{ic|1=--metadata=1.0}} flag to mdadm.<br />
<br />
=== Windows boots up, ignoring Syslinux ===<br />
<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
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 {{ic|fdisk}} provides.<br />
<br />
=== Menu entries do nothing ===<br />
<br />
You select a menu entry and it does nothing, it just ''"refreshes"'' the menu. This usually means that you have an error in your {{ic|syslinux.cfg}} file. Hit {{ic|Tab}} to edit your boot parameters. Alternatively, press {{ic|Esc}} and type in the {{ic|LABEL}} of your boot entry (e.g. ''arch'').<br />
<br />
=== Cannot remove ldlinux.sys ===<br />
<br />
The {{ic|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:<br />
# chattr -i /boot/syslinux/ldlinux.sys<br />
# rm /boot/syslinux/ldlinux.sys<br />
<br />
=== White block in upper left corner when using vesamenu ===<br />
<br />
Problem:<br />
''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).''<br />
<br />
If you have a custom resolution and a {{ic|vesamenu}} with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
APPEND root=/dev/sda6 rw 5 '''vga=current''' quiet splash<br />
<br />
=== Chainloading Windows doesn't work, when it is installed on another drive ===<br />
<br />
If Windows is installed on a different drive than Arch and you have trouble chainloading it, try the following configuration:<br />
<br />
LABEL Windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xdfc1ba9e swap<br />
<br />
replace the mbr code with the one your windows drive has (details [[Syslinux#Chainloading|above]]), and append {{ic|swap}} to the options.<br />
<br />
== See also ==<br />
<br />
* [http://www.syslinux.org Official website]<br />
* [http://www.josephn.net/scrapbook/pxelinux_stuff PXELinux configuration]</div>Gohran