LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 12-01-2022, 06:23 AM   #1
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 275

Rep: Reputation: 16
Dual boot Grub configuration for Fedora Cinnamon 37 and OpenBSD 7.2.


I have successfully installed Fedora Cinnamon 37 and OpenBSD on a single SSD (as that is all my computer supports). Unfortunately, I am having a difficult time with Grub's naming of hard disks and partitions. Here is what I know:
1) My SSD is at /dev/nvme0n1 in Fedora.
2) OpenBSD needs to be chain loaded for Grub to boot OpenBSD.
3) My OpenBSD 7.2 system is on the 6th. partition.
Is there anyone that can guide me with setting up Grub, so that I can boot my OpenBSD system?
 
Old 12-01-2022, 07:44 AM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora ,Xubuntu, others
Posts: 6,474

Rep: Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337
https://lowendunix.com/openbsd-multibooting-gpt/
grub counts disks from 0 and partitions from 1 if the efi partition is the first partition on the first drive it will be (hd0,1)
 
Old 12-01-2022, 10:26 AM   #3
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 275

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by colorpurple21859 View Post
https://lowendunix.com/openbsd-multibooting-gpt/
grub counts disks from 0 and partitions from 1 if the efi partition is the first partition on the first drive it will be (hd0,1)
Thanks for the reply. Running grub> ls I get (hd0,gpt3), gpt4, gpt5, and gpt6. Exiting from the prompt boots me into OpenBSD. I think chain loading should take place at (hd0,gpt6), however the Fedora 37 system refuses to recognize anything due to the OpenBSD file system. I have also tried copying an OpenBSD BOOTX64.EFI file to /boot/efi/EFI/openbsd. I assume /boot is in / but it could be in the GPT partition as well. In other words, I am unsure where /boot resides.

So far, no luck from my end…
 
Old 12-01-2022, 10:46 AM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora ,Xubuntu, others
Posts: 6,474

Rep: Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337
boot into Fedora Cinnamon 37 open a terminal and post the output of the following:
Code:
df -h
sudo parted -l
sudo ls -R /boot/efi
sudo efibootmgr
 
Old 12-01-2022, 11:05 AM   #5
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 275

Original Poster
Rep: Reputation: 16
Code:
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           3.6G     0  3.6G   0% /dev/shm
tmpfs           1.5G  1.7M  1.5G   1% /run
/dev/nvme0n1p2  137G  7.1G  123G   6% /
tmpfs           3.6G   36K  3.6G   1% /tmp
/dev/nvme0n1p3  293G  569M  277G   1% /home
/dev/nvme0n1p1  489M   17M  473M   4% /boot/efi
tmpfs           727M   88K  727M   1% /run/user/1000

