Replacing Grub With Syslinux

lwfitz

A number of our users have expressed their disdain towards Grub so to keep them happy here is how to replace Grub with extlinux which is one of the many spinoffs of syslinux and is quite often used in booting live disks.
As always before making any major changes to a system its a good idea to have a backup and I always like to keep a super grub disk around just in case something goes haywire, I will still be able to boot into my system and repair it.

Remove grub and Install extlinux (remember all this must be done as root)

sudo su

apt-get remove grub-common

apt-get install extlinux syslinux-common

extlinux --install /boot/extlinux


Make sure your /boot partition is flagged as bootable

A bootable partition will have an * in the boot column

fdisk -l /dev/sda

Mine looks like this


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2655    21326256   83  Linux               
/dev/sda3            2655       60315   463153950   83  Linux                 
/dev/sda2           60315       60802     3911827   82  Linux swap



If there is no boot partiton flagged you can fix that with a tool such as gparted





At this point if you never had any other bootloader installed on your system then you should be able to reboot, but if you are replacing another loader such as any version of grub or lilo then if has  probably overwritten the disk's master boot record (MBR). Even if you told it not to. If so, you'll need to replace the grub/lilo code with a more standard MBR. There's one that comes with extlinux, and you can install it like this:

cat /usr/lib/extlinux/mbr.bin >/dev/sda

Exltlinux is now installed and you can reboot but there will not be any menu.



Setting up a boot menu

Extlinux needs extra code to display a menu and on  Debian, that code comes from the syslinux-common package rather than the extlinux package, which is why we installed both packages. Copy the menu files into place:

cp /usr/lib/syslinux/*menu* /boot/extlinux

If you are dual booting with any other OS you will also need the chainloader

cp /usr/lib/syslinux/chain.c32 /boot/extlinux

The menu is auto added now by running

sudo extlinux-update

If you have a windows bootable partition this will also add that portion of the menu just like grub does.

Themes

Themes are located in /usr/share/syslinux/themes/ and to change your theme you will edit /etc/default/extlinux

Mine looks like

## /etc/default/extlinux - configuration file for extlinux-update(8)

EXTLINUX_UPDATE="true"

EXTLINUX_ALTERNATIVES="default recovery"
EXTLINUX_DEFAULT="l0"
EXTLINUX_ENTRIES="all"
EXTLINUX_MEMDISK="true"
EXTLINUX_MEMDISK_DIRECTORY="/boot"
EXTLINUX_MENU_LABEL="VSIDO GNU/Linux, kernel"
EXTLINUX_OS_PROBER="true"
EXTLINUX_PARAMETERS="ro quiet"
EXTLINUX_ROOT="root=/dev/sda1"
EXTLINUX_THEME="vsido"
EXTLINUX_TIMEOUT="50"


Change the line

EXTLINUX_THEME="vsido"

to the theme name that you want


Extlinux can display custom y image backgrounds, start with a 640x480 image then move up in resolution to see what works for you. Originally an upgraded resolution worked for me but after a couple boots my background image disappeared. The only resolution I can use that seems to be stable is 640x480.

Here is my VSIDO extlinux theme if anyone is interested

Just extract that file and copy the extracted folder to /usr/share/syslinux/themes/

After making any changes to your theme or extlinux settings you will need to run

sudo extlinux-update



Don't Be A Dick!

VastOne

Very nice and informative How To lwfitz! 

Thank you!
VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

We need a "Cool Beans Icon" or a "10000 Cookie Icon"

For now this will have to do: Cookies10000

Someday I might try it ... don't tell my wife though, she'd have my skin hanging on the wall.  :D
Stay Home

jedi

 ;D Wow lwfitz!  Wow!  This is great.  I'll be doing this tonight...  Thanks for the great How To...
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

lwfitz

Thanks guys  :)

Im working on a nice theme that maybe can be used as the default if your interested VastOne
Don't Be A Dick!

Sector11

I'm curious.... ( looking for justification maybe )

   1. What advantages are there with Syslinux over Grub?
   2. Why don't Linux Distros in general use it?


Stay Home

lwfitz

Quote from: Sector11 on January 17, 2013, 10:29:47 PM
I'm curious.... ( looking for justification maybe )

   1. What advantages are there with Syslinux over Grub?
   2. Why don't Linux Distros in general use it?

Well for me, I did it because dizzie wouldnt shut up about how crappy grub is.......

But to answer your question......

I noticed a definite increase in my boot up time (about 6seconds) and the comfiguration files are a bit more straight forward (at least for me) than grub2.

Grub is pretty much an automated install where as with syslinux there is some editing of config files to get things working.
I could be wrong but syslinux seems to be a bit more configurable also.

Why its not used more? I dont have any clue :D
Don't Be A Dick!

Sector11

#7
Quote from: lwfitz on January 17, 2013, 11:07:00 PM
Well for me, I did it because dizzie wouldnt shut up about how crappy grub is.......

  :D  Now that's honesty!  :D

Quote from: lwfitz on January 17, 2013, 11:07:00 PM
Why its not used more? I dont have any clue :D

I may have to give this some serious consideration.  I remember when GRUB had files one could tweak, changing the names of things if you wanted.  My "Windows" entry because: "W2K" - then they changed this, hid everything and says - "Now you do it our way!" {well, OK, not really but you get my drift}
Stay Home

dizzie

Quote from: lwfitz on January 17, 2013, 11:07:00 PM
Well for me, I did it because dizzie wouldnt shut up about how crappy grub is.......
Yeah!  ;D
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

dizzie

With Syslinux i have access to : Linux, Hackintosh, and FreeBSD  ;D
With Grub2 i have access to : Anger and agony  >:(
*gives lwfitz a cookie and a glass of cold milk*  8)
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

apprentice

thanks fitz

if im starting from a blank slate
where does sys/extlinux come from

or do i use grub to install then follow your tut from there?

make sense?

Things turn out best for people who make the best of the way things turn out.

lwfitz

Quote from: apprentice on January 19, 2013, 08:37:50 PM
thanks fitz

if im starting from a blank slate
where does sys/extlinux come from

or do i use grub to install then follow your tut from there?

make sense?


Hey apprentice, yeah just install like normal, install updates if any and then install syslinux. If you have any questions just ask
Don't Be A Dick!