[Bug 1905166] Re: systemd-shutdown cannot detach DM

2024-06-17 Thread Chris
I had repeatable disk corruption due to this issue, so I think fixing it
should be given a higher priority!  I experienced this issue with Ubuntu
22.04 (and probably 20.04) on an encrypted LVM installation:

systemd-shutdown[1]: Could not detach DM /dm/dm-9: Device or resource busy
systemd-shutdown[1]: Could not detach DM /dm/dm-7: Device or resource busy
systemd-shutdown[1]: Could not detach DM /dm/dm-11: Device or resource busy
systemd-shutdown[1]: Could not detach DM /dm/dm-10: Device or resource busy
systemd-shutdown[1]: Could not detach DM /dm/dm-1: Device or resource busy
systemd-shutdown[1]: Could not detach DM /dm/dm-0: Device or resource busy
systemd-shutdown[1]: Failed to finalize DM devices, ignoring.

I found the easiest way to check for these messages is to shutdown using:
sudo systemctl halt

For some years I've tried to configure LVM to use an NVMe drive as a
cache for the / and /home partitions on my main drive, but I always
ended-up getting severe corruption after some time.  Recently I realised
that after booting, lvmcache would spend a long time copying my whole
NVMe cache back to the main drive (and slow everything down until that
finished), as "sudo lvs -a" showed that "Cpy%Sync" was non-zero but
dropping.  I read that:

"The most likely cause is your system was not shutdown cleanly so dm-
cache has no choice but to assume all blocks are dirty and need writing
back."

Once I realised the above "Device or resource busy" error messages were
probably related to this problem, I followed Boulardii's earlier tip
here about installing dracut-core.  Since then I no-longer get those
error messages - and fingers crossed I haven't had any corruption since
re-enabling LVM's caching.

In case it helps, my /etc/crypttab file looks roughly like this:

sdz5_crypt UUID=... /dev/disk/by-label/DRIVENAME:/filename.key 
luks,discard,noauto,keyscript=passdev
nvme0n1_crypt UUID=... /dev/disk/by-label/DRIVENAME:/filename.key 
luks,discard,noauto,keyscript=passdev

