Jan Leow's Blog Page

LibreElec GRUB2 menu entry for booting

I first learned about LibreElec when I got my Raspberry Pi 4. Having played around with it to watch some movies and connect to Netflix, YouTube and Spotify in the little RPi SBC, I was thinking of installing it on my spare old PC.

LibreElec has a simple Linux shell making it very lightweight. It just concentrates on being a media player by running Kodi fully.

Heading over to the LibreElec website (https://libreelec.tv/), I downloaded the installer. The installer will create a LibreElec installer in a USB flash drive. And from there you could install it. LibreElec does not support multi booting. However if you can plan your installation process, you could manage to create a multiboot OS system with LibreElec.

To do so, you will need to install LibreElec first. Then use a partition manager like Gparted and reduce the storage partition to provide space for other OS. Unfortunately if you already have an existing OS and would like to try to dual boot LibreElec, then it is not possible to install alongside.

The other alternative is to install it on a second hard disk. Installing on a second hard disk has some advantage as well. In case you want to update or upgrade LibreElec, it won’t affect the other OS on the other hard disk drive. As a precaution, I’ve unplugged the primary hard disk drive before installing LibreElec just to be on the safe side to avoid potential overwriting of my other OS.

Since I am using another Linux GRUB to hold the menu entry, the LibreElec bootloader should be installed in its own partition.

On my primary Linux, the update-grub command could not detect it, and it would require manually keying in the GRUB2 menu entry into 40_custom file located in /etc/grub.d/

Edit this file:

/etc/grub.d/40_custom

And add in the below menu entry. To find the UUID for the boot partition of LibreElec, type “blkid” in the terminal console. There will be two UUID that you will need to copy down.

One for the boot partition label as “system”
The other for the data partition label as “storage”

Copy down the UUID for the “system” partition that will boot LibreElec and insert it into your GRUB2 menuentry. And add the UUID for the disk “storage” partition. Below example taken from my installation where LibreElec was sharing the same hard disk with another operating system. Please replace the ABCD-1234 etc with your version of the UUID.

menuentry "LibreELEC (hd0,1 /dev/sda1)" {
	set root='(hd0,1)'
	search --set -f /KERNEL
	linux /KERNEL boot=UUID=ABCD-1234 disk=UUID=1234ABCD-5678-90AB-CDEF-0123ABCD  quiet
}

For my other old PC where I installed my LibreElec on a secondary hard disk drive, my bootloader was installed in the MBR of the secondary hard disk drive. After plugging back my primary hard drive, I manually added the menu entry into the 40_custom file using a simple chainloader to boot it up:

menuentry 'LibreElec Kodi (hd2,1)' {
	echo 'Booting LibreElec...'
	set root=(hd2,1)
	chainloader +1
}

After saving the 40_customer file, go back to console and type “update-grub” to append the menu entry to the config.cfg configuration file.

Reboot your PC and see if it works. Check for any errors or typos if it didn’t work and try again. Good luck!

Cheers!

Back to GRUB2 manual menu entry list

No comments: