mkfs.xfs: cannot open /dev/sdh: Device or resource busy

Today, the following error occurred when formatting the disk with xfs under centos

1 When
mkfs.xfs -f /dev/sdh
appears:

1
mkfs.xfs: cannot open /dev/sdh: Device or resource busy
and formatting after restarting the server is the same, that is, restarting the server is useless.

Use lsof to see who is occupying it, but it has no effect.

Solution:

1
2
[root@xiaohuai]# dmsetup ls
ddf1_44656c6c202020201000007910281f1747cd0dedccd25148 (253:0)
Then we remove this occupation

1
[root@xiaohuai]# dmsetup remove ddf1_44656c6c202020201000007910281f1747cd0dedccd25148
Then you can start formatting

1
2
3
4
5
6
7
8
9
[root@xiaohuai]# mkfs.xfs -f /dev/sdh
meta-data=/dev/sdh isize=256 agcount=4, agsize=122094662 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=488378646, imaxpct=5
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=238466, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
至此问题解决。

If you rely on more disks, you can

Guess you like

Origin blog.csdn.net/weixin_43214644/article/details/114671026