Bug 657497 - systemd-shutdown is a bit to noisy when it cannot detach the DM device the root dir is on.
systemd-shutdown is a bit to noisy when it cannot detach the DM device the ro...
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-26 04:37 EST by Petr Lautrbach
Modified: 2011-09-05 19:41 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-06 13:14:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Lautrbach 2010-11-26 04:37:06 EST
Description of problem:
My system using / on lvm as is in default configuration:

/dev/mapper/VolGroup-lv_root on / type ext4 (rw)

/dev/mapper/VolGroup-lv_root -> ../dm-0

I can see 'Device or resource busy' messages in log during poweroff.

Version-Release number of selected component (if applicable):
systemd-15-1.fc15.x86_64

How reproducible:
always

Steps to Reproduce:
1. poweroff 
2. see logs
3.
  
Actual results:

Disabling swaps.
Detaching loop devices.
Detaching DM devices.
[  509.545048] device-mapper: ioctl: unable to remove open device VolGroup-lv_root
Could not delete dm /dev/dm-0: Device or resource busy
Not all DM devices detached, 1 left.
Detaching DM devices.
[  509.547814] device-mapper: ioctl: unable to remove open device VolGroup-lv_root
Could not delete dm /dev/dm-0: Device or resource busy
Not all DM devices detached, 1 left.
Cannot finalize remaining file systems and devices, trying to kill remaining processes.
Detaching DM devices.
[  509.551577] device-mapper: ioctl: unable to remove open device VolGroup-lv_root
Could not delete dm /dev/dm-0: Device or resource busy
Not all DM devices detached, 1 left.
Cannot finalize remaining file systems and devices, giving up.
[  509.554627] md: stopping all md devices.


Expected results:


Additional info:
Comment 1 Lennart Poettering 2011-01-04 18:43:29 EST
Hmm, you have the root dir on LVM. Since we cannot unmount the root dir we hence cannot detach its DM device. Which is why you see what you see. This isn't really a problem though, as traditionally we never even bothered to detach the DM devices like this. However, we probably should make these error message show up less prominently, to not confuse the user.
Comment 2 Lennart Poettering 2011-01-06 13:14:22 EST
The dm kernel folks have now downgraded the "device-mapper: ioctl: unable to remove open device" message to debug which means it shouldn't show up on the console anymore by default.

I also have changed systemd git to avoid trying to detach the dm device the root dir is on, which should have the effect that you won't see "Device or resource busy" anymore.

I think this should resolve this bug report.
Comment 3 Lennart Poettering 2011-01-06 13:15:47 EST
The ideal fix btw would be if we could actually unmount the root dir on shutdown and hence detach the dm device it is on, which we cannot do right now. I have created an RFE tracker bug for that so that we don't forget about it.

https://bugzilla.redhat.com/show_bug.cgi?id=667557
Comment 4 Andre Costa 2011-09-01 17:53:40 EDT
Hi,

I know this issue is already marked as CLOSED UPSTREAM but I just wanted to confirm this can't be the cause for bug 712060, since "Cannot finalize remaining file systems and devices, giving up" is the last thing I read before "[<timestamp>] Power down."

Lennart, can you confirm this can't under some circunstances (in my case I'd say it's 90% of the time) prevent the system from powering off?
Comment 5 Lennart Poettering 2011-09-05 19:41:53 EDT
Yes, this is unrelated to bug 712060. 

This bug is about being to noisy, i.e. just a cosmetic issue, nothing which would stop you from shutting down.

If the last message you see is the kernel's "Power down" message, then it appears it is a kernel problem, indeed.

Note You need to log in before you can comment on or make changes to this bug.