Open Source per un mondo più libero e sicuro
Top bar
0 Download
WIKI CONDRES OS

How to manually add menu entry to GRUB2

11 Settembre 2019 · Calogero Scarnà

First, check the UUID of the root partition that belongs to Linux os you would like to add to grub entry. Use blkid command:

sudo blkid

Result

/dev/sda1: UUID="cbe96c7b-380e-4a32-a380-e48808c18c54" TYPE="ext4" PARTUUID="2e0be024-01" 
/dev/sda2: UUID="37675038-33fd-4f42-9ff6-52496f4c2498" TYPE="swap" PARTUUID="2e0be024-02"

Attention, check that the partition to start is the exact one

Uuid for the root partition of my system is cbe96c7b-380e-4a32-a380-e48808c18c54
Now mount root partiton for that Linux system and check the name of executable Linux kernel under /boot directory.
Once you have that two information that we need, we can now configure Grub menu entry.

sudo nano /etc/grub.d/40_custom

Then add the following lines according to your specifications.

menuentry “Condres Linux” {

search –set=root –fs-uuid cbe96c7b-380e-4a32-a380-e48808c18c54

linux /boot/vmlinuz-* root=UUID=cbe96c7b-380e-4a32-a380-e48808c18c54 rw quiet

}

Replace cbe96c7b-380e-4a32-a380-e48808c18c54 with root partition’s uuid for one you’re adding, and /boot/vmlinuz-* with the location of your executable linux file.
Then update grub to generate a new grub.conf file.

sudo grub-mkconfig -o /boot/grub/grub.cfg

or 

sudo update-grub

That’s all. You should see the entry on grub menu when you reboot