在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查看具体相关信息。
时间: 2024-09-17 10:32:47