$ doas parted -l
Model: Samsung SSD 970 EVO Plus 1TB (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  Flags
 1      1049kB  514MB   513MB   fat16           EFI System Partition  boot, esp
 2      514MB   151GB   150GB   ext4
 3      151GB   471GB   320GB   ext4
 4      471GB   473GB   2000MB  linux-swap(v1)                        swap
 5      473GB   523GB   50.0GB  ntfs                                  msftdata
 6      523GB   1000GB  478GB   ntfs


Model: Unknown (unknown)
Disk /dev/zram0: 7620MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  7620MB  7620MB  linux-swap(v1)

$ doas ls -R /boot/efi 
/boot/efi:
EFI  System  mach_kernel

/boot/efi/EFI:
BOOT  fedora  openbsd

/boot/efi/EFI/BOOT:
bootia32.efi  bootx64.efi  fbia32.efi  fbx64.efi

/boot/efi/EFI/fedora:
BOOTIA32.CSV  BOOTX64.CSV  gcdia32.efi	gcdx64.efi  grub.cfg  grubia32.efi  grubx64.efi  mmia32.efi  mmx64.efi	shim.efi  shimia32.efi	shimx64.efi

/boot/efi/EFI/openbsd:
bootx64_openbsd.efi

/boot/efi/System:
Library

/boot/efi/System/Library:
CoreServices

/boot/efi/System/Library/CoreServices:
SystemVersion.plist

$ doas efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0000,2001,2002,2003
Boot0000* Fedora	HD(1,GPT,c1af4596-58cd-4fe7-8eaa-91752cfbfde9,0x800,0xf4800)/File(\EFI\fedora\shim.efi) File(.䍒)
Boot0001* Fedora	HD(1,GPT,c1af4596-58cd-4fe7-8eaa-91752cfbfde9,0x800,0xf4800)/File(\EFI\fedora\shimx64.efi)
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC
To my knowledge, partition #6, which is where the OpenBSD system is installed, only is flagged in Linux as NTFS. I used the following procedure booting from a Parted Magic USB drive:
$ sudo gdisk /dev/nvme0n1
: t
: 6
: A600
: w
This was done to get OpenBSD to identify this as an OpenBSD partition during install, to allow the installer to autmatically partition this now former (?) NTFS partition.

Last edited by globetrotterdk; 12-01-2022 at 11:14 AM.
 
Old 12-01-2022, 02:14 PM   #6
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 275

Original Poster
Rep: Reputation: 16
Well, I thought that I had solved the problem, but of course, I didn't. However, the resulting errors were interesting, or at least I thought so. They can be seen here.

I have read warnings about not using something called osprober, but here the grub2-probe seems to be tied into Grub, without the option of it getting involved with the menu entry creation.

The Grub entry I created is as follows:
$ doas nano /etc/grub.d/40_custom

menuentry "OpenBSD" {
set root=(hd0,gpt1)
chainloader +1
}
 
Old 12-01-2022, 03:00 PM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora ,Xubuntu, others
Posts: 6,474

Rep: Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337
In uefi mode an efi file is chainloaded

Code:
menuentry "OpenBSD" {
set root=(hd0,gpt1)
chainloader /EFI/openbsd/bootx64_openbsd.efi
}
 
Old 12-02-2022, 01:27 AM   #8
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 275

Original Poster
Rep: Reputation: 16
That seems to work, thanks. Is there a way that I can move the entry for OpenBSD further up the list? I am still getting errors in connection with updating Grub, so I’m not sure grub-customizer will work… Most importantly, I don’t want to break anything, now that the entry is working.
 
Old 12-02-2022, 10:51 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora ,Xubuntu, others
Posts: 6,474

Rep: Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337Reputation: 1337
Quote:
Is there a way that I can move the entry for OpenBSD further up the list?
The order of the grub entries is somewhat based on the numbering of the *.conf files in /etc/grub.d
copy /etc/grub.d/40_custom to /etc/grub.d/11_custom or /etc/grub.d/09_custom will move the entry just after or before the fedora entries.

Last edited by colorpurple21859; 12-02-2022 at 10:55 PM.
 
1 members found this post helpful.
Old 12-03-2022, 05:28 AM   #10
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware, Ubuntu
Posts: 9,898

Rep: Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287
The standard method of setting a menuentry in grub.cfg as the default is to edit the file /etc/default/grub and change the first line (GRUB_DEFAULT=0) from the default zero to whatever the number is for the BSD menuentry in grub.cfg. Grub count begins with zero. Renumbering the custom file should also work as you found.

Quote:
Most importantly, I don’t want to break anything, now that the entry is working.
Make a backup copy of the menuentries from grub.cfg since it is "mostly working" and put it somewhere else, /home/user directory.
 
1 members found this post helpful.
  


Reply

Tags
chainloading, dual boot, grub 2, openbsd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I upgrade from Fedora 31 cinnamon to Fedora 32 cinnamon? bscho Fedora 6 05-11-2020 02:54 AM
Unable to launch "cinnamon-session-cinnamon" X session "cinnamon-session-cinnamon" -found; Falling back to default "session." xxxindigo Linux Mint 22 09-01-2019 10:21 AM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 11:56 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 01:55 PM
Fedora Core 3 Dual Boot, Dual Hard drives, Grub Boot Loader Denali03 Linux - Newbie 1 03-04-2005 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration