Cryptsetup wants to unmount everything right after booting
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Cryptsetup wants to unmount everything right after booting
I'm running Debian Stretch on a Thinkpad laptop. My /home partition is encrypted and unlocked on boot with a key file loaded from a usb device.
So far everything works but when the boot sequence is done, it seems cryptsetup wants to unmount everything. It succeeds to do that with my SWAP but it fails with /home probably because it's in use.
I have no idea why it wants to do that. Here is an excerpt from my logs. Full logs are here.
Code:
-- L'unité (unit) upower.service a terminé son démarrage, avec le résultat done.
août 19 12:36:32 Thinkpad-machine pkexec[1472]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
août 19 12:36:32 Thinkpad-machine pkexec[1472]: user: Executing command [USER=root] [TTY=unknown] [CWD=/home/user] [COMMAND=/usr/sbin/mate-power-backlight-helper --set-brightness 1958841]
août 19 12:37:02 Thinkpad-machine kernel: usb 6-2: USB disconnect, device number 2
août 19 12:37:02 Thinkpad-machine systemd[1]: Stopped target Encrypted Volumes.
-- Subject: L'unité (unit) cryptsetup.target a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) cryptsetup.target a terminé son arrêt.
août 19 12:37:02 Thinkpad-machine systemd[1]: Stopped target Local File Systems.
-- Subject: L'unité (unit) local-fs.target a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) local-fs.target a terminé son arrêt.
août 19 12:37:02 Thinkpad-machine systemd[1]: Stopped target Swap.
-- Subject: L'unité (unit) swap.target a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) swap.target a terminé son arrêt.
août 19 12:37:02 Thinkpad-machine systemd[1]: Stopping Cryptography Setup for sda2_crypt...
-- Subject: L'unité (unit) systemd-cryptsetup@sda2_crypt.service a commencé à s'arrêter
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) systemd-cryptsetup@sda2_crypt.service a commencé à s'arrêter.
août 19 12:37:02 Thinkpad-machine systemd[1]: Deactivating swap /home/swapfile...
-- Subject: L'unité (unit) home-swapfile.swap a commencé à s'arrêter
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) home-swapfile.swap a commencé à s'arrêter.
août 19 12:37:02 Thinkpad-machine systemd[1]: Deactivated swap /home/swapfile.
-- Subject: L'unité (unit) home-swapfile.swap a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) home-swapfile.swap a terminé son arrêt.
août 19 12:37:02 Thinkpad-machine systemd[1]: Unmounting /home...
-- Subject: L'unité (unit) home.mount a commencé à s'arrêter
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) home.mount a commencé à s'arrêter.
août 19 12:37:02 Thinkpad-machine systemd[1]: home.mount: Mount process exited, code=exited status=32
août 19 12:37:02 Thinkpad-machine systemd[1]: Failed unmounting /home.
-- Subject: L'unité (unit) home.mount a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) home.mount a terminé son arrêt.
août 19 12:37:02 Thinkpad-machine systemd[1]: Stopped File System Check on /dev/mapper/sda2_crypt.
-- Subject: L'unité (unit) systemd-fsck@dev-mapper-sda2_crypt.service a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) systemd-fsck@dev-mapper-sda2_crypt.service a terminé son arrêt.
août 19 12:37:06 Thinkpad-machine systemd-cryptsetup[1651]: Failed to deactivate: Device or resource busy
août 19 12:37:06 Thinkpad-machine systemd[1]: systemd-cryptsetup@sda2_crypt.service: Control process exited, code=exited status=1
août 19 12:37:07 Thinkpad-machine systemd[1]: Stopped Cryptography Setup for sda2_crypt.
-- Subject: L'unité (unit) systemd-cryptsetup@sda2_crypt.service a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) systemd-cryptsetup@sda2_crypt.service a terminé son arrêt.
août 19 12:37:07 Thinkpad-machine systemd[1]: systemd-cryptsetup@sda2_crypt.service: Unit entered failed state.
août 19 12:37:07 Thinkpad-machine systemd[1]: systemd-cryptsetup@sda2_crypt.service: Failed with result 'exit-code'.
août 19 12:37:07 Thinkpad-machine systemd[1]: Unmounting /media/usb/crypto-user...
-- Subject: L'unité (unit) media-usb-crypto\x2duser.mount a commencé à s'arrêter
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) media-usb-crypto\x2duser.mount a commencé à s'arrêter.
août 19 12:37:07 Thinkpad-machine systemd[1]: Unmounted /media/usb/crypto-user.
-- Subject: L'unité (unit) media-usb-crypto\x2duser.mount a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) media-usb-crypto\x2duser.mount a terminé son arrêt.
août 19 12:37:32 Thinkpad-machine su[1675]: Successful su for root by user
août 19 12:37:32 Thinkpad-machine su[1675]: + /dev/pts/0 user:root
août 19 12:37:32 Thinkpad-machine su[1675]: pam_unix(su:session): session opened for user root by (uid=1000)
août 19 12:37:32 Thinkpad-machine su[1675]: pam_systemd(su:session): Cannot create session: Already running in a session
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d36db99fd289b4d19bd27e312e5424700\x2dsda2_crypt.device: Job dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d36db99fd289b4d19bd27e312e5424700\x2dsda2_crypt.device/stop timed out.
août 19 12:38:32 Thinkpad-machine systemd[1]: Timed out stopping /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-36db99fd289b4d19bd27e312e5424700-sda2_crypt.
-- Subject: L'unité (unit) dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d36db99fd289b4d19bd27e312e5424700\x2dsda2_crypt.device a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d36db99fd289b4d19bd27e312e5424700\x2dsda2_crypt.device a terminé son arrêt.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d36db99fd289b4d19bd27e312e5424700\x2dsda2_crypt.device: Job dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2d36db99fd289b4d19bd27e312e5424700\x2dsda2_crypt.device/stop failed with result 'timeout'.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-dm\x2d0.device: Job dev-dm\x2d0.device/stop timed out.
août 19 12:38:32 Thinkpad-machine systemd[1]: Timed out stopping /dev/dm-0.
-- Subject: L'unité (unit) dev-dm\x2d0.device a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) dev-dm\x2d0.device a terminé son arrêt.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-dm\x2d0.device: Job dev-dm\x2d0.device/stop failed with result 'timeout'.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dsda2_crypt.device: Job dev-disk-by\x2did-dm\x2dname\x2dsda2_crypt.device/stop timed out.
août 19 12:38:32 Thinkpad-machine systemd[1]: Timed out stopping /dev/disk/by-id/dm-name-sda2_crypt.
-- Subject: L'unité (unit) dev-disk-by\x2did-dm\x2dname\x2dsda2_crypt.device a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) dev-disk-by\x2did-dm\x2dname\x2dsda2_crypt.device a terminé son arrêt.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dsda2_crypt.device: Job dev-disk-by\x2did-dm\x2dname\x2dsda2_crypt.device/stop failed with result 'timeout'.
août 19 12:38:32 Thinkpad-machine systemd[1]: sys-devices-virtual-block-dm\x2d0.device: Job sys-devices-virtual-block-dm\x2d0.device/stop timed out.
août 19 12:38:32 Thinkpad-machine systemd[1]: Timed out stopping /sys/devices/virtual/block/dm-0.
-- Subject: L'unité (unit) sys-devices-virtual-block-dm\x2d0.device a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) sys-devices-virtual-block-dm\x2d0.device a terminé son arrêt.
août 19 12:38:32 Thinkpad-machine systemd[1]: sys-devices-virtual-block-dm\x2d0.device: Job sys-devices-virtual-block-dm\x2d0.device/stop failed with result 'timeout'.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-disk-by\x2duuid-5eb92e8c\x2d5515\x2d4e9b\x2dac5d\x2ddfa320566afc.device: Job dev-disk-by\x2duuid-5eb92e8c\x2d5515\x2d4e9b\x2dac5d\x2ddfa320566afc.device/stop timed out.
août 19 12:38:32 Thinkpad-machine systemd[1]: Timed out stopping /dev/disk/by-uuid/5eb92e8c-5515-4e9b-ac5d-dfa320566afc.
-- Subject: L'unité (unit) dev-disk-by\x2duuid-5eb92e8c\x2d5515\x2d4e9b\x2dac5d\x2ddfa320566afc.device a terminé son arrêt
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) dev-disk-by\x2duuid-5eb92e8c\x2d5515\x2d4e9b\x2dac5d\x2ddfa320566afc.device a terminé son arrêt.
août 19 12:38:32 Thinkpad-machine systemd[1]: dev-disk-by\x2duuid-5eb92e8c\x2d5515\x2d4e9b\x2dac5d\x2ddfa320566afc.device: Job dev-disk-by\x2duuid-5eb92e8c\x2d5515\x2d4e9b\x2dac5d\x2ddfa320566afc.device/stop failed with result 'timeout'.
août 19 12:42:49 Thinkpad-machine wpa_supplicant[793]: wlan0: WPA: Group rekeying completed with 90:94:e4:4e:1b:14 [GTK=CCMP]
août 19 12:51:04 Thinkpad-machine systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: L'unité (unit) systemd-tmpfiles-clean.service a commencé à démarrer
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) systemd-tmpfiles-clean.service a commencé à démarrer.
août 19 12:51:04 Thinkpad-machine systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: L'unité (unit) systemd-tmpfiles-clean.service a terminé son démarrage
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- L'unité (unit) systemd-tmpfiles-clean.service a terminé son démarrage, avec le résultat done.
Not doing great with the logs 'en francais.' I have been forgetting my schoolboy French since 1970 :-o.
Home is probably mounted before cryptsetup is run. Could you put a 'noauto'option in fstab for home, and then mount /home with cryptsetup or in rc.local or suchlike? Also, if it's only /home you have encrypted, why is it farting about with swap and other kit? There may be a config issue there. In the movie version of Oliver Twist, Fagan had a great line in his song:
I noticed you seem to have a swap file/partition on /home, seems that was turned off prior to /home unmount error. having a swap on /home seems a bit unusual to me, but per the log seems that is a non-issue
Do you have anything else attached to /home ? Like an executing process or a mount point ?
Before the next reboot, try disabling swap and see if any processes are using /home via lsof(8). Maybe a process accessing /home prior to unmount cannot be cancelled ?
This seems suspicious
Quote:
19 12:37:02 Thinkpad-machine kernel: usb 6-2: USB disconnect, device number 2
Maybe your usb key is disabled prior to unmounting /home ? Or was it removed after power on and unmount needs it ?
John
Last edited by jmccue; 08-19-2017 at 02:17 PM.
Reason: edit: notcied the full log link, adjusted
It's always fascinating to see these schizoid operating systems in other languages than English. And it's one thing to use non-English gui, and a completely different thing to use it in logs. They're as idiotic as they're funny: "L'unité (unit) home.mount a terminé son arrêt" and next "Stopped File System Check on /dev/mapper/sda2_crypt." It's not actually using linux in French, it's just... silly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.