syslinux
Create bootable Linux systems on FAT filesystems
SYNOPSIS
syslinux [options] device
PARAMETERS
-i
Install SYSLINUX boot sector. Installs the SYSLINUX boot sector on a FAT filesystem. This is the most common use of the command to make a partition bootable.
-U
Uninstall SYSLINUX boot sector. Removes the SYSLINUX boot sector from a FAT filesystem, effectively making it non-bootable by SYSLINUX.
-f
Force operation. Forces the installation even if the filesystem type is not recognized or the device appears to be in use. Use with extreme caution as it can lead to data loss.
-s
Safe mode (deprecated for -i). Installs the boot sector without touching the Master Boot Record (MBR). This option is largely superseded by -i.
-d directory
Specify boot directory. Specifies the directory on the target device where the ldlinux.sys file is expected to be found.
-v
Verbose output. Provides more detailed information and progress messages during the installation process.
-q
Quiet output. Suppresses most output during the installation process, useful for scripting.
-a
Set active partition (MBR). Marks the target partition as active in the Master Boot Record, a prerequisite for booting on some legacy systems.
-m
Install MBR (Master Boot Record). Installs a generic MBR that chains to the SYSLINUX boot sector on the specified partition. Often used in conjunction with -i.
-e
Install on Ext2/3/4 filesystem. Installs the SYSLINUX (specifically EXTLINUX) boot sector on an Ext2, Ext3, or Ext4 filesystem, suitable for Linux installations.
DESCRIPTION
The syslinux command is a crucial utility within the SYSLINUX bootloader suite, primarily used to install the SYSLINUX boot sector onto a specified device, typically a floppy disk, USB drive, or a hard disk partition. SYSLINUX itself is a collection of lightweight bootloaders designed for various media, including FAT filesystems (like those found on USB sticks), Ext2/3/4 filesystems, CD/DVDs (ISOLINUX), and network booting (PXELINUX).
When invoked, syslinux writes the necessary boot code to the target device's boot sector, making it bootable. It prepares the partition to load the core SYSLINUX file, ldlinux.sys, which must also be present on the filesystem. This command does not typically copy the ldlinux.sys file itself or the configuration file (syslinux.cfg); these usually need to be copied manually or by another script after the boot sector installation. It is widely used for creating bootable live Linux distributions, rescue disks, and for scenarios requiring a simple and robust legacy BIOS bootloader.
CAVEATS
Incorrect usage of syslinux can lead to severe data loss or an unbootable system. Always double-check the target device path before execution. This command primarily targets legacy BIOS booting environments; for UEFI systems, other bootloaders like GRUB2 or SYSLINUX's EFI components (installed differently) are generally preferred. Ensure the target filesystem is correctly formatted (e.g., FAT for traditional SYSLINUX, Ext for EXTLINUX) and accessible before attempting installation.
COMMON USAGE PATTERN
To make a USB drive partition bootable with SYSLINUX, a common sequence involves first formatting the partition (e.g., mkfs.fat /dev/sdb1), then running syslinux /dev/sdb1 (or syslinux -i /dev/sdb1). After this, the ldlinux.sys file and a configuration file (typically syslinux.cfg) must be manually copied to the root of the formatted partition for SYSLINUX to function correctly.
CONFIGURATION FILE
SYSLINUX's behavior is dictated by a plain-text configuration file, most commonly named syslinux.cfg (or extlinux.conf for Ext filesystems). This file, located in the boot medium's root directory or a specified subdirectory, defines boot menu entries, default kernel and initramfs paths, boot parameters, and timeout settings. Without this file, SYSLINUX will not know what to boot.
HISTORY
The SYSLINUX project, including the syslinux utility, was initiated by H. Peter Anvin. It began as a simple, small bootloader for floppy disks and quickly expanded to support various boot media. Its design philosophy emphasizes simplicity and minimalism, making it a popular choice for embedded systems, live Linux distributions, and rescue environments. Over time, it evolved to include ISOLINUX (for CD/DVDs), PXELINUX (for network booting), and EXTLINUX (for Ext2/3/4 filesystems), all under the SYSLINUX umbrella. The syslinux command remains a core component for installing the boot sector for these different variants, though its primary focus is on FAT and now Ext filesystems. While UEFI has gained prominence, SYSLINUX continues to be a vital tool for legacy BIOS compatibility and specialized boot scenarios.