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.
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 gpt
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.
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.
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
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)
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
After successfully installing syslinux you should get a boot menu like this one below.
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.
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:
MENU LABEL Linoxide
After making the changes the default menu should look as follows. You can edit it to look the way want.
Note that you have to be very careful when following these steps. Any slight mistake could render your machine unbootable.