LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-18-2021, 01:25 AM   #31
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,876
Blog Entries: 1

Rep: Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078

Quote:
Originally Posted by enorbet View Post
OpenSuSe[sic] does not have an /etc/grub2/ directory
openSUSE does have it if all of Grub is correctly installed, and in any case /boot is on a separate filesystem from /, that filesystem is mounted where it belongs.
Quote:
nor a file labelled "custom.cfg" anywhere,
/boot/grub2/custom.cfg only exists if you create it. Grub only ever reads it. It never writes to it.
Quote:
nor is there an "update-grub" command.
The *buntu people created it for dummies who can't manage to run grub-mkconfig -o /boot/grub/grub.cfg. Not all distros find it necessary to include it.
Quote:
It's all supposed to be handled by Yast
YaST can handle Grub for you if you wish, but not to the extent you can do manually using a text editor and the tools Grub provides
Quote:
or Grub_Configurator.
Code:
# inxi -Sy
System:
  Host: 00srv Kernel: 5.3.18-lp152.87-default x86_64 bits: 64
  Console: tty pts/0 Distro: openSUSE Leap 15.2
# which grub_configurator
which: no grub_configurator in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/opt/kde3/bin)
# which Grub_Configurator
which: no Grub_Configurator in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/opt/kde3/bin)
I've searched openSUSE repos and https://software.opensuse.org/search without finding any such package.
Quote:
I'm assuming "/etc/grub.d/40_custom" will suffice.
It's one path. Note that by virtue of the number in its name, resulting stanzas at boot time will follow those produced by grub.cfg. It needs to be copied or symlinked to a number lower than 10 in order for custom.cfg entries to precede grub.cfg entries.
 
Old 09-18-2021, 02:23 AM   #32
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,810

Original Poster
Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Well it ain't pretty yet but it's booting a single entry Custom menu. I'll clean it up and add the rest tomorrow. What was messing me up to where Grub couldn't find the kernel was that bit about root=, since it attaches to /boot apparently. Once I deleted "/boot" from "/boot/vmlinuz-5.12.12" so it reads "/vmlinuz-5.12.12" Bingo! Grub finds the kernel and away we go!

Thank you for your help and your patience mrmazda. You are very appreciated. Now that I have basic function I can start boning up on all the wildass syntax so I actually understand Grub.

