patch for finding zfs, solves: cryptsetup: WARNING: Couldn't determine root device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cryptsetup (Debian) |
New
|
Unknown
|
|||
cryptsetup (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hi there,
There is a missing functionality in the following file: /usr/share/
resulting in the following error message:
cryptsetup: ERROR: Couldn't resolve device <zfs-mountpoint>
cryptsetup: WARNING: Couldn't determine root device
under the following condition:
update-initramfs -c -k all
when:
trying to resolve for encrypted zfs devices
so here is a patch to solve it, based off
Package: cryptsetup-
Version: 2:2.1.0-1ubuntu1
diff -Naur a/usr/share/
--- a/usr/share/
+++ b/usr/share/
@@ -72,19 +72,28 @@
# take the last mountpoint if used several times (shadowed)
unset -v devnos
- resolve_device "$spec" || continue # resolve_device() already warns on error
- if [ "$fstype" = "btrfs" ]; then
- # btrfs can span over multiple devices
- if uuid="$(device_uuid "$DEV")"; then
- for dev in "/sys/fs/
- devnos=
- done
- else
- cryptsetup_message "ERROR: $spec: Couldn't determine UUID"
+ if [ "$fstype" = "zfs" ]; then
+ # zfs can span over multiple devices
+ for dev in $(zpool status -L -P | grep -o "/dev/[^ ]*"); do
+ MAJ="$(printf "%d\n" 0x$(stat -L -c"%t" -- "$dev"))"
+ MIN="$(printf "%d\n" 0x$(stat -L -c"%T" -- "$dev"))"
+ devnos=
+ done
+ else
+ resolve_device "$spec" || continue # resolve_device() already warns on error
+ if [ "$fstype" = "btrfs" ]; then
+ # btrfs can span over multiple devices
+ if uuid="$(device_uuid "$DEV")"; then
+ for dev in "/sys/fs/
+ devnos=
+ done
+ else
+ cryptsetup_message "ERROR: $spec: Couldn't determine UUID"
+ fi
+ elif [ -n "$fstype" ]; then
+ devnos="$MAJ:$MIN"
fi
- elif [ -n "$fstype" ]; then
- devnos="$MAJ:$MIN"
fi
fi
done </proc/mounts
Which works, I have tested it. However by solving this error message, the script can now continue further. And it then prints out some new messages that should not be there either. Unfortunately I could not track down the source of those subsequent warnings!
They say:
# update-initramfs -c -k all
update-initramfs: Generating /boot/initrd.
cryptsetup: WARNING: crypt_rpool1: ignoring unknown option 'nofail'
cryptsetup: WARNING: crypt_rpool1: ignoring unknown option
'x-
So clearly there is something which does not recognize the fstab mounting options of:
'nofail'
and
'x-systemd.
However those options are indeed valid, and were found to have a working effect. They were tested also. So the warning is something else, somewhere else. And I cannot grep it. Cannot google it. Nothing happening in strace. It is pretty mysterious, as to where it is come from. Mysterious messages!
Anyhow please take the first patch if you can. Or use those lines to make your own version to improve as you please.
Related branches
- Guilherme G. Piccoli (community): Approve
- git-ubuntu developers: Pending requested
-
Diff: 2287 lines (+1775/-33)11 files modifieddebian/changelog (+1603/-0)
debian/control (+4/-3)
debian/cryptsetup-initramfs.install (+1/-0)
debian/functions (+11/-1)
debian/initramfs/cryptroot-unlock (+12/-6)
debian/initramfs/hooks/cryptroot (+5/-3)
debian/initramfs/scripts/local-block/cryptroot (+4/-0)
debian/initramfs/scripts/local-bottom/cryptroot (+23/-0)
debian/initramfs/scripts/local-top/cryptroot (+56/-20)
debian/patches/decrease_memlock_ulimit.patch (+55/-0)
debian/patches/series (+1/-0)
Changed in cryptsetup (Debian): | |
importance: | Undecided → Unknown |
status: | New → Unknown |
Changed in cryptsetup (Debian): | |
status: | Unknown → New |
Oh sorry. Didn't upload the patch correctly (as an attachment). Here it is then...