rwpenney / cryptmount

Simplified management of Linux encrypted filesystems
https://cryptmount.sourceforge.net
GNU General Public License v2.0
8 stars 0 forks source link

cryptmount left in bad state if umount used #2

Open wgunruh opened 3 months ago

wgunruh commented 3 months ago

Linux Mageia 9 (but this has been there for many years by now) I have a cryptmount file, -- letc call it unruhmail, which is mounted on ~unruh/mail. Occasionally I get forgetful and do umount ~unruh/mail This seems to leave cryptmount in a bad situation for which it seems the only solution is a reboot. If I do df it indicates that ~unruh/mail is mounted from /dev/mapper/unruhmail, but the contents are not there in ~unruh/mail, as it it is not mounted. If I thendo cryptmount -u unruhmail it tells me unruhmail is not mounted . If I do cryptmount unruhmail, it tells me it is already mounted (and /dev/mapper/unruhmail still exits). So I can neither mount or unmount that encrypted partition. The only way out seems to be to reboot, which is a minor disaster as this is central server serving a number of other machines. Is there some way of getting out of this mess without rebooting? I know that not using umount on a cryptmounted file is one answer, but since I persist in occasionally doing that, that is not a useful answer.

rwpenney commented 3 months ago

I agree it's not ideal to use (ordinary) umount if you've previously mounted a filesystem using cryptmount, and that a system reboot is best avoided. There are a few options that may be worth trying, in order of increasing risk of collateral damage: