grub booting btrfs on lvm gives "error: no server is specified"
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.