You are not logged in.
Hi everybody,
I have LVM on top of a LUKS encrypted partition. That's why I have the shutdown hook in mkinitcpio.conf.
While shutting down I often (but not all the time) have the problem that not every mountpoint can be unmounted.
To trace down the issue I added the following debug printf in /usr/lib/initcpio/shutdown:
@@ -76,6 +76,7 @@
}
}
' | while read -r mount; do
+ printf '%s\n' "Unmounting $mount!"
umount "$mount"
done
Now the output is as follows:
Detaching loop devices.
Unmounting all devices.
Unmounting /oldroot/run!
Unmounting /oldroot/dev/pts!
Unmounting /oldroot/dev!
umount: can't umount /oldroot/dev: Device or resource busy
Unmounting /oldroot/sys!
Unmounting /oldroot/proc!
Unmounting /oldroot!
umount: can't umount /oldroot: Device or resource busy
Disassembling stacked devices.
Can't deactivate volume group "vgarch" with 1 open logical volume(s)
device-mapper: remove ioctl on vgarch failed: Device or resource busy
[the above message is repeated 25 times]
Can't deactivate volume group "vgarch" with 1 open logical volume(s)
And so on. So obviously /oldroot/dev can't be unmounted which gives me the trouble.
vgarch will be closed after 15-30 secs and the pc seems to shutdown properly. So no fscking at the next start.
Is this a known issue somehow? / is on a SSD if that matters.
Why can't /oldroot/dev be unmounted?
My laptop is also LVM on top of LUKS encrypted and I've never seen this issue.
Regards
Offline
I had this issue once on a live CD. I assume you mount /oldroot/dev with
mount -o bind /dev /oldroot/dev
My question is now: Do you need it? Normally you only need this if you chroot into /oldroot a lot, which should normally not be required.
If you really need your old root in a completely working state you can try to execute the following by yourself:
umount /oldroot/dev/pts
umount /oldroot/dev
If this fails try to look at lsof or even fuser as suggested by umount.
Note that you only need this binding under certain circumstances where you need a working /dev in your chroot environment. A lot of programs will work without this.
If you don't know what mounts it look at both /etc/fstab and /oldroot/etc/fstab (which might get executed for some reason).
Regards,
javex
Offline