在Linux中,有時使用umount命令去卸載LV或文件時,可能出現umount: xxx: device is busy的情況,如下案例所示
[root@DB-Server u06]# vgdisplay -v VolGroup03
Using volume group(s) on command line
Finding volume group "VolGroup03"
--- Volume group ---
VG Name VolGroup03
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 1.53 GB
PE Size 32.00 MB
Total PE 49
Alloc PE / Size 49 / 1.53 GB
Free PE / Size 0 / 0
VG UUID I9VS8Q-r2Gv-Ieh7-mwj2-Y8fX-4I4a-Iyg8OQ
--- Logical volume ---
LV Name /dev/VolGroup03/LogVol00
VG Name VolGroup03
LV UUID 2GrkGc-sA1u-GQFx-zZG3-FgPj-r7Hx-rcXKbf
LV Write Access read/write
LV Status available
# open 1
LV Size 1.53 GB
Current LE 49
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Physical volumes ---
PV Name /dev/sdc2
PV UUID XrGKB6-unEt-ccor-Re6Q-ZqmG-QA5m-rutX0t
PV Status allocatable
Total PE / Free PE 49 / 0
You have new mail in /var/spool/mail/root
[root@DB-Server u06]# umount /dev/VolGroup03/LogVol00
umount: /u06: device is busy
umount: /u06: device is busy
出現這種情況,表示還有進程在使用/u06掛載點,那麼此時可以借助fuser命令找出占用目錄/u06的所有進程,然後kill掉,此時就可以umount lv了。如下所示:
[root@DB-Server u06]# fuser -m /u06
/u06: 10584c
[root@DB-Server u06]# kill -9 10584
[root@DB-Server ~]# umount /dev/VolGroup03/LogVol00
[root@DB-Server ~]#
關於fuser,它是用來顯示所有正在使用著指定的file, file system 或者 sockets的進程信息。它通常被用在診斷系統的“resource busy”問題,通常是在你希望umount指定的掛載點得時候遇到。如上所示,使用選項-m,用來查找所有正在使用/u06掛載點的所有進程, 10584c表示進程為10584. 關於fuser的其它信息,可以使用man fuser查看具體相關信息。
http://xxxxxx/Linuxjc/1139027.html TechArticle