FWIW I now have success in both Slackware and in OpenSuSe (Slackware was far more straightforward, as usual). Incidentally, neither has "/etc/grub2". They have "/etc/grub.d". I don't remember where I got Grub-Configurator but it's installed (in SuSe not in Slack... SuSe needs it 'cuz Yast is primitive and limited) and it works. Being a 20 year Slackware vet I'm far more comfortable with grub-mkconfig than update-grub. If Grub wasn't installed correctly in OpenSuSe it's SuSe's fault because it is literally DEfault.

Last edited by enorbet; 09-18-2021 at 02:32 AM.
 
Old 09-18-2021, 05:55 AM   #33
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Quote:
Well it ain't pretty yet but it's booting a single entry Custom menu. I'll clean it up and add the rest tomorrow. What was messing me up to where Grub couldn't find the kernel was that bit about root=, since it attaches to /boot apparently. Once I deleted "/boot" from "/boot/vmlinuz-5.12.12" so it reads "/vmlinuz-5.12.12" Bingo! Grub finds the kernel and away we go!
Boot partitions, grub os-prober doesn't find other distros boot partitions, and mounting them similar to what works with lilo does nothing.

Quote:
Being a 20 year Slackware vet I'm far more comfortable with grub-mkconfig than update-grub
update-grub is wrapper for grub-mkconfig.

Quote:
If Grub wasn't installed correctly in OpenSuSe it's SuSe's fault because it is literally DEfault.
OpenSuSe and fedora based distros use grub2 naming for grub: grub2-install grub2-mkconfig /boot/grub2/grub.cfg

Most distros break grub up into 3 packages: grub-common grub-pc grub-efi. I think Slackware is the only distro that doesn't do this.

Last edited by colorpurple21859; 09-18-2021 at 06:43 AM.
 
Old 09-18-2021, 10:43 AM   #34
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,810

Original Poster
Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
The big breakthrough for me happened by understanding that Grub's command line is it's own animal with it's own protocols, unlike anybody else's. Ther major A-Ha! moment came from using Grubs CLI and just entering "ls" which showed me that not only does Grub see and use drives differently with NVME drives last, but Grub reverses the order of the 2 NVME drives this rig has. This fouled up "hint" stanzas since os-prober basically just tries anything in a shotgun approach.

Naturally not realizing this compounded the scattershot way os-prober works, at least for the way I organize my drives where some past bootloaders needed all kernels in the same location to workaround chainload issues. Because of this, os-prober matches up kernels with distros that will inevitably fail which is why I vastly prefer telling my PC what to do over letting automation figure it out. I will be disabling os-prober ASAP now that a wee bit of dawn has arrived shedding some light on how Grub functions, thanks to you guys and a lot of work.

BTW colorpurple21859, I get it that "update-grub" is a wrapper for "grub-mkconfig -o /boot/grub/grub.cfg". The issue is the discrepancies in documentation over time and among different distros. It seems, again as usual, the most efficient way to learn is via command line,. so first order of business is to learn Grubs command structure and syntax. Hopefully then I can see distro-specific ways and means to get a grasp on consistencies within a distro to guide manual menuconfig.
 
Old 09-18-2021, 11:51 AM   #35
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,876
Blog Entries: 1

Rep: Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078
Quote:
Originally Posted by enorbet View Post
Well it ain't pretty yet but it's booting a single entry Custom menu. I'll clean it up and add the rest tomorrow. What was messing me up to where Grub couldn't find the kernel was that bit about root=, since it attaches to /boot apparently. Once I deleted "/boot" from "/boot/vmlinuz-5.12.12" so it reads "/vmlinuz-5.12.12" Bingo! Grub finds the kernel and away we go!
As a Slack user, maybe you've never run into this before, but openSUSE, Mandrake, Fedora, RedHat and probably others did, and maybe still do, avoid that problem this way:
Code:
# inxi -Sy
System:
  Host: gx62b Kernel: 4.1.13-100.fc21.x86_64 x86_64 bits: 64
  Console: tty pts/0 Distro: Fedora release 21 (Twenty One)
# ll /boot | head -n4
total 173228
dr-xr-xr-x  3 root root     6144 Oct 13  2017 .
dr-xr-xr-x 23 root root     1024 Sep 18 12:40 ..
lrwxrwxrwx  1 root root        1 Mar 27  2014 boot -> .
This enables a bootloader to find the kernel in the "same place" whether the kernel is on a separate filesystem from / or not when specified as being in /boot/ rather than in /.

Quote:
Thank you for your help and your patience mrmazda. You are very appreciated.
There are links at the bottom of each post you can click that do that.

Quote:
FWIW I now have success in both Slackware and in OpenSuSe (Slackware was far more straightforward, as usual). Incidentally, neither has "/etc/grub2". They have "/etc/grub.d".
I just fixed the typo in post #27 where you saw my mental error exposed (typing /etc/grub2 where should have been /boot/grub2).
 
Old 09-25-2021, 09:09 AM   #36
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
OP I know its marked as solved but I too have disabled os-prober.

to boot W10 I use a 40_custom file that reads

menuentry "W10" {
insmod ntfs
set root=(hd1)
chainloader +1
}

Use root powers to run
Code:
update-grub
mrmazda has mentioned the set root command, I prefer to explain this way.
For a linux system, grub2 is looking for the boot partition (or the partition that grub dir is on)
---the kernel line does not need UUID as discussed by smallpond, but it need root= (and I use /dev/sda1) (as I still use MBR)

And use can label ext2,3 and 4 partitions using e2label command, but I always use a live usb to do that so the parition is not mounted.
trivia, swap can also have a label but that is more relevant to /etc/fstab.

soo.....
IMHO if you prefer no os-prober, you should use simple /dev/sdxn style stuff.

For each distro, install its grub into the Partition Boot Record.
For all distro, have one grub2 in MBR
Yep none of that UEFI/GPT ...sorry got carried away there.

And then for each OS boot into the distro that controls MBR and create chainloader menuentry for each other OS

so a template would be for 40_custom from /etc/grub.d/

menuentry "P5" {
set root=(hd0,5)
chainloader +1
}

IMHO for linux chainloading you do not need to insert modules as most for linux have already been loaded by the header script.

grub2 counts menuentries and hard drives from zero and partitions from one.

If you like this way.....you will need to run the grub-install command from each OS to install into its PBR.

2) you should be able to find your update-grub command.
Mine is a script. I would not trust any distro that hides real commands from me.

Last edited by aus9; 09-25-2021 at 09:13 AM.
 
Old 10-07-2021, 11:57 PM   #37
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,810

Original Poster
Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Thanks Aus9 but I have returned to rEFInd. I am still a bit jealous that Grub apparently doesn't need a Fat32 ESP partition, but it's idiosyncrasies just put me off too much, especially how it sees drive order. Every other bit of software I know of lists NVME drives first. Only Grub2 afaik lists them last. It just tells me grub developers have little concern for compatibility and convention.

Personal Computers have been around for almost 50 years now and to me it makes zero sense that in almost a half century booting hasn't become absolutely trivial and basically universal. Much of the blame goes to Microsoft and what's left of the heavy Wintel "lobby" but that's a whole other soap opera.
 
  


Reply

Tags
bootloader, efi, grub2, multibooting



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kcm-grub2 - No valid GRUB2/BURG installation could be detected cristi92b Linux - Newbie 2 06-14-2012 08:01 AM
LXer: Eastern Europe schooling US, western Europe on fast broadband LXer Syndicated Linux News 1 09-22-2011 03:25 PM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 02:39 PM
Books? Or Schooling? jhyland87 Linux - Newbie 11 12-20-2008 09:46 PM
Linux Schooling? Woofcat General 4 12-19-2006 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:30 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