I get this error when shutting down or restarting the computer: systemd-shutdown[1]: Unable to finalize remaining DM devices, ignoring.
and suddenly disappears. Is there a serious problem? How can I solve it? I’d be glad if someone helps.
I ran across this about your error message…
opened 02:52PM - 03 Mar 20 UTC
closed 09:48PM - 19 May 20 UTC
needs-reporter-feedback ❓
shutdown
**systemd version the issue has been seen with**
> 244.3
**Used distribution… **
> Arch Linux
**Expected behaviour you didn't see**
> Computer shutdown on `Reached Shutdown` or `Reached Reboot`.
**Unexpected behaviour you saw**
> The computer hangs for 20/30 seconds before powering off.
**Steps to reproduce the problem**
> I'm not sure.
[I followed the instructions in this article](https://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually) to log the shutdown messages.
_As far as I can understand_, systemd-shutdown fails to deactivate LVM before LUKS.
My disk configuration:
```
user@xps15:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /efi
└─nvme0n1p2 259:2 0 476.4G 0 part
└─cryptlvm 254:0 0 476.4G 0 crypt
├─myvg-root 254:1 0 48.4G 0 lvm /
└─myvg-home 254:2 0 428G 0 lvm /home
```
More informations about **device mapper** disks:
```
user@xps15:~$ ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 10 Mar 3 10:31 dm-name-cryptlvm -> ../../dm-0
lrwxrwxrwx 1 root root 10 Mar 3 10:31 dm-name-myvg-home -> ../../dm-2
lrwxrwxrwx 1 root root 10 Mar 3 10:31 dm-name-myvg-root -> ../../dm-1
```
My **/etc/fstab**:
```
user@xps15:~$ cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
/dev/myvg/root / ext4 rw,relatime 0 1
UUID=3F77-ACDC /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
/pagefile none swap defaults 0 0
/dev/myvg/home /home ext4 defaults 0 2
/path/to/custom /var/cache/pacman/custom none auto,ro,bind 0 0
```
The following is the **shutdown-log.txt** (redacted):
```
[ 0.000000] Linux version 5.4.23.a-1-hardened-hibernate (linux-hardened-hibernate@archlinux) (gcc version 9.2.1 20200130 (Arch Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Mon, 02 Mar 2020 10:21:32 +0000
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-linux-hardened-hibernate root=/dev/mapper/myvg-root rw cryptdevice=UUID=0d138fd9-c3a9-417d-a65e-14e16ff81b2d:cryptlvm root=/dev/myvg/root mem_sleep_default=deep audit=1 apparmor=1 security=apparmor resume=/dev/myvg/root resume_offset=12345 loglevel=3
[ 6.869631] systemd[1]: systemd 244.3-1-arch running in system mode. (+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[ 6.885700] systemd[1]: Detected architecture x86-64.
[ 6.921102] systemd[1]: Set hostname to <xps15>.
[ 7.134858] systemd[1]: Created slice system-getty.slice.
[ 7.135120] systemd[1]: Created slice system-modprobe.slice.
[ 7.135329] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[ 7.135572] systemd[1]: Created slice User and Session Slice.
[ 7.135674] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 7.135764] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 7.135998] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 7.136067] systemd[1]: Reached target Local Encrypted Volumes.
[ 7.136113] systemd[1]: Reached target Login Prompts.
[ 7.136161] systemd[1]: Reached target Paths.
[ 7.136202] systemd[1]: Reached target Remote File Systems.
[ 7.136244] systemd[1]: Reached target Slices.
[ 7.136330] systemd[1]: Listening on Device-mapper event daemon FIFOs.
[ 7.136827] systemd[1]: Listening on LVM2 metadata daemon socket.
[ 7.137118] systemd[1]: Listening on LVM2 poll daemon socket.
[ 7.138663] systemd[1]: Listening on Process Core Dump Socket.
[ 7.138749] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ 7.138914] systemd[1]: Listening on Journal Audit Socket.
[ 7.139028] systemd[1]: Listening on Journal Socket (/dev/log).
[ 7.139143] systemd[1]: Listening on Journal Socket.
[ 7.139251] systemd[1]: Listening on udev Control Socket.
[ 7.139341] systemd[1]: Listening on udev Kernel Socket.
[ 7.140875] systemd[1]: Mounting Huge Pages File System...
[ 7.142783] systemd[1]: Mounting POSIX Message Queue File System...
[ 7.144732] systemd[1]: Mounting Kernel Debug File System...
[ 7.146677] systemd[1]: Starting Load AppArmor profiles...
[ 7.148857] systemd[1]: Starting Create list of static device nodes for the current kernel...
[ 7.150833] systemd[1]: Starting Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling...
[ 7.151694] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[ 7.151745] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[ 7.154126] systemd[1]: Starting Journal Service...
[ 7.157693] systemd[1]: Starting Load Kernel Modules...
[ 7.160605] systemd[1]: Starting Remount Root and Kernel File Systems...
[ 7.163399] systemd[1]: Starting udev Coldplug all Devices...
[ 7.168161] systemd[1]: Mounted Huge Pages File System.
[ 7.168420] systemd[1]: Mounted POSIX Message Queue File System.
[ 7.168667] systemd[1]: Mounted Kernel Debug File System.
[ 7.169346] systemd[1]: Started Create list of static device nodes for the current kernel.
[ 7.169468] audit: type=1130 audit(1583227689.502:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=kmod-static-nodes comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 7.173175] systemd[1]: Started LVM2 metadata daemon.
[ 7.173341] audit: type=1130 audit(1583227689.506:8): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=lvm2-lvmetad comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 7.179580] systemd[1]: Started Remount Root and Kernel File Systems.
[ 7.179692] audit: type=1130 audit(1583227689.512:9): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-remount-fs comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 7.181692] systemd[1]: Activating swap /pagefile...
[ 7.181855] systemd[1]: Condition check resulted in First Boot Wizard being skipped.
[ 7.182272] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
[ 7.184634] systemd[1]: Starting Load/Save Random Seed...
[ 7.184751] systemd[1]: Condition check resulted in Create System Users being skipped.
[ 7.186878] systemd[1]: Starting Create Static Device Nodes in /dev...
[ 7.209051] systemd[1]: Started Create Static Device Nodes in /dev.
[ 7.209270] audit: type=1130 audit(1583227689.542:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-setup-dev comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 7.212058] systemd[1]: Starting udev Kernel Device Manager...
[ 7.212839] systemd[1]: Started Load/Save Random Seed.
[ 7.220945] systemd[1]: Started Load Kernel Modules.
[ 7.221292] systemd[1]: Condition check resulted in FUSE Control File System being skipped.
[ 7.223443] systemd[1]: Mounting Kernel Configuration File System...
[ 7.225545] systemd[1]: Starting Apply Kernel Variables...
[ 7.229170] systemd[1]: Mounted Kernel Configuration File System.
[ 7.236465] systemd[1]: Started Apply Kernel Variables.
[ 7.274951] systemd[1]: Started udev Coldplug all Devices.
[ 7.275575] audit: type=1130 audit(1583227689.609:14): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-udev-trigger comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 7.499999] systemd[1]: Started Journal Service.
[ 7.500845] audit: type=1130 audit(1583227689.832:21): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 7.518198] systemd-journald[439]: Received client request to flush runtime journal.
[ 21.951677] audit: type=1131 audit(1583227704.282:1322): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=auditd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 21.952973] audit: type=1131 audit(1583227704.286:1323): pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=systemd-tmpfiles-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 22.173880] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 22.217433] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[ 22.252293] systemd-journald[439]: Received SIGTERM from PID 1 (systemd-shutdow).
[ 22.283090] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[ 22.286685] systemd-shutdown[1]: Hardware watchdog 'iTCO_wdt', version 0
[ 22.287301] systemd-shutdown[1]: Unmounting file systems.
[ 22.289026] [1788]: Remounting '/' read-only in with options '(null)'.
[ 22.305270] EXT4-fs (dm-1): re-mounted. Opts: (null)
[ 22.311721] systemd-shutdown[1]: All filesystems unmounted.
[ 22.311725] systemd-shutdown[1]: Deactivating swaps.
[ 22.311791] systemd-shutdown[1]: All swaps deactivated.
[ 22.311793] systemd-shutdown[1]: Detaching loop devices.
[ 22.311947] systemd-shutdown[1]: All loop devices detached.
[ 22.311949] systemd-shutdown[1]: Detaching DM devices.
[ 22.312665] systemd-shutdown[1]: Detaching DM /dev/dm-2 (254:2).
[ 22.343222] systemd-shutdown[1]: Detaching DM /dev/dm-0 (254:0).
[ 22.343242] systemd-shutdown[1]: Could not detach DM /dev/dm-0: Device or resource busy
[ 22.343246] systemd-shutdown[1]: Not all DM devices detached, 2 left.
[ 22.343467] systemd-shutdown[1]: Detaching DM devices.
[ 22.343875] systemd-shutdown[1]: Detaching DM /dev/dm-0 (254:0).
[ 22.343887] systemd-shutdown[1]: Could not detach DM /dev/dm-0: Device or resource busy
[ 22.343889] systemd-shutdown[1]: Not all DM devices detached, 2 left.
[ 22.343892] systemd-shutdown[1]: Cannot finalize remaining DM devices, continuing.
[ 22.364505] EXT4-fs (dm-1): re-mounted. Opts: (null)
```
The message systemd-shutdown[1]: Failed to finalize DM devices, ignoring
may suggest that your root filesystem is on a LVM device and because of that systemd
cannot detach it.
Hope this info help. I’m sure someone with more knowledge than me will chime in.
1 Like
Thanks for your answer. Maybe there will be someone else who can solve the problem. By the way, I had used EndeavourOS before, but it did not have disk encryption. I did a fresh install today and enabled disk encryption. I remember that there was no such problem before enabling disk encryption, but I may be remembering wrong. Could this problem be related to disk encryption?