强制 umount nfs文件系统

由于各种原因无法访问挂载的NFS目录的时候,先对那个目录执行fuser之后就可以顺利umount了

[root@bswin ~]# umount /work2/xiep/wwwroot
umount.nfs: /home/work2/xiep/wwwroot: device is busy
umount.nfs: /home/work2/xiep/wwwroot: device is busy
[root@bswin ~]# fuser -km /work2/xiep/wwwroot
/work2/xiep/wwwroot: 16616c
[root@bswin ~]# umount /work2/xiep/wwwroot
[root@bswin ~]# fuser --help
未指定进程
Usage: fuser [ -a ¦ -s ¦ -c ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME...
             [ - ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME...
       fuser -l
       fuser -V
Show which processes use the named files, sockets, or filesystems.

    -a        display unused files too
    -c        mounted FS
    -f        silently ignored (for POSIX compatibility)
    -i        ask before killing (ignored without -k)
    -k        kill processes accessing the named file
    -l        list available signal names
    -m        show all processes using the named filesystems
    -n SPACE  search in this name space (file, udp, or tcp)
    -s        silent operation
    -SIGNAL   send this signal instead of SIGKILL
    -u        display user IDs
    -v        verbose output
    -V        display version information
    -4        search IPv4 sockets only
    -6        search IPv6 sockets only
    -         reset options

  udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]

我想挂载的时候使用soft方式应该可以缓解这种问题

[root@bswin xiep]# mount -o soft,timeo=1 10.9.10.39:/wwwroot /work2/xiep/wwwroot/

Linux Network Administrators Guide,Chapter 14. The NetworkFile System (可能需要代理) 上有一些说明。

发表评论

电子邮件地址不会被公开。

CAPTCHA

*