(I did try adding ,x-initrd.attach but that didn't help.)

And maybe helpful for others: Some time ago I switched from Ext4 to
Btrfs, because the disk corruption spread badly before Ext4 noticed (and
by that time it was way too late to repair it - I had to format &
restore).  With a correctly configured Btfs (-mdup), it stops the system
at the first sign of corruption (easily repaired), and that allowed me
to try various ways to fix the problem - which were all unsuccessful
until now.  Also beware that converting an Ext4 partition to Btrfs
results in it using -msingle which is extremely fragile, so make sure to
convert it to -mdup ASAP.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/finalrd/+bug/1905166/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2022-05-02 Thread Rafael
I am having this issue too. With failing to finalize file systems.

I can see these messages that I think could be releated:

May 02 07:25:59 server lvm[556]:   1 logical volume(s) in volume group "vg" 
unmonitored
May 02 07:25:59 server systemd[1]: lvm2-monitor.service: Succeeded.


Perhaps my volume group is "unmonitored" means that it will not be included in 
the shutdown process?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/finalrd/+bug/1905166/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-05-06 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: finalrd (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/finalrd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-04-14 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: finalrd (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/finalrd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-04-14 Thread Dan Streetman
This actually appears to be bug(s) in the 'finalrd', not systemd;
probably bug 1920107 is a dup of this one

** Package changed: systemd (Ubuntu) => finalrd (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/finalrd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-04-14 Thread Dan Streetman
** Changed in: systemd (Ubuntu)
   Status: Incomplete => New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/finalrd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-04-06 Thread Dan Streetman
> [ timestamp] sd-umoun[2337]: Failed to unmount /oldroot: Device or resource 
> busy
> [ timestamp] sd-umoun[2337]: Failed to unmount /oldroot/sys: Device or 
> resource busy

um, your mount output doesn't show any mounts at those dirs...you sure
you're getting those messages at shutdown? ;-)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-03-27 Thread Jo Liss
> for those affected, does this happen every boot/shutdown?

Yes, I'm getting the following messages on Hirsute at the end of every
shut down (or reboot):

[   OK  ] Reached target Reboot.
[   timestamp] XFS: attr2 mount option is deprecated.
[   timestamp] sd-umoun[2337]: Failed to unmount /oldroot: Device or resource 
busy
[   timestamp] sd-umoun[2337]: Failed to unmount /oldroot/sys: Device or 
resource busy
[   timestamp] shutdown[1]: Could not detach DM /dev/dm-1:  Device or resource 
busy
[   timestamp] shutdown[1]: Could not detach DM /dev/dm-0:  Device or resource 
busy
[   timestamp] shutdown[1]: Failed to finalize file systems, DM devices, 
ignoring.

> is this a 'standard' installation, using the standard iso?

Yes, this was installed using a nightly hirsute-live-server-amd64.iso,
with disk encryption enabled during installation.

> what do you have mounted? what's the output of 'mount' and the output
of 'lsblk'?

# mount
...
/dev/mapper/ubuntu--vg-ubuntu--lv on / type xfs 
(rw,noatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/nvme0n1p2 on /boot type ext4 (rw,relatime)
/dev/nvme0n1p1 on /boot/efi type vfat 
(rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
...

Full mount output at
https://gist.githubusercontent.com/joliss/c13e728ee039a2440e98f7ba6dd7ecd8/raw/25678bdaa17707a41b81b61c0fc648e01968ca90/mount

# lsblk
NAMEMAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
loop0 7:00 99.2M  1 loop  /snap/core/10908
loop1 7:10 25.9M  1 loop  /snap/heroku/4037
loop2 7:20   72M  1 loop  /snap/lxd/19766
loop3 7:30 55.5M  1 loop  /snap/core18/1988
loop4 7:40 32.3M  1 loop  /snap/snapd/11107
loop5 7:50 32.3M  1 loop  /snap/snapd/11402
loop6 7:60 68.7M  1 loop  /snap/lxd/19823
nvme0n1 259:00  1.8T  0 disk
├─nvme0n1p1 259:10  512M  0 part  /boot/efi
├─nvme0n1p2 259:201G  0 part  /boot
└─nvme0n1p3 259:30  1.8T  0 part
  └─dm_crypt-0  253:00  1.8T  0 crypt
└─ubuntu--vg-ubuntu--lv 253:10  1.8T  0 lvm   /

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-02-18 Thread Dan Streetman
for those affected, does this happen every boot/shutdown?

is this a 'standard' installation, using the standard iso?

what do you have mounted? what's the output of 'mount' and the output of
'lsblk'?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-02-03 Thread j
** Attachment added: "2.png"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5459533/+files/2.png

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-02-03 Thread j
** Attachment added: "short.log"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5459536/+files/short.log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-02-03 Thread j
** Attachment added: "long.log"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5459535/+files/long.log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-02-03 Thread j
** Attachment added: "kern.log"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5459534/+files/kern.log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-02-03 Thread j
The message:
systemd-shutdown[1]: Could not detach DM /dev/dm-0: Device or resource busy
systemd-shutdown[1]: Failed to finalize DM devices, ignoring

is not in the logs, idk why, here are some more logs, the image shows
the message and the time before. I attached also a longer log file and
kern log, if it helps..?

** Attachment added: "1.png"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5459532/+files/1.png

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-01-13 Thread smartman
Same issue here.
5.8.0-36-generic #40~20.04.1-Ubuntu SMP Wed Jan 6 10:15:55 UTC 2021 x86_64 
x86_64 x86_64 GNU/Linux

I had issue with glxgears and some other apps that failed to start. When
restarting then the computer(Lenovo P73) hanged. I think the same
hanging behaviour has happened before.

Not sure if this OpenGL issue is somehow related.
pi-imager.desktop[624532]: Failed to create OpenGL context for format 
QSurfaceFormat(version 2.0, options QFlags(), 
depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, 
alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 
QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace 
QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)

** Attachment added: "IMG_20210114_091322.jpg"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5452873/+files/IMG_20210114_091322.jpg

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-01-12 Thread Dan Streetman
> Have the same problem, here is the log:

that log doesn't show the reported problematic log messages

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2021-01-07 Thread j
Have the same problem, here is the log:

** Attachment added: "Log of systemd"
   
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+attachment/5450309/+files/lp1905166.log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2020-12-11 Thread Dan Streetman
please reboot with this kernel boot parameter added:

systemd.log_level=debug

Then let the system boot up, and then perform a shutdown, to reproduce
the problem. Then start the system back up (you can remove the kernel
boot parameter) and capture the previous boot's journal, which should
include the problem reproduction while debug is enabled; you can use the
command:

$ journalctl -k -b -1 > /tmp/lp1905166.log

which will capture the log output from the previous boot.

** Changed in: systemd (Ubuntu)
   Status: Confirmed => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1905166] Re: systemd-shutdown cannot detach DM

2020-11-24 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: systemd (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1905166

Title:
  systemd-shutdown cannot detach DM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1905166/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs