Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZFS system: grub-mkconfig is misidentifying my root dataset
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10654
Location: Somewhere over Atlanta, Georgia

PostPosted: Sun Jun 23, 2024 8:54 pm    Post subject: ZFS system: grub-mkconfig is misidentifying my root dataset Reply with quote

I loosely followed Ali3nx's Installing Gentoo Linux EFISTUB On ZFS during a storage upgrade on my main home server and have had a working ZFS root "partition" since around Christmas. The vital statistics of my zpool and datasets are:
Code:
ceres ~ # zpool status
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0B in 02:14:12 with 0 errors on Wed Apr 24 10:45:01 2024
config:

        NAME                              STATE     READ WRITE CKSUM
        rpool                             ONLINE       0     0     0
          raidz2-0                        ONLINE       0     0     0
            scsi-2b1ea01f100d00000-part4  ONLINE       0     0     0
            scsi-2b1ea513300d00000-part4  ONLINE       0     0     0
            scsi-2b1eaa12700d00000-part4  ONLINE       0     0     0
            scsi-2b1fa01e700d00000-part4  ONLINE       0     0     0

errors: No known data errors
ceres ~ # zfs list
NAME                 USED  AVAIL  REFER  MOUNTPOINT
rpool               1.20T  12.7T   140K  none
rpool/ROOT          1.18T  12.7T   140K  none
rpool/ROOT/gentoo   1.18T  12.7T  1.18T  none
rpool/home          27.0G  12.7T   140K  none
rpool/home/jgraham  27.0G  12.7T  27.0G  none
rpool/usr            140K  12.7T   140K  none
rpool/var            279K  12.7T   140K  none
rpool/var/lib        140K  12.7T   140K  none
ceres ~ # mount | grep 'on / '
rpool/ROOT/gentoo on / type zfs (rw,relatime,xattr,posixacl,casesensitive)

The issue I'm having is that grub-mkconfig has begun to misbehave. The correct kernel command line parameter to mount my root dataset would be
    root=ZFS=rpool/ROOT/gentoo
but what grub-mkconfig is coming up with is
    root=ZFS=/ROOT/gentoo
Has anyone else seen this issue? And, yes, I know I could plug the right parameter into GRUB_CMDLINE_LINUX in /etc/default/grub, whcih is what I've just done, but I'd prefer a solution over a Band-Aid. I'm about to research upstream bugs & then perhaps file one.

The usual demographic data are:
  • It's a genkernel "kitchen sink" kernel. Config file shouldn't matter, but it's here.
  • /etc/genkernel.conf is here.
  • emerge --info is here.
  • /etc/default/grub is here.
  • And grub is built with these USE flags.
(I'm also mad at myself because I first encountered this sometime in the spring and apparently manually patched /boot/grub/grub.cfg and went on about my business—and forgot about the whole thing—so, the next time I upgraded my kernel, well, you know.)

Thanks in advance for the help.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20476

PostPosted: Mon Jun 24, 2024 1:01 am    Post subject: Reply with quote

Maybe this bug?

https://wiki.archlinux.org/title/Install_Arch_Linux_on_ZFS#bug:_broken_root_pool_detection

https://github.com/zfsonlinux/grub/issues/22
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10654
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Jun 24, 2024 2:57 am    Post subject: Reply with quote

Yep, looks like. Thanks!

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10654
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Jun 26, 2024 4:31 pm    Post subject: Reply with quote

Looks like that bug was being shepherded by Cardoe, but died on the vine due to lack of timely response to questions from upstream, perhaps due to his Gentoo retirement. I'm going to try to pick this up.

There's an ebuild up on my JRG overlay (sys-boot/grub-2.12_p1-r4) that contains a provisional fix.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.


Last edited by John R. Graham on Mon Jul 01, 2024 5:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10654
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Jul 01, 2024 2:55 am    Post subject: Reply with quote

sys-boot/grub-9999 doesn't exhibit the problem. I'm going to cherry pick the fix and propose it as a patch to the current stable grub.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5937

PostPosted: Mon Jul 01, 2024 6:08 am    Post subject: Reply with quote

Do you really need grub? You can skip it if you don't...

Code:

 # efibootmgr -u
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0002
Boot0002* Gentoo 6.6.21 HD(1,GPT,ee8810e7-f787-4987-a78a-3f4741f7007e,0x800,0x200000)/File(\gentoo\kernel-6.6.21-gentoo.efi)root=ZFS=r-pool/r-root usbcore.autosuspend=-1 delayacct
Boot0003* Gentoo 6.6.30 HD(1,GPT,ee8810e7-f787-4987-a78a-3f4741f7007e,0x800,0x200000)/File(\gentoo\kernel-6.6.30-gentoo.efi)root=ZFS=r-pool/r-root usbcore.autosuspend=-1 delayacct


Cheers
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10654
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Jul 01, 2024 11:43 am    Post subject: Reply with quote

Alas, two of the three machines I'm currently managing are legacy boot only...and I like grub. I also like consistency between installs, where I can arrange it.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum