LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-05-2022, 12:49 PM   #1
adrian_stephens
Member
 
Registered: Apr 2005
Location: Cambridge, UK
Distribution: KDE Neon, Proxmox
Posts: 37
Blog Entries: 2

Rep: Reputation: 1
grub booting btrfs on lvm gives "error: no server is specified"


I have an installation of Ubuntu and Fedora in to logical volumes.
The physical volume consists of two disks.

The logical volume for Ubuntu is entirely within the first disk and is formatted ext4.

The logical volume for Fedora spans both disks, and is formatted btrfs.

Using UEFI boot manager, I can boot either system successfully, but this involves messing around in the UEFI menus.

I normally run my own simple boot manager, which is a grub menu that sets root and then jumps to the grub.cfg configfile of the selected os.

I install the boot manager using the Ubuntu grub-install, because Fedora doesn't provide an equivalent command.

My boot menu boots to the ubuntu config file just fine.
But when I try and access the fedora config file, I get "error: no server is specified".

More specifically, "ls" lists (vg-root) {my Ubuntu} and (vg-root2) {my Fedora} as present. ls (vg-root)/boot works just fine.
but ls (vg-root2)/boot produces the above error message.

I have loaded the lvm and btrfs modules.

I'm wondering if there is a grub lvm limitation.


The same error is produced if I attempt to boot Fedora using Ubuntu's grub.cfg if os_prober is enabled creating that grub.cfg.

Is this an lvm problem? Is it a btrfs problem?
 
Old 05-05-2022, 06:44 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Both.

And what do you mean when you say fedora does not have a command similar to grub-install. Fedora uses grub2-mkconfig.

How did you install fedora? Did you put the entire install on a pre-existing LVM volume? Did you use automatic install? Do you boot UEFI or MBR? Which system was installed first?

IME grub cannot boot a system that is totally on btrfs or LVM.
It has to
1. load the kernel module to support the btrfs before it can be accessed.
2. load the kernel module to support LVM before it can access the LV

This is why for most systems there is a separate /boot (and /boot/efi) with the kernel (vmlinuz & initramfs/initfs) in /boot (ext4) with efi boot files in /boot/efi (vfat) when using either LVM or btrfs. It becomes even more complicated when using both LVM & btrfs.
 
Old 05-06-2022, 04:51 AM   #3
adrian_stephens
Member
 
Registered: Apr 2005
Location: Cambridge, UK
Distribution: KDE Neon, Proxmox
Posts: 37

Original Poster
Blog Entries: 2

Rep: Reputation: 1
Quote:
Originally Posted by computersavvy View Post
Both.

And what do you mean when you say fedora does not have a command similar to grub-install. Fedora uses grub2-mkconfig.

How did you install fedora? Did you put the entire install on a pre-existing LVM volume? Did you use automatic install? Do you boot UEFI or MBR? Which system was installed first?

IME grub cannot boot a system that is totally on btrfs or LVM.
It has to
1. load the kernel module to support the btrfs before it can be accessed.
2. load the kernel module to support LVM before it can access the LV

This is why for most systems there is a separate /boot (and /boot/efi) with the kernel (vmlinuz & initramfs/initfs) in /boot (ext4) with efi boot files in /boot/efi (vfat) when using either LVM or btrfs. It becomes even more complicated when using both LVM & btrfs.
Thanks for your reply. "fedora does not have a command similar to grub-install. Fedora uses grub2-mkconfig.
". This is, with respect, incorrect. Fedora's grub2-mkconfig is parallel to ubuntu's update-grub - i.e. it updates the grub.cfg, but does nothing with the boot/efi data. If you hose fedora's boot/efi data, its documentation tells you to delete the grub.cfg files and reinstall the grub-efi* packages, a side effect of which is to create the boot/efi/EFI/fedora.

"grub cannot boot a system that is totally on btrfs or LVM".
I don't understand then why, absent my boot_menu, I can use the UEFI boot manager to select the fedora entry and boot successfully fedora root (and boot) on btrfs on a logical volume split across two physical volumes.

By the way, I hosed the Fedora LV and replaced it with a Manjaro on ext4 LV.
Again, this boots just fine when selected from the UEFI boot menu.
But although grub "ls" lists (lvm/vg-root) and (lvm/vg-manjaro) as present, when I then type "ls (lvm/vg-root)" it lists the root directory, but fails with "no such disk" on "ls (lvm/vg-manjaro)".

