GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing wiki.archlinux.org — Syslinux - ArchWiki Related articles Syslinux is a collection of boot loaders capable of booting from drives, CDs, and over the network via PXE. Supported file systemsSome of the supported file systems are FAT, NTFS, ext2, ext3, ext4, XFS, UFS/FFS, and uncompressed single-device Btrfs. Warning
Note Syslinux, by itself, cannot access files from partitions other than its own. See #Chainloading on how to work around this.
InstallationBIOS booting will also require the gptfdisk package for BIOS/GPT setups and mtools if your UEFI booting requires installing the efibootmgr package. Installing the Syslinux boot loaderInstalling the package is not the same as installing the boot loader. After installing the relevant package(s), the boot loader code itself needs to be installed (to the adequate area, usually the VBR or ESP) so to be able to boot the system; the following sections provide alternative instructions depending on the characteristics of your particular system. BIOS systemsSyslinux boot process on BIOS happens in stages:
AutomaticallyNote The
syslinux-install_update script is Arch specific, and is not provided/supported by Syslinux upstream. Please direct any bug reports specific to the script to the Arch issue tracker and not upstream.After executing the Warning The
syslinux-install_update script sets a default root partition that possibly will not match your particular system. It is important to point Syslinux to the correct root partition by editing /boot/syslinux/syslinux.cfg, or the OS will fail to boot. See #Kernel parameters.The If you use a separate boot partition, make sure that it is mounted. Check with
Run # syslinux-install_update -i -a -m If this command fails with Syslinux BIOS install failed, the problem is likely that the # extlinux --install /boot/syslinux/ extlinux: cannot find device for path /boot/syslinux extlinux: cannot open device (null) This can happen, for example, when upgrading from LILO which, while booting a current custom kernel, turned a kernel command line parameter of say Note
# syslinux-install_update -i -a -m -c /mnt Now is the time to edit ManuallyNote 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 do not have to install it on the root directory of a file system, e.g., with device # mkdir /boot/syslinux Copy all # cp /usr/lib/syslinux/bios/*.c32 /boot/syslinux/ Now install the boot loader. For FAT, ext2/3/4, or btrfs boot partition use extlinux, where the device has been mounted: # extlinux --install /boot/syslinux Alternatively, for a FAT boot partition use syslinux, where the device is unmounted: # syslinux --directory syslinux --install /dev/sda1 After this, proceed to install the Syslinux bootstrap code appropriate for the partition table:
as described in the next sections. See Master Boot Record for further general information. Tip If you are unsure of which partition table you are using (MBR or GPT), you can check using:
# blkid -s PTTYPE -o value /dev/sda Note For a partitionless install, there is no need to install the Syslinux boot code to the MBR. You could skip below and jump to #Configuration. See [1].
MBR partition tableFor an MBR partition table, ensure your boot partition is marked as "active" in your partition table (the "boot" flag is set). Applications capable of doing this include fdisk and 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/bios/mbr.bin of=/dev/sda An alternative MBR which Syslinux provides is: # printf '\x5' | cat /usr/lib/syslinux/bios/altmbr.bin - | dd bs=440 count=1 conv=notrunc iflag=fullblock of=/dev/sda In this case, a single byte of value 5 (hexadecimal) is appended to the contents of GUID partition tableFor a GPT, ensure that attribute bit 2 "Legacy BIOS bootable" is set for the # sgdisk /dev/sda --attributes=1:set:2 This will set the attribute "legacy BIOS bootable" on partition 1 of # sgdisk /dev/sda --attributes=1:show 1:2:1 (legacy BIOS bootable) Install the MBR: # dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/sda UEFI systemsNote
Limitations of UEFI Syslinux
DeploymentNote In the commands related to UEFI,
esp denotes the mountpoint of the EFI system partition aka ESP.Setup Syslinux in the EFI system partition as follows. Copy Syslinux files to the ESP: # mkdir -p esp/EFI/syslinux # cp -r /usr/lib/syslinux/efi64/* esp/EFI/syslinux Create a UEFI boot entry for Syslinux using efibootmgr: # efibootmgr --create --disk /dev/sdX --part Y --loader /EFI/syslinux/syslinux.efi --label "Syslinux" --unicode where Create or edit Note
ConfigurationThe Syslinux configuration file, The boot loader will look for either Tip
ExamplesNote
Boot promptThis is a simple configuration file that will show a Configuration: * BIOS: /boot/syslinux/syslinux.cfg * UEFI: esp/EFI/syslinux/syslinux.cfg PROMPT 1 TIMEOUT 50 DEFAULT arch LABEL arch LINUX ../vmlinuz-linux APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw INITRD ../initramfs-linux.img LABEL archfallback LINUX ../vmlinuz-linux APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw INITRD ../initramfs-linux-fallback.img Text boot menuSyslinux also allows you to use a boot menu. To use it, copy the # cp /usr/lib/syslinux/bios/{menu,libutil}.c32 /boot/syslinux/
Additional Configuration: * BIOS: /boot/syslinux/syslinux.cfg * UEFI: esp/EFI/syslinux/syslinux.cfg UI menu.c32 PROMPT 0 MENU TITLE Boot Menu TIMEOUT 50 DEFAULT arch LABEL arch MENU LABEL Arch Linux LINUX ../vmlinuz-linux APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw INITRD ../initramfs-linux.img LABEL archfallback MENU LABEL Arch Linux Fallback LINUX ../vmlinuz-linux APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw INITRD ../initramfs-linux-fallback.img For more details about the menu system, see the Syslinux wiki. Graphical boot menuSyslinux also allows you to use a graphical boot menu. To use it, copy the # cp /usr/lib/syslinux/bios/vesamenu.c32 /boot/syslinux/ Since version 5.00, additional Note If you are using UEFI, make sure to copy from
/usr/lib/syslinux/efi64/ (or efi32 for IA32 (32-bit) EFI systems), otherwise you will be presented with a black screen. In that case, boot from a live medium and use chroot to make the appropriate changes.This configuration uses the same menu design as the Arch Install CD, its configuration can be found at gitlab.archlinux.org. The Arch Linux background image can be downloaded from there, too. Copy the image to Configuration: * BIOS: /boot/syslinux/syslinux.cfg * UEFI: esp/EFI/syslinux/syslinux.cfg 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 https://wiki.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=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw INITRD ../initramfs-linux.img LABEL archfallback MENU LABEL Arch Linux Fallback LINUX ../vmlinuz-linux APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw INITRD ../initramfs-linux-fallback.img
To center the menu and adjust resolution, use To move the menu to the center, add or edit these values: * BIOS: /boot/syslinux/syslinux.cfg * UEFI: esp/EFI/syslinux/syslinux.cfg MENU RESOLUTION 800 600 # or whatever your screen resolution is MENU WIDTH 78 # width of the menu also required to bring the menu box to size MENU VSHIFT 10 # moves menu down MENU HSHIFT 10 # moves menu right VESA standards are commonly a maximum of 25 rows and 80 columns, so going higher than those values might move the menu off the screen, potentially requiring editing from a rescue CD. Kernel parametersThe kernel parameters are set by using the It is recommended to make the following changes for the "fallback" entry as well. In the simplest case, the value of the APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw Change If you use dm-crypt encryption change the APPEND root=/dev/mapper/name cryptdevice=UUID=YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY:name rw If booting a btrfs subvolume, amend the APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw rootflags=subvol=ROOT A failure to do so will otherwise result in the following error message: Auto bootIf you do not want to see the Syslinux menu at all, use the #Boot prompt, and set SecuritySyslinux has two levels of boot loader security: a menu master password, and a per-menu-item password. Use syslinux.cfg MENU MASTER PASSWD password to set a master boot loader password, and syslinux.cfg MENU PASSWD password within a The passwd can be either a cleartext password or hashed: see official documentation. ChainloadingSyslinux BIOS cannot directly chainload files located on other partitions; however, Chainloading a partition's VBRIf you want to chainload other operating systems (such as Windows) or boot loaders, copy the /boot/syslinux/syslinux.cfg LABEL windows MENU LABEL Windows COM32 chain.c32 APPEND hd0 3
Note For Windows, this skips the system's own boot manager (
bootmgr), which is required for a few important updates (eg.) to complete. In such cases it may be advisable to temporarily set the MBR boot flag to the Windows partition (eg. with GParted), let the update finish installing, and then reset the flag to the Syslinux partition (eg. with Windows's own DiskPart).Chainloading a disk's MBRIf 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 # sfdisk --disk-id /dev/sdb 0xf00f1fd3 replacing /boot/syslinux/syslinux.cfg LABEL windows MENU LABEL Windows COM32 chain.c32 APPEND mbr:0xf00f1fd3 For more details about chainloading, see the Syslinux wiki. Chainloading other boot loadersIf you have GRUB installed on the same partition, you can chainload it by using: /boot/syslinux/syslinux.cfg LABEL grub2 MENU LABEL Grub2 COM32 chain.c32 APPEND file=../grub/boot.img Alternatively, it is also possible to load GRUB as a linux kernel by prepending /boot/syslinux/syslinux.cfg LABEL grub2lnx MENU LABEL Grub2 (lnxboot) LINUX ../grub/i386-pc/lnxboot.img INITRD ../grub/i386-pc/core.img This may be required for booting from ISO images. Chainloading other Linux systemsChainloading another boot loader such as Windows' is pretty obvious, as there is a definite boot loader 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 The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of From a booted Linux (likely the partition that Syslinux is set up to boot), mount the other system's root partition to your desired mount point. In this example this will be # mount /dev/sda3 /mnt # mount /dev/sda2 /mnt/boot (only necessary for separate /boot) Install EXTLINUX to the partition VBR, and copy necessary # extlinux -i /mnt/boot/syslinux/ (first create the directory if necessary) # cp /usr/lib/syslinux/bios/*.c32 /mnt/boot/syslinux Create /mnt/boot/syslinux/syslinux.cfg on /dev/sda3 TIMEOUT 10 UI menu.c32 LABEL OtherLinux LINUX /boot/vmlinuz-linux INITRD /boot/initramfs-linux.img APPEND root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw quiet LABEL MAIN COM32 chain.c32 APPEND hd0 0 And then add an entry to your main syslinux.cfg /boot/syslinux/syslinux.cfg LABEL OtherLinux COM32 chain.c32 APPEND hd0 3 Note that the other Linux entry in Using memtestInstall memtest86+. Use this /boot/syslinux/syslinux.cfg LABEL memtest MENU LABEL Memtest86+ LINUX ../memtest86+/memtest.bin Note If you are using PXELINUX, change the name from
memtest.bin to memtest since PXELINUX treats the file with .bin extension as a boot sector and loads only 2KB of it.HDTHDT (Hardware Detection Tool) displays hardware information. Like before, the /boot/syslinux/syslinux.cfg LABEL hdt MENU LABEL Hardware Info COM32 hdt.c32 Reboot and power offNote As of Syslinux 6.03,
poweroff.c32 only works with APM and not with ACPI. For a possible solution, see acpioff: COM32 module to shut off machine using ACPI.Use the following sections to reboot or power off your machine: /boot/syslinux/syslinux.cfg LABEL reboot MENU LABEL Reboot COM32 reboot.c32 LABEL poweroff MENU LABEL Power Off COM32 poweroff.c32 Clear menuTo clear the screen when exiting the menu, add the following line: /boot/syslinux/syslinux.cfg MENU CLEAR Keyboard layoutIf you often have to edit your boot command with diverse parameters in the Syslinux boot prompt, then you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard. Note
keytab-lilo, which is included in the syslinux package, is a perl script invoking the loadkeys program.To create a compatible keymap (e.g. a german one) run: # keytab-lilo /usr/share/kbd/keymaps/i386/qwerty/us.map.gz /usr/share/kbd/keymaps/i386/qwertz/de.map.gz > /boot/syslinux/de.ktl Now edit /boot/syslinux/syslinux.cfg KBDMAP de.ktl See the Syslinux wiki for more details. Hiding the menuUse the option: /boot/syslinux/syslinux.cfg MENU HIDDEN to hide the menu while displaying only the timeout. Press any key to bring up the menu. PXELINUXNote For UEFI, Syslinux uses the same binary for disk booting and network booting. Loading files from TFTP or other network protocols will require network booting Syslinux.
PXELINUX is provided by the syslinux package. For BIOS clients, copy the # cp /usr/lib/syslinux/bios/lpxelinux.0 "TFTP_root/boot/" # cp /usr/lib/syslinux/bios/ldlinux.c32 "TFTP_root/boot/" # mkdir "TFTP_root/boot/pxelinux.cfg" We also created the TFTP_root/boot/pxelinux.cfg/default DEFAULT linux LABEL linux KERNEL vmlinuz-linux APPEND initrd=initramfs-linux.img quiet ip=:::::eth0:dhcp nfsroot=10.0.0.1:/arch Or if you are using NBD, use the following append line: APPEND ro initrd=initramfs-linux.img ip=:::::eth0:dhcp nbd_host=10.0.0.1 nbd_port=10809 nbd_name=arch root=/dev/nbd0 Note You will need to change
nbd_host and/or nfsroot, respectively, to match your network configuration (the address of the NFS/NBD server)PXELINUX uses the same configuration syntax as SYSLINUX; refer to the upstream documentation for more information. 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. To actually load PXELINUX, replace Booting ISO9660 image files with memdiskSyslinux supports booting from ISO images directly using the memdisk module, see Multiboot USB drive#Using Syslinux and memdisk for examples. Serial consoleSee Working with the serial console#Syslinux. Boot another OS onceIt is possible to temporarily change the default Syslinux action and boot another label only during the next boot. The following command shows how to boot the # extlinux -o archfallback /boot/syslinux During the next boot, the specified label will be booted without any Syslinux prompt showing up. The default Syslinux boot behaviour will be restored on the next reboot. TroubleshootingFailed to load ldlinuxAn error message such as "Failed to load ldlinux.c32" during the initial boot can be triggered by many diverse reasons. One potential reason could be a change in file system tools or in a file system structure, depending on its own version. Warning As of Syslinux 6.03, some of the features of the supported file systems are not supported by the boot loader. See [10] for more information.
Note There is no direct and unique correspondence between a message such as
Failed to load ldlinux.c32 and a problem related to the file system:
See also [11] (the whole page might be relevant for troubleshooting too). Using the Syslinux promptYou can type in the boot: arch If you get an error that the configuration file could not be loaded, you can pass your needed boot parameters, e.g.: boot: ../vmlinuz-linux root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw initrd=../initramfs-linux.img If you do not have access to
fsck fails on root partitionIn the case of a badly corrupted root partition (in which the journal is damaged), in the ramfs emergency shell, mount the root file system: # mount /dev/root partition /sysroot And grab the tune2fs binary from the root partition (it is not included in Syslinux): # cp /sysroot/usr/bin/tune2fs /usr/bin/ Follow the instructions at ext2fs: no external journal to create a new journal for the root partition. No Default or UI found on some computersCertain 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 initramfs are not on a FAT16 partition. To prevent an older machine from loading # mkfs.fat -F 16 /dev/sda1 then install and configure Syslinux. Missing operating system
# cp -a /boot /boot.bak and then boot up with the Arch install disk. Next, use # cp -a /boot.bak/ /boot/ Check if # syslinux-install_update -iam and reboot. You will also get this error if you are trying to boot from an md RAID 1 array and created the array with a too new version of the metadata that Syslinux does not understand. As of August 2013 by default mdadm will create an array with version 1.2 metadata, but Syslinux does not understand metadata newer than 1.0. If this is the case you will need to recreate your RAID array using the Windows boots up, ignoring SyslinuxSolution: Make sure the partition that contains 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 Menu entries do nothingYou select a menu entry and it does nothing, it just "refreshes" the menu. This usually means that you have an error in your Cannot remove ldlinux.sysThe # chattr -i /boot/syslinux/ldlinux.sys # rm /boot/syslinux/ldlinux.sys White block in upper left corner when using vesamenuProblem: 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 APPEND root=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw 5 vga=current quiet splash Chainloading Windows does not work, when it is installed on another driveIf Windows is installed on a different drive than Arch and you have trouble chainloading it, try the following configuration: LABEL Windows MENU LABEL Windows COM32 chain.c32 APPEND mbr:0xdfc1ba9e swap Replace the mbr code with the one your Windows drive has (details above), and append Read boot loader logIn some cases (e.g. boot loader unable to boot kernel) it is highly desirable to get more information from the boot process. Syslinux prints error messages to screen but the boot menu quickly overwrites the text. To avoid losing the log information, disable
To get more detailed debug log, recompile the syslinux package with additional CFLAGS: -DDEBUG_STDIO=1 -DCORE_DEBUG=1 Btrfs compressionBooting from btrfs with compression is not supported.[12] This error will show: btrfs: found compressed data, cannot continue! invalid or corrupt kernel image. Btrfs multi-deviceBooting from multiple-device btrfs is not supported.[13] (As of 21-Jul-2016 line 1246 in validate_device_btrfs() in main.c) This head-scratching error will show (assuming you are installing on sda1): /boot/syslinux is device /dev/sda1 extlinux: path /boot/syslinux doesn't match device /dev/sda1 See alsoRetrieved from "https://wiki.archlinux.org/index.php?title=Syslinux&oldid=887573" |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |