Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encrypted dataset: dracut pre-mount hook: cannot open '-': dataset does not exist #11800

Closed
denizzzka opened this issue Mar 25, 2021 · 6 comments
Labels
Status: Triage Needed New issue which needs to be triaged Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@denizzzka
Copy link

I created encrypted dataset on rpool and init isn't promts me to enter password for it while booting

Dataset name:
rpool/ROOT/mnt_cryptfs

its mountpoint is:
/mnt/cryptfs

Boot console output:

мар 26 01:24:06 denpc systemd[1]: Starting dracut pre-mount hook...
мар 26 01:24:06 denpc dracut-pre-mount[2876]: cannot open '-': dataset does not exist
мар 26 01:24:06 denpc systemd[1]: Finished dracut pre-mount hook.
мар 26 01:24:08 denpc systemd[1]: dracut-pre-mount.service: Succeeded.

Also I tried to replace dracut by initramfs and it also isn't tries to ask me for password but not returns any errors

System information

Type Version/Name
Distribution Name Debian
Distribution Version sid
Linux Kernel Linux denpc 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) x86_64 GNU/Linux
Architecture x86_64
ZFS Version zfs-2.0.3-1 zfs-kmod-2.0.3-1
SPL Version 2.0.3-1
@denizzzka denizzzka added Status: Triage Needed New issue which needs to be triaged Type: Defect Incorrect behavior (e.g. crash, hang) labels Mar 25, 2021
@denizzzka
Copy link
Author

Tried to rename dataset by removing underscore symbol (rpool/ROOT/mntcryptfs) - is not helps

Packages versions:

ii  libzfs2linux                                                0.8.6-1                                                       amd64        OpenZFS filesystem library for Linux
ii  libzfs4linux                                                2.0.3-1                                                       amd64        OpenZFS filesystem library for Linux
ii  zfs-dkms                                                    2.0.3-1                                                       all          OpenZFS filesystem kernel modules for Linux
ii  zfs-dracut                                                  2.0.3-1                                                       all          OpenZFS root filesystem capabilities for Linux - dracut
ii  zfs-zed                                                     0.8.4-2                                                       amd64        OpenZFS Event Daemon
ii  zfsutils-linux                                              2.0.3-1                                                       amd64        command-line tools to manage OpenZFS filesystems

@denizzzka
Copy link
Author

zfs-zed was updated to 2.0.3-1, nothing has changed

@denizzzka
Copy link
Author

denizzzka commented Mar 26, 2021

Found what I have non-encrypted ZVOL dataset with "mountpoint" '-':

denizzz@denpc ~> sudo zfs list rpool/swap_luks
NAME              USED  AVAIL     REFER  MOUNTPOINT
rpool/swap_luks  16.7G  33.5G     8.17G  -

@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented May 23, 2021

What's your boot= cmdline parameter and full output of zfs list -o name,mountpoint,encryptionroot,keylocation for the root pool?

@denizzzka
Copy link
Author

denizzzka commented May 23, 2021

What's your boot= cmdline parameter

Command line: root=ZFS=rpool/ROOT/debian ro cgroup_enable=memory swapaccount=1 quiet initrd=\EFI\Debian\initrd.img

and full output of zfs list -o name,mountpoint,encryptionroot,keylocation for the root pool?

NAME                                                                                     MOUNTPOINT                                       ENCROOT                                         KEYLOCATION
fast_non-backuped_tank                                                                   /fast_non-backuped_tank                          -                                               none
fast_non-backuped_tank/denizzz                                                           /fast_non-backuped_tank/denizzz                  -                                               none
fast_non-backuped_tank/denizzz/encrypted_stuff                                           /fast_non-backuped_tank/denizzz/encrypted_stuff  fast_non-backuped_tank/denizzz/encrypted_stuff  prompt
fast_non-backuped_tank/multipass_stuff                                                   /fast_non-backuped_tank/multipass_stuff          -                                               none
fast_non-backuped_tank/multipass_stuff/var_multipass                                     /var/snap/multipass                              -                                               none
non-backuped_tank                                                                        /non-backuped_tank                               -                                               none
non-backuped_tank/denizzz                                                                /non-backuped_tank/denizzz                       -                                               none
non-backuped_tank/denizzz/encrypted_stuff                                                /non-backuped_tank/denizzz/encrypted_stuff       non-backuped_tank/denizzz/encrypted_stuff       prompt
non-backuped_tank/denizzz/scrapyard                                                      /non-backuped_tank/denizzz/scrapyard             -                                               none
rpool                                                                                    none                                             -                                               none
rpool/ROOT                                                                               none                                             -                                               none
rpool/ROOT/debian                                                                        /                                                -                                               none
rpool/ROOT/debian/10b9298d6280c37466c6a596d573ebb288ac5cbbdd909b3c5a4e64b19c6efeb0       legacy                                           -                                               none
rpool/ROOT/debian/32053cee45cb209c2a0c21fa5156b86e9102296ae5f430ca645db3b74723a205       legacy                                           -                                               none
rpool/ROOT/debian/32053cee45cb209c2a0c21fa5156b86e9102296ae5f430ca645db3b74723a205-init  legacy                                           -                                               none
rpool/ROOT/debian/56a0fceee1951d73f5a309096f0a7d14a0ace5898dc7cfd3c0923cadb59471ae       legacy                                           -                                               none
rpool/ROOT/debian/56a0fceee1951d73f5a309096f0a7d14a0ace5898dc7cfd3c0923cadb59471ae-init  legacy                                           -                                               none
rpool/ROOT/debian/5802e70991dead02b3b67a691419f1544900ab0fe438e052875a4df90adb0e15       legacy                                           -                                               none
rpool/ROOT/debian/65bfac6ca0c66675a020c1c042f7cfd0aedc2cfe034753f4092b31500300762f       legacy                                           -                                               none
rpool/ROOT/debian/80a74a76e9e44a4ed8db39b6222acbfcc6ab91973c93b1c2c74d310b869a54b5       legacy                                           -                                               none
rpool/ROOT/debian/80ed3608c772dd6e693e8b246500bd9cb817f28f6035aaf29de4821898d9d661       legacy                                           -                                               none
rpool/ROOT/debian/a168140ddf9cca7533e488bda0a14cf081a096ed741151704e3f1dfbe46cd320       legacy                                           -                                               none
rpool/ROOT/debian/ad5f34cca9427ebc66d957a6b1712e8ee9abad84d66ed4942add13e5f7108cce       legacy                                           -                                               none
rpool/ROOT/debian/ad5f34cca9427ebc66d957a6b1712e8ee9abad84d66ed4942add13e5f7108cce-init  legacy                                           -                                               none
rpool/ROOT/debian/c400ab5e31945f107cf9301a6578eb7503e5ad6cd823302f859022200503345a       legacy                                           -                                               none
rpool/ROOT/debian/c400ab5e31945f107cf9301a6578eb7503e5ad6cd823302f859022200503345a-init  legacy                                           -                                               none
rpool/ROOT/debian/d4baa1f1caa3e5ff58ab116dddab43542923bdb40011c1d3bf8593d32e137eed       legacy                                           -                                               none
rpool/ROOT/debian/d4e6b909689cef2ac48b02d050c541c3c1b0bbf2c9b7fb95b9287787b8c9e164       legacy                                           -                                               none
rpool/ROOT/debian/d4e6b909689cef2ac48b02d050c541c3c1b0bbf2c9b7fb95b9287787b8c9e164-init  legacy                                           -                                               none
rpool/ROOT/debian/d77f512677727cb080f42e3607db516dcafc28e260aa7cb226fcb949429b98e2       legacy                                           -                                               none
rpool/ROOT/debian/d77f512677727cb080f42e3607db516dcafc28e260aa7cb226fcb949429b98e2-init  legacy                                           -                                               none
rpool/ROOT/debian/f9bb778668da1ccd3719e4abdc9f11e7833c15f0be6e5ba3bcc7fad212cfde26       legacy                                           -                                               none
rpool/ROOT/mntcryptfs                                                                    /mnt/cryptfs                                     rpool/ROOT/mntcryptfs                           prompt
rpool/ROOT/srv                                                                           /srv                                             rpool/ROOT/srv                                  prompt
rpool/swap_luks                                                                          -                                                -                                               none

nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue May 23, 2021
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue May 23, 2021
@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented May 23, 2021

Hm, yeah. Can you try the second patch off #12108?

If you're on 2.0.3, it's identical to replacing

    # where the key is stored (in a file or loaded via prompt)
    KEYLOCATION=$(zfs get -H -o value keylocation "${ENCRYPTIONROOT}")
    if ! [ "${ENCRYPTIONROOT}" = "-" ]; then
        KEYSTATUS="$(zfs get -H -o value keystatus "${ENCRYPTIONROOT}")"

with

    if ! [ "${ENCRYPTIONROOT}" = "-" ]; then
        KEYLOCATION=$(zfs get -H -o value keylocation "${ENCRYPTIONROOT}")
        KEYSTATUS="$(zfs get -H -o value keystatus "${ENCRYPTIONROOT}")"

in /usr/lib/dracut/modules.d/90zfs/zfs-load-key.sh, so if you could edit that, regenerate, and reboot, you should no longer get the (harmless) error.

nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue May 23, 2021
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Jun 1, 2021
rkitover pushed a commit to rkitover/zfs that referenced this issue Jun 2, 2021
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue Jun 4, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Jun 8, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Jun 8, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needed New issue which needs to be triaged Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

2 participants