Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Proper order of unmount for zfs partition / dmcrypt
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
uint
n00b
n00b


Joined: 02 Dec 2024
Posts: 1

PostPosted: Wed Dec 18, 2024 7:35 am    Post subject: Proper order of unmount for zfs partition / dmcrypt Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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