FedoraThis forum is for the discussion of the Fedora Project.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to resize ext4 filesystem, mounted on a LV:
Code:
[root@c4 mapper]# df -h /Backup/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_c4-Backup 99G 62G 32G 67% /Backup
I need to unmount it first, but when I do so it shows it unmounted, but the OS is telling me that the resource is busy:
Code:
[root@c4 mapper]# umount -f /Backup
[root@c4 mapper]# df -h /Backup/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_c4-root 9.9G 8.7G 1.2G 89% /
[root@c4 mapper]# e2fsck /dev/mapper/vg_c4-Backup
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Device or resource busy while trying to open /dev/mapper/vg_c4-Backup
Filesystem mounted or opened exclusively by another program?
According to fuser these are the processes still using this device:
I didn't open a terminal somewhere in /Backup...
No other programs accessing it, nor do some scripts...
I obviously don't want to kill all those processes
I also don't want to reboot
You're getting device busy because the Linux native multipather has the device (as evidenced by the dm-* name you're seeing).
We just saw this recently with a USB drive we added to a system. To clear it up we did the following:
The multipathd daemon runs to monitor disk events to determine if a disk should be added to multipathing.
When we tested our server we found it had multipathd running.
My theory as to why we were seeing “device busy” messages when trying to mount the new USB device was because multipathd had captured it and was somehow preventing direct access to the /dev/sd* device.
To test that I ran “multipath –l –v2” which says to list multipathing setup with a verbosity level of 2. That command did show the it had created a new mpathf device comprised of the single path /dev/sdh which was the USB.
By examining /etc/multipath/bindings (an ascii file) one can see the “wwid” (unique ID) numbers associated with given multipath devices.
Ours indicated:
mpathf 241736d6564696120
In the above the second item is the wwid.
Part of the multipath setup is to exclude devices that you don’t want under multipath control (typically because there is only a single path – usually this would be the internal disks but as seen in this case should also be USB attached storage). The configuration file for multipath is /etc/multipath.conf. In that file is a “blacklist” section where one enters the wwids of devices that should be excluded.
I edited the file to include the following line in blacklist section:
wwid 241736d6564696120
After that we found we needed to run “service multipathd restart” so the daemon would reread the configuration file.
Additionally I had found we could temporarily remove the device from multipathing (before the restart of multipathd) by running “multipath -f mpathf”.
Note that stopping multipathd does NOT stop your running multipath devices so others will continue to work. The multipathd is simply a daemon that determines what to do with disks when events such as adding them to the system or removing them from the system occur.
However I don't think that this is the case here, because multipather isn't running on my node:
[root@c4 Storage]# multipath –l –v2
Dec 06 10:48:31 | /etc/multipath.conf does not exist, blacklisting all devices.
Dec 06 10:48:31 | A sample multipath.conf file is located at
Dec 06 10:48:31 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Dec 06 10:48:31 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf
Dec 06 10:48:31 | DM multipath kernel driver not loaded
[root@c4 Storage]# ps -ef |egrep 'multip|mpath'
[root@c4 Storage]#
[root@c4 Storage]# chkconfig --list |grep -i multi
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
[root@c4 Storage]# systemctl |grep multi
multi-user.target loaded active active Multi-User
[root@c4 Storage]#
But anyway, this was useful information.
Thanks a lot!!
You're probably right - if multipathd wasn't running then nothing multipath wouldn't have grabbed the disk.
You might want to run lsof /backup to see what is busying out the device. Note that one tricky "busy" that can occur is if someone were to cd into the directory then switch user. Sometimes fuser won't show this process since the effective user changed but usually lsof will.
I am curious however, as to what created this link you mentiond:
Quote:
[root@c4 mapper]# ls -l /dev/vg_c4/
total 0
lrwxrwxrwx 1 root root 7 Dec 3 10:49 Backup -> ../dm-5
I'm used to the dm-* devices being created by multipath. Did you previously run multipath?
Is something else running that created the dm-5 or is the dm-5 itself busy?
Have you verified you don't have any loopback mounts (i.e. Backup or dm-5 is also mounted as something else other than /backup?) Run df -h to be sure you understand where all your mounts are coming from.
Also you might want to verify there is nothing in automounter (/etc/auto*) files that is mounting this rather than fstab.
Honestly, I didn't remember if I was messing up with multipathd in the past, but I think no.
I am not sure why the naming is dm-like, but for instance my virtual machines under this node are also with block devices named like dm-*, and I can't say why.
I have software raid0 set up plus LVM. On the virtual machines I only have LVM and the naming is like the virtualization host - dm-*.
Quote:
Is something else running that created the dm-5 or is the dm-5 itself busy?
The device itself was busy showing the same processes as above using it.
Quote:
Have you verified you don't have any loopback mounts (i.e. Backup or dm-5 is also mounted as something else other than /backup?) Run df -h to be sure you understand where all your mounts are coming from.
Verified, no loopback mounts.
And no /etc/auto* files too.
However, I've managed to fix this "locking" with a reboot and now I am unable to proceed reproducing this.
You might want to go to Thread Tools at the top of the thread and mark it as "Solved". It helps others with similar problems in future find your solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.