[SOLVED] During shutdown /, /srv/ var: "device busy"
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
umount: /srv: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /var: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
/dev/mapper/CW8-s_opt umounted
/dev/mapper/CW8-home umounted
umount: /: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
nfsd umounted
tmpfs umounted
/dev/sdb6 umounted
/dev/sda5 umounted
/dev/sda2 umounted
/dev/mapper/CW8-srv umounted
/dev/mapper/CW8-s_var umounted
usbfs umounted
To investigate the problem, I modified /etc/rc.d/rc.6 (rc.0 is a symlink to rc.6):
Code:
log=/etc/rc.d/shutdown.log
echo 'DEBUG: Before unmounting LVM volumes' > $log
lsof /var /srv >> $log
lsof /dev/mapper/CW8-s_var /dev/mapper/CW8-srv >> $log
fuser -amu /srv /var >> $log
ps -ef >> $log
# Umount any LVM volumes:
if /bin/mount | /bin/grep -q '^/dev/mapper/' ; then
echo "DEBUG: Unmounting LVM volumes." >> $log
echo "Unmounting LVM volumes."
/bin/umount -v $(/bin/mount | /bin/grep '^/dev/mapper/' | /bin/cut -d ' ' -f 3 | /bin/tac) 2>&1 | tee -a $log
fi
echo 'DEBUG: After unmounting LVM volume, before unmounting local file systems' >> $log
echo "Unmounting local file systems."
/bin/umount -v -a -t no,proc,sysfs 2>&1 | tee -a $log
After reboot, ps -ef output in /etc/rc.d/shutdown.log showed only init, kthreadd and its children, rc.0 and ps itself running. There was no output from the lsof or fuser commands:
Your problem is that the "Unmount any LVM Volumes:" section of rc.6 is trying to unmount all filesystems on lvm volumes, including /srv, but in your case you have a non-lvm filesystem mounted at a lower mountpoint (/srv/bacula) which will result in /srv being 'busy'. The same thing is happening with your /var and /var/cache/WXP.
My advice would be to completely remove the "Unmount any LVM Volumes" section of rc.6 and let the "unmount local filesystems" section of code directly below it deal with all the unmounting. Filesystems on LVM volumes are 'local' so there's no reason I can think of for this extra section of code being in rc.6
Besides, that section of code is a bit brain-dead anyway, "mount | grep /dev/mapper" isn't a reliable way of identifying filesystems on LVM LVs as other things can have /dev/mapper/... devices!
I have raised the issue of this unnecessary section of code in the past on this forum, but the devs weren't particularly interested at that time. Maybe now there's a good example of it causing someone a problem they'll take another look at it.
You're welcome mate, and thanks for reporting back that it does the job. That should help the cause.
There's a couple of other nasties in rc.6 that I'm intending to look at and see if I can find a better way of doing things, but that's for another day/thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.