卸载nfs文件系统

卸载nfs文件系统

[root@localhost ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
192.168.146.155:/dnsdata_reiser4/dns_project on /dns_project type nfs (rw,noexec,nosuid,nodev,bg,soft,noacl,nocto,rsize=32768,wsize=32768,addr=192.168.146.155)
192.168.146.155:/dnsdata_reiser4/dns_project/database on /database type nfs (rw,noexec,nosuid,nodev,bg,soft,noacl,nocto,rsize=32768,wsize=32768,addr=192.168.146.155)

[root@localhost ~]# umount /dns_project
umount: /dns_project: device is busy

或者由于nfs服务器已经关闭,导致客户端无法卸载已挂载的nfs文件系统

$ umount /dns_project
umount.nfs: 192.168.146.18:/dns_project: not found / mounted or server not reachable

可以通过以下办法解决:
把已挂载的nfs文件系统那行注释掉

$ vi /etc/mtab
...
# 192.168.146.18:/dns_project /dns_project nfs rw,noexec,nosuid,nodev,bg,soft,noacl,nocto,rsize=32768,wsize=32768,addr=192.168.146.18 0 0
$umount /test

这样就可以成功卸载nfs文件系统了

关于/etc/mtab

The file /etc/mtab is a normal file that is updated by the mount program whenever file systems are mounted or unmounted. Here is a sample /etc/mtab:

[root@localhost ~]# cat /etc/mtab   
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0  
proc /proc proc rw 0 0  
sysfs /sys sysfs rw 0 0  
devpts /dev/pts devpts rw,gid=5,mode=620 0 0  
/dev/sda1 /boot ext3 rw 0 0  
tmpfs /dev/shm tmpfs rw 0 0  
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0  
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0  
/dnsdata_reiser4/dns_project /dns_project nfs rw,noexec,nosuid,nodev,bg,soft,noacl,nocto,rsize=32768,wsize=32768,addr=192.168.146.155 0 0  
/dnsdata_reiser4/dns_project/database /database nfs rw,noexec,nosuid,nodev,bg,soft,noacl,nocto,rsize=32768,wsize=32768,addr=192.168.146.155 0 0 

Note

The /etc/mtab file is meant to be used to display the status of currently-mounted file systems only. It should not be manually modified.

Each line represents a file system that is currently mounted and contains the following fields (from left to right):

  • The device specification
  • The mount point
  • The file system type
  • Whether the file system is mounted read-only (ro) or read-write (rw), along with any other mount options

发表评论