The officially official Devuan Forum!

You are not logged in.

#1 2017-04-19 21:18:12

fsmithred
Administrator
Registered: 2016-11-25
Posts: 1,627  

Replace GRUB with alternate bootloader: extlinux

extlinux is a simple bootloader that's part of the syslinux project. (syslinux is for FAT partitions, extlinux is for ext2/3/4 partitions, isolinux is for CD/DVD)

You can easily switch from using grub as a bootloader to using extlinux (and back again if you want).

Run the following commands as root. Replace /dev/sda and /dev/sda1 with the correct drive and partition for your system.
BE SURE YOU NAME THE CORRECT DEVICES!

apt-get install extlinux syslinux-common
mkdir /boot/extlinux
extlinux --install /boot/extlinux
dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda bs=440 count=1
cp /usr/lib/syslinux/modules/bios/*.c32 /boot/extlinux

Create a boot menu with your favorite text editor, add the following lines and save it as /boot/extlinux/extlinux.conf

ui vesamenu.c32

label devuan
	menu label devuan
	kernel /vmlinuz
	append initrd=/initrd.img ro root=/dev/sda1

Reboot

If you want to add a splash image and 5-second timeout, copy a 640x480 png (or jpg) image named splash.png (or splash.jpg) to /boot/extlinux and add the following lines to extlinux.conf:

ui vesamenu.c32
menu background splash.png
timeout 50

label devuan
	menu label devuan
	kernel /vmlinuz
	append initrd=/initrd.img ro root=/dev/sda1

There are more things you can do with the menu. See syslinux documentation for more information:
http://www.syslinux.org/wiki/index.php?title=Menu


To revert to booting with grub, run

grub-install /dev/sda

Reboot


To switch back to extlinux again:

dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda bs=440 count=1

Reboot

Offline

#2 2018-03-06 13:47:57

fsmithred
Administrator
Registered: 2016-11-25
Posts: 1,627  

Re: Replace GRUB with alternate bootloader: extlinux

If you're using gpt with bios, the procedure is slightly different. You may need to do the following steps first.

https://wiki.archlinux.org/index.php/sy … tion_table

GUID partition table

For a GPT, ensure bit 2 of the attributes is set for the /boot partition using gdisk. In other words, the "legacy_boot" flag must be set. Using sgdisk the command is:

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

This would toggle the attribute legacy BIOS bootable on partition 1 of /dev/sda. To check:

# sgdisk /dev/sda --attributes=1:show

 1:2:1 (legacy BIOS bootable)

Then follow the instructions in the first post, except for the dd command.
Change the following

dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda bs=440 count=1

to this:

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

If you want to use UUID instead of device names in the menu, edit the 'append' line to replace

root=/dev/sda1

with something like

root=UUID=xxxxxxxxxxxxxxxxxxx

(replace xxxxx... with the correct uuid.)

Offline

#3 2020-08-06 14:20:44

Vernon
Member
Registered: 2020-07-19
Posts: 89  

Re: Replace GRUB with alternate bootloader: extlinux

Thanks very much for this tutorial! I have always found GRUB way too complicated and bloated. I opted for a text boot menu and a two second timeout so my /boot/extlinux/extlinux.conf looks like

ui menu.c32

label devuan
        menu label devuan
        kernel /vmlinuz
        append initrd=/initrd.img ro root=/dev/sda1
        timeout 20

More  /boot/extlinux/extlinux.conf  options can found at

https://git.zytor.com/syslinux/syslinux … slinux.txt

Offline

#4 2020-08-06 17:08:58

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,000  
Website

Re: Replace GRUB with alternate bootloader: extlinux

fsmithred wrote:
	append initrd=/initrd.img ro root=/dev/sda1

It's better to identify the root partition with UUIDs, the block device allocation can change from one boot to the next.

	append initrd=/initrd.img ro root=UUID=$uuid

^ Replace $uuid with the actual UUID of the root partition.


Black Lives Matter

Offline

#5 2020-08-06 20:16:47

Vernon
Member
Registered: 2020-07-19
Posts: 89  

Re: Replace GRUB with alternate bootloader: extlinux

Head_on_a_Stick wrote:
fsmithred wrote:
	append initrd=/initrd.img ro root=/dev/sda1

It's better to identify the root partition with UUIDs, the block device allocation can change from one boot to the next.

	append initrd=/initrd.img ro root=UUID=$uuid

^ Replace $uuid with the actual UUID of the root partition.

Great point! However, I have only seen the block device allocation change when disks were added. I have never seen the block device allocation change on a single disk system. Regardless, using UUIDs is a much safer practice long term.

Offline

#6 2020-08-06 21:15:11

Marjorie
Member
From: Teignmouth, UK
Registered: 2019-06-09
Posts: 79  

Re: Replace GRUB with alternate bootloader: extlinux

Vernon wrote:

I have only seen the block device allocation change when disks were added. I have never seen the block device allocation change on a single disk system. Regardless, using UUIDs is a much safer practice long term.

It also happens if you unplug the drives and put them back in a different order.
I did this once, OK, I was adding new drives for a RAID1 install, and forgot to record which socket each disk was plugged in to originally and got some what confused for a while. However even if you don't add drives just permuting the existing drives would do it.

Offline

Board footer