mkfs cannot open <device>: Device or resource busy
I have a 2TB disk that I am trying to configure as a single partition.
Code:
# fdisk -l /dev/sdb Code:
brw-rw---- 1 root disk 8, 16 Nov 12 20:28 /dev/sdb Code:
mkfs.xfs -i size=512 /dev/sdb1 Code:
mkfs.ext4 /dev/sdb1 Code:
# df -h Code:
# lsof /dev/sdb1 I've googled around and have checked for md usage, but sdb1 is not listed: Code:
# cat /proc/mdstat I'm running: Code:
3.11.6-201.fc19.x86_64 |
Would be really strange since df doesnt show it but have you cat'ed your mtab file to see if for some reason it has an entry on that file for it still? That would cause mfks to believe it is in use. Also does multipath believe that it is using at all either? You say you tried an lsof did you also try an fuser on both the device and the partition? Is there a defunct process that still has a fd open on that drive that lsof isnt seeing?
cat /etc/mtab multipath -v2 fuser /dev/sdb fuser /dev/sdb1 |
Cheers for the reply. For the sake of brevity I hadn't included the multipath output in my original post, so apologies - there are 3 x 2TB drives in the system, in addition to a 500GB drive used for the boot disk:
Code:
# multipath -v2 Code:
# fuser /dev/sdb Code:
# cat /etc/mtab|grep sdb Code:
# pvs I have noted that when the system boots there isn't a device file for the partition, i.e. /dev/sdb1 doesn't exist. Once I run partprobe this is created. I can't ever recall having this much hassle in the past - any ideas much appreciated. |
Ok, so I found the issue - it is the multipath daemon!! :o
I had stopped and disabled this with systemctl, but it keeps bursting back into life (which I hadn't noticed at first); same after a reboot. It still lists itself as disabled, but starts up anyway?! :scratch: I was fooled by lsof no longer showing any usage of the device after I stopped multipath.service, but clearly this was not accurate :scratch: Code:
# systemctl status multipathd.service Code:
# multipath -ll Code:
blacklist { Code:
# mkfs.ext3 /dev/sdb1 Cheers. |
All times are GMT -5. The time now is 02:55 AM. |