LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   New dual boot system (https://www.linuxquestions.org/questions/linux-software-2/new-dual-boot-system-4175734912/)

cahlucas 03-14-2024 05:27 PM

New dual boot system
 
Hello all,

I am setting up a new dual boot system with Linux mint 21 as primary OS and OpenBSD as secondary OS. The latter OS is installed first and Linux last. When the computer boots, there is no choice, and Linux boots as if there were no OpenBSD. Therefore, grub will have to be configured in such a way that this choice is available. I just don't know how, so I'm asking you for advice. I would like to receive advice from one of you on how to do this job. Kind regards, Karel.

syg00 03-14-2024 06:04 PM

I don't use any of the BSDs, but a quick search found this which seems a pretty good explanation.

frankbell 03-14-2024 08:23 PM

It sounds like the grub timeout may be set to zero.

This may help.

yancek 03-15-2024 07:46 AM

If Mint was installed last, I would have expected grub-mkconfig to be run at the end of the install and it would have detected the other OS. You could try booting Mint and running: sudo update-grub to see if you get a BSD entry.

Are both installs UEFI or both Legacy? Are they both on the same physical hard drive? The information on the page linked in post 2 should work for a Legacy install if you get the correct drive and partition.

cahlucas 03-15-2024 01:12 PM

Quote:

Originally Posted by frankbell (Post 6489783)
It sounds like the grub timeout may be set to zero.

This may help.


This gives me a menu with only Linux mint as the only option, OpenBSD is still not available for booting.

cahlucas 03-15-2024 03:49 PM

Quote:

Originally Posted by syg00 (Post 6489763)
I don't use any of the BSDs, but a quick search found this which seems a pretty good explanation.

The installations were performed on an old computer with a BIOS, with 2 hard drives, with Linux mint installed on the primary, and OpenBSD on the secondary hard drive.

Output from update-grub:
Sourcing file `etc/default/grub
Sourcing file `etc/default/grub.d/50_linuxmint.cfg
Sourcing file `etc/default/grub.d/90_custom.cfg
/usr/sbin/grub-mkconfig: 4: /etc/default/grub.d/90_custom.cfg: menuentry: not found

/etc/default/grub.d/50_linuxmint.cfg:
#! /bin/sh
set -e
GRUB_DISTRIBUTOR="Ubuntu"
GRUB_DISABLE_OS_PROBER=false

/etc/default/grub.d/90_custom.cfg:
GRUB_TIMEOUT="5"
GRUB_TIMEOUT_STYLE="menu"
menuentry "OpenBSD" {
set root=(hd1,1)
chainloader +1
}

colorpurple21859 03-15-2024 09:38 PM

Delete the /etc/default/grub.d/90_custom.cfg
change these two line in /etc/default/grub to this:
Code:

#GRUB_TIMEOUT_STYLE=HIDDEN
GRUB_TIMEOUT=5

add the following to /etc/grub.d/40_custom:
Code:

menuentry "OpenBSD" {
set root=(hd1)
chainloader +1
}

run
Code:

sudo update-grub

cahlucas 03-17-2024 11:23 AM

Quote:

Originally Posted by colorpurple21859 (Post 6490015)
Delete the /etc/default/grub.d/90_custom.cfg
change these two line in /etc/default/grub to this:
Code:

#GRUB_TIMEOUT_STYLE=HIDDEN
GRUB_TIMEOUT=5

add the following to /etc/grub.d/40_custom:
Code:

menuentry "OpenBSD" {
set root=(hd1)
chainloader +1
}

run
Code:

sudo update-grub

Output from update grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/40_custom.cfg'
/usr/sbin/grub-mkconfig: 1: /etc/default/grub.d/40_custom.cfg: menuentry: not found

colorpurple21859 03-17-2024 11:36 AM

The file to edit is not
/etc/default/grub.d/40_custom.cfg
the fille to edit is
/etc/grub.d/40_custom

cahlucas 03-17-2024 12:05 PM

Quote:

Originally Posted by colorpurple21859 (Post 6490238)
The file to edit is not
/etc/default/grub.d/40_custom.cfg
the fille to edit is
/etc/grub.d/40_custom

That does make a difference in scanning its bootable hard drives, but not on the end result. Now I have no menu anymore, and it seems to me that the Partition containing OpenBSD has not been found either.

colorpurple21859 03-17-2024 12:56 PM

Edit /etc/default/grub from this:
Code:

GRUB_TIMEOUT_STYLE=HIDDEN
GRUB_TIMEOUT=0

to
Code:

GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5

run update-grub

cahlucas 03-17-2024 01:19 PM

Quote:

Originally Posted by colorpurple21859 (Post 6490246)
Edit /etc/default/grub from this:
Code:

GRUB_TIMEOUT_STYLE=HIDDEN
GRUB_TIMEOUT=0

to
Code:

GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5

run update-grub

The only difference is that I have my menu back, but there is still no OpenBSD entry visible.

yancek 03-17-2024 01:22 PM

Since you can boot Mint, why not run sudo fdisk -l to find which drive and partition BSD is seen on from the Mint Grub? Then boot and use the e key on the keyboard to edit the Grub menu to get the correct entry for the drive and partition on which BSD exists. the set root line should show (hd1,1) for the partition on which it resides. If fdisk shows BSD on the first partition of the second drive then (hd1,1) should work. Make a note of what you try. Sees ridiculous to be editing these files and making changes and saving changes and running update-grub when you don't know if anything you are trying will work. Editing from the boot menu is much simpler. Even editing the grub.cfg file and saving the changes is simpler. When you have an entry that works, make the change in the proper file in the grub.d directory.

colorpurple21859 03-17-2024 01:26 PM

One problem fixed.
Post the contents of /etc/grub.d/40_custom

cahlucas 03-17-2024 02:20 PM

According to fdisk the OpenBSD root partition is at sdb4, so the set root line should be (hd1,4). For some reason the 40_custom file is not read so the menu cannot be updated. Only the files grub, 50_linuxmint.cfg and init-select.cfg are used. The init-select.cfg file only consists of comments (with #), so it has no significance.


All times are GMT -5. The time now is 04:38 AM.