GNU GRUB - Bugs: bug #59614, grub-mkconfig on ZFS root result...
You are not allowed to post comments on this tracker with your current authentication level.
bug #59614: grub-mkconfig on ZFS root result has invalid root=ZFS= value
Submitter: | Todd Markley <csleuth7> | ||
Submitted: | Thu 03 Dec 2020 08:55:13 PM UTC | ||
Category: | Configuration | Severity: | Major |
Priority: | 5 - Normal | Item Group: | Software Error |
Status: | None | Privacy: | Public |
Assigned to: | None | Originator Name: | Todd |
Open/Closed: | Open | Release: | other |
Release: | Reproducibility: | Every Time | |
Planned Release: | None |
Tue 12 Jan 2021 07:54:02 AM UTC, comment #5: |
Ivan Volosyuk <ivanrt> |
Tue 12 Jan 2021 07:43:29 AM UTC, comment #4: I hit the same issue after migrating to ZFS 2.0.0
In my debugging I noticed that "grub-probe --device ${GRUB_DEVICE} --target=fs_label" reports "unknown filesystem".
$ debug=all grub-probe -v /
The failure happens at grub-core/fs/zfs/zfs.c:
Looks like my root pool contains zfs features unsupported by grub. Strictly speaking, this is irrelevant for grub as my /boot is on a separate fat32 partition for efi64 boot method. There is no need to perform full compatibility checks just to output fs_label and construct root=ZFS=rpool/ROOT kernel argument.
I would say for /boot 'bpool' strict checks are need to be able to load kernel at boot time, but for / 'rpool' which is only used by the loaded kernel the compatibility checks can be omitted.
|
Ivan Volosyuk <ivanrt> |
Fri 18 Dec 2020 02:33:45 AM UTC, comment #3: I submitted https://lists.gnu.org/archive/html/grub-devel/2020-12/msg00239.html to the mailing list which should fix your issue as well. |
Doug Goldstein <cardoe> |
Wed 16 Dec 2020 05:03:45 AM UTC, comment #2: Looking at other items in the tracker I believe this is the same issue as bug #58555. |
Doug Goldstein <cardoe> |
Wed 16 Dec 2020 05:00:25 AM UTC, comment #1: I believe the issue is with grub-probe not supporting the filesystem features that Ubuntu is using. You can see it mentioned in the OpenZFS Ubuntu 20.04 Guide under Step 2 Item 7.
I think there should be a cleaner approach that always uses zfs instead of grub-probe for best compatibility. Just like 10_linux_zfs does. |
Doug Goldstein <cardoe> |
Thu 03 Dec 2020 08:55:13 PM UTC, original submission:
This problem was identified using Ubuntu 20.04.1 and selecting the ZFS root option during installation. The grub version is 2.04-1ubuntu26.7
Installation will boot, but after any install or upgrade that requires touching the grub configuration the resulting grub.cfg has an invalid root=ZFS=/ROOT/ubuntu_xxxxxx value which is missing the zpool name, the correct value should look like this:
The root cause seems to be in these two files:
Which contain a line that sets the value of ${rpool} like this:
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
This is setting ${rpool} to NULL since the grub-probe fails:
Since this rpool= line should only be run when the root filesystem is ZFS, I would expect this will always fail on every system with a ZFS root.
This is my hack test fix, (applied to both files):
------------------------------
------------------------------
This test resolved the problem and worked on my three test systems:
Although this worked, I expect a better fix would just change the rpool=`` line with a command that works. My example fix assumed Ubuntu 20.04 was installed with ZFS, and I did not consider any other configurations. I don't expect details about my hardware would affect this issue, but two used ASRock+AMD and the 3rd was an old Lenovo laptop.
|
Todd Markley <csleuth7> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 5 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-12-09 | _227766 | Carbon-Copy | - | ![]() |
Added oxygen_cat |
2020-12-09 | _227766 | Carbon-Copy | Removed -email is unavailable- | ![]() |
- |
2020-12-09 | _227766 | Carbon-Copy | - | ![]() |
Added -email is unavailable- |
2020-12-03 | csleuth7 | Attached File | - | ![]() |
Added grub2.patch, #50395 |
2020-12-03 | csleuth7 | Attached File | - | ![]() |
Added grub-mkconfig.log, #50393 |
I didn't notice the proposed fix. I checked that it works for me. Works even for the pool backed by multiple physical devices.