[Pkg-zfsonlinux-devel] Bug#1099001: zfs-initramfs: Root pool not recognized/imported at boot

Troy Telford ttelford.groups at gmail.com
Sun Jun 22 06:34:33 BST 2025


I realize it’s been a while since you’ve responded, but, better late than never:

> On May 2, 2025, at 1:55 AM, Shengqi Chen <harry at debian.org> wrote:
> 
> Hi,
> 
>> For what it's worth, my kernel (grub) commandline is:
>> /BOOT/debian@/vmlinuz-6.12.16-amd64 root=ZFS=/ROOT/debian
> 
> This seems to be the problem. It should be root=ZFS=rootpool/ROOT/debian
> in your case. This is due to grub uses its own zfs implementation with limited
> feature sets (and often with bugs [1][2]). It would refuse to probe your root dev
> in its grub-mkconfig stage if some of your pool features make it unhappy.

Interestingly enough, it appears some upgrade of grub changed the command line? The ‘backup’ file in /boot/grub/grub.cfg that dpkg created during the upgrade actually has the correct command line - but the one that was (apparently?) modified by dpkg removed all of the root pool references. (It renamed the old file to /boot/grub/grub-cfg)

> You could try the following in order to fix your booting process:
> 
> 1. Upgrade to grub 2.12 in bookworm-backports, and if not working,

I’m running `sid`; bookworm-back ports is a downgrade! I’ve had 2.12 since Tue Sep 12 10:53:21 2023 (according to etckeeper’s history). Oddly enough, that seems to line up fairly well with when /boot/grub/grub.cfg was copied to /boot/grub/grub-cfg. (I may have set apt-get to upgrade, and left it overnight - and had to come back and answer questions the next day).

> 2. Hardcode root=ZFS=... options in /etc/default/grub

 When I looked through my grub configuration, I can’t find any reference to my root partition anywhere in /etc.

From that, I’m left thinking the root pool is autodetected

 When I look at /etc/grub.d/10_linux:

    rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
    bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
    LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}”


Nevertheless, after hardcoding it in, It does get padded to the /end/ and is active.

    linux   /BOOT/debian@/vmlinuz-6.12.30-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rootpool/ROOT/debian ro …

> 
> Also, if possible, you can use a separate boot pool with compatibility=grub2 set, or
> a /boot partition with other filesystems like ext4. This could totally get rid of
> grub’s zfs driver at boot time, but you still need to take care of the erroneous 
> kernel cmdline.

I’ve always had a boot pool, but it didn’t have a `zpool set compatibility=grub2 boot pool` set until now.

> 
>> Try: `zpool import -N; zpool import <poolname> -R /root`
>> ... and maybe a shortened URL to help the poor sod who ever sees the
>> message.
> 
> Great! Actually it took me a while to learn it should be /root when I was hit by
> the same issue some time ago. The hint in initrd stage comes from [3], you could
> submit a PR to upstream if you want (and I’m happy to do that also).
> 
> [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848945
> [2]: https://github.com/openzfs/zfs/issues/13873
> [3]: https://github.com/openzfs/zfs/blob/27f3d94940490d891c70e0c148f80d0c0ce09ed4/contrib/initramfs/scripts/zfs#L901-L911
> 
> Thanks,
> Shengqi Chen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20250621/4c26e120/attachment.htm>


More information about the Pkg-zfsonlinux-devel mailing list