# Share NFS

建立共享目錄

<div align="left"><img src="https://529150212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lh81JtaIQ84bwQqz_Wh%2F-Lp5iPMrr9gS1UHbdAXi%2F-Lp5j2i7mNhFJKCwiAYK%2Fimage.png?alt=media&#x26;token=f1aa7360-e16e-4725-92c2-4f029fd79e0d" alt=""></div>

額外選項:subtree\_check,secure,no\_root\_squash

<div align="left"><img src="https://529150212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lh81JtaIQ84bwQqz_Wh%2F-Lp5uqLNwrUX1k22QMiq%2F-Lp5uybn25Xnt9fSO8R_%2Fimage.png?alt=media&#x26;token=60ea9496-c0d9-4cd1-946c-6d3abf8fc9ef" alt=""></div>

## NFS挂载的方法

```
sudo mkdir /NFS
mount -t nfs IP:/NFS /NFS
```

## umount  NFS 出現 device is busy。

解决方法：

1. 首先查找誰在占用：得到pid，kill -9 pid。

```
 sudo fuser /NFS
/NFS:                  317c
sudo kill -9 317
```

然后umount ,如不行 umount –f /NFS 强行卸載。

```
 sudo umount /NFS
```

```
# This configuration file is auto-generated.
# WARNING: Do not edit this file, your changes will be lost.
#
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
/export/schoolweb_home 120.115.2.0/24(fsid=1,rw,subtree_check,secure,no_root_squash)
/export/schoolweb_sites_enable 120.115.2.0/24(fsid=2,rw,subtree_check,secure,no_root_squash)
/export/schoolweb_sql 120.115.2.0/24(fsid=3,rw,subtree_check,secure,no_root_squash)
/export/schoolweb_www 120.115.2.0/24(fsid=4,rw,subtree_check,secure,no_root_squash)
# NFSv4 - pseudo filesystem root
/export 120.115.2.0/24(ro,fsid=0,root_squash,no_subtree_check,hide)
```
