/usr/lib/systemd/system-shutdown/umountCrypt.service
[Unit]
Description=/etc/rc.local.shutdown Compatibility
After=rc-local.service
[Service]
Type=oneshot
ExecStart=/etc/rc.local.shutdown
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=shutdown.target
Also=rc-local.service
/usr/lib/systemd/system-shutdown/umountCrypt.bash
#!/bin/bash
umount /var
umount /home
umount /media/WDDIsk
The latter file was automatically deleted. Also note that /etc/rc.local.shutdown looks the same as the above script.
I've also done some searching and other users have similar problems, but with cifs. Unfortunately the solutions in their posts did not work for me.
Can anyone help?
]]>Edit: I reread your post, hunterthomson, and I'm looking into unmounting /dev/mapper/home before the cryptdevice is deactivated. Will report back.
]]>Then again, I don't even have a /etc/systemd/service/ directory...
]]>When I booted again, I ran sudo journalctl, and this time there were no errors but also nothing about the encrypted volumes being deactivated or unmounted. Is this normal or are the error messages possibly not getting logged?
]]>The reason the journal is being replayed is becuase the filesystem is not being shutdown correctly.
It looks like the systemd-cryptsetup UNIT file is not correctly unmouting the encrypted partition. Becuase the journal is being replayed we know the filesystem is not being umounted correctly.... it looks like the systemd-cryptsetup UNIT file trying umount the encrypted partition Before the filesystem is umounted, and that is way it is failing. You would not have the journal being replayed even if the /home filesystem was umounted after the systemd-cryptsetup UNIT file. So, we know that at no point on shutdown dose anything umount the /home filesystem. So, it is not a problem with things running out of order. It is a problem that the /home filesystem is just not being umounted at all.
I need to know more about your setup to tell you exactly what you need to do. However, you need to change the way things are setup, so /home is unmounted before the systemd-cryptsetup UNIT file tries to umount the encrypted parition.
I am farly sure that systemd umounts filesystems, so look into how it dose that and configure it to umount /home.
]]>Edit: When I shut down I got 4 beeps (I think) and this is the message in journalctl for each partition:
Failed to deactivate: Invalid argument
systemd-cryptsetup@home.service control process exited, code=exited status=1
Unit systemd-cryptsetup@home.service entered a failed state
Thank you.
]]>