View previous topic :: View next topic |
Author |
Message |
uint n00b
Joined: 02 Dec 2024 Posts: 1
|
Posted: Wed Dec 18, 2024 7:35 am Post subject: Proper order of unmount for zfs partition / dmcrypt |
|
|
Hi! I have a setup with two disk partitions encrypted with dmcrypt (LUKS), and over them there's a zfs mirrored pool. I also have OpenRC.
At the system boot, the startup order is correct: first I get prompted for the passphrases of the encrypted partitions, then dmcrypt unlocks them, then zfs imports the pool and mounts the partition to the file system.
However, at shutdown it seems that zfs does not unmount its partition, either in time, or at all. This leads to the shutdown log having dmcrypt complaining that encrypted devices cannot be unmounted (as they are busy). I don't have the log at hand, as this normally happens after the syslog-ng shutdown.
This does not seem to do much harm, but still looks messy, and I'd like to set up the correct shutdown order, where:
- zfs partition is unmounted from the fs
- zfs stops the pool (however it calls this operation)
- dmcrypt stops the underlying encrypted partitions
But I'm not sure how to do that, and specifically what controls the order in which OpenRC stops services.
I tried to set
Code: |
rc_need="dmcrypt"
ZFS_UNMOUNT='yes'
|
in the /etc/conf.d/zfs, and indeed zfs tries to unmount the pool, but looks like it fails because it tries to unmount the pool before the mount point in the file system itself is unmounted. Or something like that happens - I am not 100% sure, and cannot check the logs as there are no logs (only terminal output at shutdown)
Can you suggest the proper way to control the unmount order here? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22835
|
Posted: Wed Dec 18, 2024 12:24 pm Post subject: |
|
|
Welcome to the forums.
Could you provide a bit more information about the environment? Specifically, is the affected ZFS for critical filesystems like /, for non-critical filesystems like /home, or both? Is the passphrase prompt at boot handled by the initramfs or by the Gentoo dmcrypt initscript? Can you show us /etc/fstab and the output of grep '^[^#]' /etc/conf.d/dmcrypt (non-blank non-comment lines, since there are a lot of stock comments we don't need here)? Mask out any serial numbers or similar if you like. I only want to see how many devices are in use, and their device-mapper names once unlocked. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|