The officially official Devuan Forum!

You are not logged in.

#1 2023-02-25 00:28:10

Juggle333
Member
Registered: 2023-02-24
Posts: 2  

GRUB Grief

I tried installing [devuan_chimaera_4.0.0_amd64_desktop] on a new HDD in my PC, selecting the "guided encrypted LVM" option.
I want to have the option to boot into different OSs and am trying to get a GRUB menu at start-up.

The installation goes OK until I get to the GRUB installation: I chose to install GRUB to the new HDD because my existing (Ubuntu) OS was not detected and I didn't want to risk losing the ability to boot into that.

Things have become a lot more complicated since the last time I set up a multi-boot system with GBUB, which only required editing the GRUB menu file!
Now, things are all the more complicated by using encrypted volumes, which I suspect is why the GRUB installer won't recognise the OS on my 1st HDD?

Even though the installation appears to complete successfully, there is no GRUB menu and my system boots Ubuntu as before.  Choosing to start the new HDD from the BIOS boot menu produces a "Welcome to GRUB!" message and a "grub_rescue" prompt - at which point I'm stuck.

I suspect that I need to find a way of either unlocking my existing encrypted disk first, to allow the GRUB installer to see it, or editing GRUB settings to recognise encrypted disks?

Offline

#2 2023-02-25 00:44:17

andyprough
Member
Registered: 2019-10-19
Posts: 327  

Re: GRUB Grief

Ubuntu owns the boot management for your system and by default won't allow any other OS's to boot. Here's a quick and simple step-by-step procedure to get Ubuntu to add your Devuan (and any other GNU/Linux partitions) to grub: https://www.omgubuntu.co.uk/2021/12/gru … istros-fix

Before finishing those steps, I would make sure that the os-prober package is installed on your Ubuntu: 'apt policy os-prober'

Last edited by andyprough (2023-02-25 00:47:02)

Offline

#3 2023-02-25 10:08:30

delgado
Member
Registered: 2022-07-14
Posts: 209  

Re: GRUB Grief

Juggle333 wrote:

Choosing to start the new HDD from the BIOS boot menu produces a "Welcome to GRUB!" message and a "grub_rescue" prompt - at which point I'm stuck.

I suspect that I need to find a way of either unlocking my existing encrypted disk first, to allow the GRUB installer to see it, or editing GRUB settings to recognise encrypted disks?

This should have worked.
The boot selection method via BIOS-boot-menue is independant from any installation on other HDD's, therefore no need to edit foreign grub configurations.

I probably would temporarily disconnect the Ubuntu-disk (physically), and then try to boot / chroot / rescue / reinstall.

PS:
(((the OP knows, but just to name it - the BIOS-boot-menue: Power-on the PC, it beeps, press once [F12_in_my_case] and the HDD selection appears.)))

Offline

#4 2023-02-25 13:19:42

Juggle333
Member
Registered: 2023-02-24
Posts: 2  

Re: GRUB Grief

andyprough wrote:

Ubuntu owns the boot management for your system and by default won't allow any other OS's to boot. Here's a quick and simple step-by-step procedure to get Ubuntu to add your Devuan (and any other GNU/Linux partitions) to grub: https://www.omgubuntu.co.uk/2021/12/gru … istros-fix

Before finishing those steps, I would make sure that the os-prober package is installed on your Ubuntu: 'apt policy os-prober'

Thanks for that.
I'm still running Ubuntu 20.04 and am avoiding 22.04 due to various issues with that release.

I tried disconnecting my 1st HDD and reinstalling Devuan.  With the only the 2nd HDD connected, Devuan starts normally.  Reconnecting the 1st HDD causes the system to boot Ubuntu as before, but selecting the 2nd HDD from the BIOS boot menu starts Devuan normally.

This is not ideal and I would really like to have a proper GRUB menu at start-up, but I can live with this for now.

I moved to Ubuntu to escape the insecure, bloated lethargy of Windows, but I now find similar issues with Ubuntu since the shift to systemd and snaps.
I'm looking hopefully at Devuan as a return to a fast, secure, reliable OS.
:-)

Last edited by Juggle333 (2023-02-25 13:20:36)

Offline

#5 2023-02-25 14:28:28

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,481  

Re: GRUB Grief

If the ubuntu root filesystem is encrypted, then os-prober in chimaera won't see it. Likewise, os-prober in ubuntu won't see the encrypted devuan. You will have to manually create a menuentry in ubuntu for the chimaera installation.

In ubuntu, put something like this in /etc/grub.d/40_custom and then run update-grub

menuentry 'Devuan' {
set root=(hd1,msdos1)
linux /vmlinuz ro root=/dev/mapper/your-vg-lg-name
initrd /initrd.img
}

Notes:
(hd1,msdos1) assumes that the /boot partition is the first partition on the second hard drive and it has msdos partition table.
/dev/mapper/your-vg-lg-name is the name of the logical volume that holds devuan's root filesystem.

If you switch the order of the hard drives permanently, either through bios settings or opening the box and switching cables, you could do the above procedure in devuan to get a menu entry for the encrypted ubuntu. (If it's not encrypted, then running os-prober should automatically add an entry for it.)

Offline

#6 2023-02-25 14:34:48

andyprough
Member
Registered: 2019-10-19
Posts: 327  

Re: GRUB Grief

You should also be able to run a 'grub install' command from within Devuan to overwrite the grub on the HDD. Here's a couple of stackexchange threads that will give you ideas for the correct command and mount procedure -
https://unix.stackexchange.com/question … ive#191220
https://unix.stackexchange.com/question … an-install

Offline

Board footer