Build failure when ZFS support is enabled

Bug #1321335 reported by RJVB
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I downloaded the GRUB2 sources from Launchpad, version 2.02~beta2-9 for "Trusty", in order to understand why grub-probe would not deal correctly with ZFS pools.

It turns out that even the original source, without the Ubuntu patches, fails to build when libzfs is present (and/or --enable-zfs is used) because the zfs libraries are missing from the grub-ofpathname utility's link command.

Consequently, I think that the grub-probe error I reported in the linked question is due to missing ZFS support in the binary GRUB2 packages distributed via Launchpad.

After correcting Makefile.util.def, everything builds OK and grub-probe correctly reports that ZFS pools are of type zfs .

A patchfile for the correction is attached, and an upstream bug report created (https://savannah.gnu.org/bugs/index.php?42392).

I'm currently building an updated set of Ubuntu/Debian packages; I'll modify this ticket (or file a new one) if there are additional issues booting off a ZFS root.

Tags: patch
Revision history for this message
RJVB (rjvbertin) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch for Makefile.util.def" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
RJVB (rjvbertin) wrote :
Download full text (3.3 KiB)

Of course it's a patch :)

Here's an update:

Even with the posted patch that allows the build to succeed, not all FS tests succeed, in particular zfs_test. It fails with a TIME_FAIL error (which is probably benign as it appears to concern a subsecond difference).

I thus had to disable the build checks in order to be able to build my .deb packages.

Worse, update-grub2 will not generate a proper grub.cfg for ZFS roots:

{{{
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b927688a3f8a6e13' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod btrfs
set root='hd2,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos4 --hint-efi=hd2,msdos4 --hint-baremetal=ahci2,msdos4 2def3c9f-2a12-41e0-911f-7de7cc142a99
else
search --no-floppy --fs-uuid --set=root 2def3c9f-2a12-41e0-911f-7de7cc142a99
fi
linux /vmlinuz-3.13.9-ck1-kubuntu-ck-amdf10-rjvb root=ZFS=zPatux/ ro
initrd /initrd.img-3.13.9-ck1-kubuntu-ck-amdf10-rjvb
}
}}}
In other words, the required zfs modules are not loaded, and the kernel isn't informed about the fact it's booting off ZFS. A more correct entry should read:
{{{
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b927688a3f8a6e13' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod zfsinfo
zfs-bootfs ($root) bootfs
insmod part_msdos
insmod btrfs
set root='hd2,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos4 --hint-efi=hd2,msdos4 --hint-baremetal=ahci2,msdos4 2def3c9f-2a12-41e0-911f-7de7cc142a99
else
search --no-floppy --fs-uuid --set=root 2def3c9f-2a12-41e0-911f-7de7cc142a99
fi
linux /vmlinuz-3.13.9-ck1-kubuntu-ck-amdf10-rjvb root=ZFS=zPatux/ ro boot=zfs $bootfs
initrd /initrd.img-3.13.9-ck1-kubuntu-ck-amdf10-rjvb
}
}}}
but even that gives an "invalid label" error upon boot and then tries to import the default pool name, rpool, instead of the right one.
For reference, here's a menuentry from a different system (using the exact same kernel) which boots OK:
{{{
menuentry 'LinuxMint GNU/Linux' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7c11ad880751a42a' {
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod zfsinfo
zfs-bootfs ($root) bootfs
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 39ff79e1-e153-490f-b302-4ba8e71fe643
else
search --no-floppy --fs-uuid --set=root 39ff79e1-e153-490f-b302-4ba8e71fe643
fi
linux /vmlinuz-3.13.9-ck1-kubuntu-ck-amdf10-rjvb root=ZFS=Patux/ ro boot=zfs $bootfs
initrd /initrd.img-3.13.9-ck1-kubuntu-ck-amdf10-rjvb
}
}}}

And finally, even when I import the right pool at the GRUB prompt and get the boot process to continue, it will halt (freeze, block) during the initial systemd run, typically during or just after mounting the in...

Read more...

Revision history for this message
RJVB (rjvbertin) wrote :

That last, freezing issue seems to be related to the use of the bcmwl broadcom STA driver. After purging that one and thus switching to the brcmsmac driver, the boot process proceeds normally. After importing the correct pool manually, that is.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
RJVB (rjvbertin) wrote :

Now that the bug is confirmed to affect multiple users, allow me to post the work-around I found, in hopes it will help address the issue.

I have installed grub-pc, grub-pc-bin, grub-common, grub2-common version 2.01-22debian1+zfs3-0.6.3-2~wheezy and zfs-initramfs version 0.6.3-0.27~21b446~wheezy, all downloaded manually from the zfsonlinux debian repository, and marked as held (apt-mark hold grub-pc ...).
In addition, I added zfsforce=1 to GRUB_CMDLINE_LINUX in /etc/default/grub (I haven't checked if that's still required after the upgrade to zfs 0.6.3).

Finally, if one uses the root dataset (the one with the pool's name) for the root filesystem instead of a child dataset, one has to remove the trailing slash from the pool name after each update-grub. That's a confirmed issue @ZoL, one for which I do not know if a decision has been made yet.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.