zfsonlinux / pkg-zfs

Native ZFS packaging for Debian and Ubuntu
https://launchpad.net/~zfs-native/+archive/daily
308 stars 55 forks source link

initramfs script "zfs" tries to mount datasets other than filesystems #156

Closed kidmin closed 9 years ago

kidmin commented 9 years ago

The initramfs script "zfs" provided by zfs-initramfs 0.6.4-1.1-1 on Debian Jessie (8.0) tries to mount datasets other than filesystems (i.e. snapshots, volumes). It results in mount failure and dropping me into initramfs shell prompt on boot.

Mount failures occur on boot if at least one of the followings exists in the root pool:

The script "zfs" is packed into initramfs from /usr/share/initramfs-tools/scripts/zfs.

I think the script should try to mount only filesystems. I propose this patch as a solution of this bug, to enumerate only filesystems explicitly:

@@ -628,7 +628,7 @@

    # Go through the complete list (recursivly) on all filesystems below
    # the real root dataset
-   filesystems=$(zfs list -o name -H -r $ZFS_BOOTFS_ORIG)
+   filesystems=$(zfs list -t filesystem -o name -H -r $ZFS_BOOTFS_ORIG)
    for fs in $filesystems $ZFS_INITRD_ADDITIONAL_DATASETS
    do
        mount_fs $fs
FransUrbo commented 9 years ago

Looks good, thanx for the discovery and the fix! New packages should be available in the repo "shortly".