← Back to team overview

kernel-packages team mailing list archive

[Bug 1577057] Re: zfs initrd script fails when rootdelay boot option is set

 

This bug was fixed in the package zfs-linux - 0.6.5.7-0ubuntu2

---------------
zfs-linux (0.6.5.7-0ubuntu2) yakkety; urgency=medium

  * Minor changes to satisfy MIR request (LP: #1579082)
    [ Richard Laager ]
    - zfs-zed: Version "Replaces: zfsutils-linux" and add versioned
     "Breaks: zfsutils-linux"
    - explicitly specify the man pages so we don't include zed.8
    [ Colin Ian King ]
    - remove root ALL=(ALL) ALL and R_ROOT from
      debian/tree/zfsutils-linux/etc/sudoers.d/zfs. The R_ROOT serves
      no useful purpose, complicates people actually using the sudoers
      file, and pollutes the global namespace
    - add init.d linitan overrides for zfsutils-linux and zfs-zed
      as initscripts will never be used and we will rebase with the
      Debian package initscripts once the package gets accepted by Debian
  [ Richard Laager ]
  * zfs-initramfs: When rootdelay is set, retry the `zpool export` command
    until it stops returning "is busy" (or the rootdelay expires).
    (LP: #1577057)

 -- Colin Ian King <colin.king@xxxxxxxxxxxxx>  Thu, 26 May 2016 15:28:13
+0100

** Changed in: zfs-linux (Ubuntu)
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to zfs-linux in Ubuntu.
https://bugs.launchpad.net/bugs/1577057

Title:
  zfs initrd script fails when rootdelay boot option is set

Status in zfs-linux package in Ubuntu:
  Fix Released

Bug description:
  It looks like that, when booting off zfs (zfs holds /boot) with the
  rootdelay boot option set, the boot process fails in the initrd fase,
  asking to manually import the pool using zpool import -f -R / -N. I
  only had one system with that parameter set, which I seldom reboot.

  I did not find an upstream reference of this bug or behavior.

  The error is caused by the fact the pool is already imported: "zpool
  status" executed on the initramfs prompt will correctly list the pool
  and all devices online. To continue, one has to export the pool, re-
  import it and exit the initramfs prompt after which regular booting
  continues. Not exporting and reimporting it leaves the pool readonly
  leading to boot errors further down the road (systemd units failing).

  I noticed zfs_autoimport_disable is set to 1 in the initramfs
  environment, so looking at /usr/share/initramfs-tools/scripts/zfs this
  section might be the issue (zpool import succeeding, but $ZFS_HEALTH
  never returning with the correct status (I'm not a programmer but
  perhaps ZFS_HEALTH is a local variable in the zfs_test_import
  function)):

   delay=${ROOTDELAY:-0}

   if [ "$delay" -gt 0 ]
   then
    # Try to import the pool read-only.  If it does not import with
    # the ONLINE status, wait and try again.  The pool could be
    # DEGRADED because a drive is really missing, or it might just
    # be slow to be detected.
    zfs_test_import
    retry_nr=0
    while [ "$retry_nr" -lt "$delay" ] && [ "$ZFS_HEALTH" != "ONLINE" ]
    do
     [ "$quiet" != "y" ] && log_begin_msg "Retrying ZFS read-only import"
     /bin/sleep 1
     zfs_test_import
     retry_nr=$(( $retry_nr + 1 ))
     [ "$quiet" != "y" ] && log_end_msg
    done
    unset retry_nr
    unset ZFS_HEALTH
   fi
   unset delay

  
  Edit: to be clear: I removed the rootdelay parameter, regenerated the initrd, and was able to boot successfully afterwards.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1577057/+subscriptions