Open jinnko opened 6 years ago
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.
This is still a valid issue on Debian Stretch kernel 4.9.0-13 with OpenZFS 0.7.12-2:
$ modinfo zfs
filename: /lib/modules/4.9.0-13-amd64/updates/dkms/zfs.ko
version: 0.7.12-2+deb10u1~bpo9+1
license: CDDL
author: OpenZFS on Linux
description: ZFS
srcversion: A6D1B0339439B948E6BF693
...
To make some progress, as a first step it would help to have clarification about the TYPE
returned by the blkid
tool with the goal of identifying where the fix should be applied.
If it helps, this is the output of the blkid
tool against the disks:
For an active volume in the pool we get output like this:
# blkid /dev/mapper/luks-zfs1
/dev/mapper/luks-zfs1: LABEL="tank" UUID="9389091757882612535" UUID_SUB="9629288558824527693" TYPE="zfs_member"
And for the spare volume we get no output:
# blkid /dev/mapper/luks-zfs5
I would expect the spare to be identified by blkid
as TYPE="zfs_member"
just like any other disk in the pool.
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.
System information
Describe the problem you're observing
Creating a LUKS + ZFS set up with a RAID-1+0 config, plus a spare disk, doesn't boot if the spare is included in the initramfs unlocked volumes. I'm not entirely sure of how to resolve this, so raising this ticket as a starting point.
During boot the initramfs cryptroot script unlocks the disks. When doing this the script then uses
blkid
to determine the "TYPE" of the internal volume. Active disks in the zpool return azfs_member
type, however the spare disk does not return a type, which results in the cryptroot going down a failure path at line 352 and evicting the unlocked device.I believe the correct way to resolve this should be for blkid to return something useful when run against the spare disk, however I'm not sure how blkid determines the "TYPE", and whether that's something rooted in the ZoL code or not.
Describe how to reproduce the problem
The build of this setup is automated and can be done with vagrant to reproduce the results - I have created everything to bootstrap the VMs and can be found at https://github.com/ixydo/vagrant-zfs-on-linux.
Otherwise you can do the following:
Start with a Debian stretch instance. This is likely to be an issue on other distros but I haven't tested that.
Create a zpool with a pair of mirrors like this:
Ensure all all volumes are in the list of volumes to be unlocked at boot by checking for the
initramfs
option in/etc/crypttab
:initramfs
option from the spare disk config in/etc/crypttab
will result in a successful boot, but the spare will beUNAVAIL
.Include any warning/errors/backtraces from the system logs
At boot the system drops to a shell in the initramfs and the only message it emits is the following: