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

cryptmount left in bad state if umount used #2

Open
wgunruh opened this issue Aug 2, 2024 · 1 comment
Open

cryptmount left in bad state if umount used #2

wgunruh opened this issue Aug 2, 2024 · 1 comment

Comments

@wgunruh
Copy link

wgunruh commented Aug 2, 2024

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
Copy link
Owner

rwpenney commented Aug 3, 2024

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:

  • Remount /dev/mapper/unruhmail onto ~/unruh/mail and then use cryptmount -u unruhmail as normal.
  • Run sudo cryptmount --release unruhmail to tidy-up the /dev/mapper artefacts, then try cryptmount unruhmail as usual.
  • If you have no other cryptmount-managed filesystems active, you could use sudo cryptmount --safetynet to tidy-up any /dev/mapper and other runtime artefacts managed by cryptmount.
  • Unmount (using cryptmount -u all other cryptmount-managed filesystems, run sudo cryptmount --release unruhmail and then delete /run/cryptmount.status, Before running cryptmount some_target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants