How To Install Syslinux in Arch Linux

March 17, 2014 | By in BOOTING, HOWTOS
| Reply More

In this article you will learn how to install syslinux on your Arch Linux box and replace existing GRUB. Syslinux is a collection of bootloaders for Linux. This article will focus on EXTLINUX, one of the bootloaders used for booting from file systems such as ext4, ext3,ext2 and btrfs. Syslinux can also be used as an alternative for GRUB or LILO. Syslinux is used by UNetbootin, a tool for creating live USB drives.

Installing Syslinux

To install syslinux, type the following command:

# pacman -S syslinux

If you have syslinux installed you will be alerted, and if it is an older version a newer one will be installed.

Before proceeding it is essential to confirm the partition table your Arch Linux installation is using. The partition table can either be MBR or GPT.

Type the following command on your terminal, and this will give an output of either gpt (GUID Partition Table )or mbr(MBR Partition table).

# blkid -s PTTYPE -o value /dev/sda

Show  partition table

Alternatively use the fdisk command as follows.

# fdisk -l /dev/sda

This will give you show a list of the partitions and the Disklabel type. In this case the partition table is gpt as also shown by the blkid command.

Fdisk output

Now copy all .c32 files from /usr/lib/syslinux/bios to /boot/syslinux, but first if you do not have the /boot/syslinux folder, create it first.

# mkdir /boot/syslinux

# cp -r /usr/lib/syslinux/bios/*.c32 /boot/syslinux

You should bear in mind where your mount point is, when creating the /boot/syslinux directory. If you mounted your partitions on /mnt then edit the file path appropriately.

Copy .c32 files

Next use the extlinux command to install Syslinux on your ext4 filesystem.

# extlinux --install /boot/syslinux

Installing Syslinux For GUID Partition Table (GPT)

If you have GUID Partition Table follow these steps.
First and foremost, bit 2 of the attributes has to be set for the boot partition as follows.

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

set bit 2 with sgdisk

To confirm whether the changes have taken effect type the following command, which will show the following output if set correctly.

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

Show Set attributes set

Finally install the master boot record as follows:

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

GPT partition table

After successfully installing syslinux you should get a boot menu like this one below.

Default Syslinux Menu

Installing Syslinux For MBR Partition Table

If the fdisk or blkid command showed you have the partition as mbr, install the master boot record as follows

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

Changing Menu Title

To change the menu title from the default one “Arch Linux” open the file syslinux.cfg located in /boot/syslinux/ with your favourite text editor.
In the command prompt type:

# nano /boot/syslinux/syslinux.cfg

Find the line with the words MENU TITLE and change the title to whatever you like. Do not edit the words in caps to avoid ruining your boot loader.

The MENU COLOR option lets you change the color of the background, while the TIMEOUT option, which by default is 5 seconds is timeout before automatic boot to the first menu entry.

Boot Menu Labels

Changing Label

To change the boot menu label, open the file /boot/syslinux/syslinux.cfg, the same file you opened and look for the line “LABEL arch”. Go to the immediate line below this and edit the MENU LABEL to your desired name. Fox example change the line to read:

Boot Menu Title

After making the changes the default menu should look as follows. You can edit it to look the way want.

Custom boot menu

Note that you have to be very careful when following these steps. Any slight mistake could render your machine unbootable.


Share This :

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.