It looks to me like the Ubuntu-supplied grub can't cope with booting off lvm spanning physical volumes, but both Fedora and Manjaro can. A most unlikely conclusions.

I think I'll hose the manjaro, and create a second ubuntu installation on the lvm spanning the disks.
 
Old 05-06-2022, 10:26 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
Fedora's grub2-mkconfig is parallel to ubuntu's update-grub
Ubuntu actually uses grub-mkconfig as the update-grub script is a 'stub' which simply points to the grub-mkconfig script. update-grub is located at /usr/sbin and is a one line script, entire contents shown below.

Code:
 #!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
Fedora uses 'grub2-install on Legacy systems as explained at the Fedora docs site below.

https://docs.fedoraproject.org/en-US...ng-with-grub2/
 
Old 05-06-2022, 11:07 AM   #5
adrian_stephens
Member
 
Registered: Apr 2005
Location: Cambridge, UK
Distribution: KDE Neon, Proxmox
Posts: 37

Original Poster
Blog Entries: 2

Rep: Reputation: 1
Some more information on this. BTRS and Fedora/Manjaro are red herrings.
I have similar (k)ubuntu 22.04 installations on two logical volumes. The only difference is that the
first (vg-root) lies entirely within a physical volume, whereas the second (vg-k2) spans two physical volumes.

The error I see is easily produced in grub command line:
grub> ls
(lvm/vg-k2) (lvm/vg-root)
grub> ls (lvm/vg-root)
Device lvm/vg-root: Filesystem type ext4 ...
grub> ls (lvm_k2)
error: no server is specified

Well, it is formatted as ext4, and I can boot it using the UEFI Shell. Also the "no server is specified" comes from a module in grub called "net.c" that deals with networking, and seems a rather random thing to say.

The operating environment is a qemu virtual machine, UEFI x86_64: OVMF_CODE_4M.fd.

I'm going to give up on this. It was in the nature of an experiment, and while I'm curious to find out, I'm OK to live with a single OS on my target device (for which this was a practice).

Last edited by adrian_stephens; 05-06-2022 at 11:19 AM.
 
Old 05-06-2022, 01:08 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
Quote:
I normally run my own simple boot manager, which is a grub menu that sets root and then jumps to the grub.cfg configfile of the selected os.
This won't work with default install of fedora. IMHO fedora has made grub more complicated with what is BLSCFG.

https://fedoraproject.org/wiki/Chang...rSpecByDefault

The work around is have this line in /etc/default/grub/
Code:
GRUB_ENABLE_BLSCFG=false
and then run
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
The downside is on kernel updates grub2-mkconfig isn't run, instead adds a new /boot/loader/entries/config-file entry for the new kernel for use in with BLSCFG to update the grub menu. Therefore grub2-mkconfig will need to be run with kernel updates to update the grub menu for the new kernel

The other option is to create a chainloader entry to chainload fedora grubx64.efi

Last edited by colorpurple21859; 05-06-2022 at 04:17 PM.
 
Old 05-07-2022, 12:52 AM   #7
adrian_stephens
Member
 
Registered: Apr 2005
Location: Cambridge, UK
Distribution: KDE Neon, Proxmox
Posts: 37

Original Poster
Blog Entries: 2

Rep: Reputation: 1
Quote:
Originally Posted by colorpurple21859 View Post
This won't work with default install of fedora. IMHO fedora has made grub more complicated with what is BLSCFG.

...
The other option is to create a chainloader entry to chainload fedora grubx64.efi
I agree. I turn off BLSCFG in my Fedora installs, which you can do in /etc/default/grub.
I hadn't thought of grub chainloading the other installation's efi file. Thanks for that idea.
 
  


Reply



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
btrfs filesystem df /mnt/btrfs/ shows bothe data and metdata with raid1 and single. gonus Linux - Software 3 07-17-2014 02:48 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
LXer: Rollback To A Working State With btrfs + apt-btrfs-snapshot On Ubuntu 12.10 LXer Syndicated Linux News 0 11-25-2012 10:42 AM
ext4 vs btrfs, and with btrfs do I still need to use LVM? blue_k Linux - Software 4 08-17-2012 11:31 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:21 AM.

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