差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
nfs [2017/01/10 22:49] jz |
nfs [2018/02/20 11:50] (目前版本) jz |
||
---|---|---|---|
行 7: | 行 7: | ||
create folder for exporting | create folder for exporting | ||
<code> | <code> | ||
- | mkdir -p /usr/home/nfs/public | + | mkdir -p /home/nfs/public /home/nfs/private |
- | mkdir -p /usr/home/nfs/private | + | |
</code> | </code> | ||
vi ''/etc/exports'' | vi ''/etc/exports'' | ||
<code> | <code> | ||
- | /usr/home/nfs/public -maproot=root -network=140.116.245.193/26 | + | /home/nfs/public -maproot=root -network=140.116.245.193/26 |
- | /usr/home/nfs/private -maproot=root -ro -network=140.116.245.193/26 | + | /home/nfs/private -maproot=root -ro -network=140.116.245.193/26 |
</code> | </code> | ||
行 27: | 行 26: | ||
</code> | </code> | ||
- | add following content to fstab | + | add following content to fstab, and remount by doing ''mount -a'' |
<code> | <code> | ||
/var/nfs/public /usr/home/nfs/public nullfs rw 0 0 | /var/nfs/public /usr/home/nfs/public nullfs rw 0 0 | ||
/var/nfs/private /usr/home/nfs/private nullfs rw 0 0 | /var/nfs/private /usr/home/nfs/private nullfs rw 0 0 | ||
</code> | </code> | ||
+ | |||
+ | |||
if zfs is used, edit exports at ''/etc/zfs/exports'', | if zfs is used, edit exports at ''/etc/zfs/exports'', | ||
行 60: | 行 61: | ||
====== Client ====== | ====== Client ====== | ||
- | ===== service config ===== | + | ===== Service config ===== |
<code> | <code> | ||
- | nfs_client_enable="YES" | + | sysrc nfs_client_enable="YES" |
</code> | </code> | ||
- | ==== start service ==== | + | ==== Start NFS client ==== |
- | start nfs client | ||
<code> | <code> | ||
service nfsclient start | service nfsclient start | ||
+ | </code> | ||
+ | |||
+ | ===== Mount on startup ===== | ||
+ | |||
+ | add following content into ''/etc/fstab'' | ||
+ | <code> | ||
+ | # nfs | ||
+ | 10.0.15.31:/home/nfs/public /home/nfs/public nfs rw,vers=3,proto=tcp 0 0 | ||
+ | 10.0.15.31:/home/nfs/private /home/nfs/private nfs rw,vers=3,proto=tcp 0 0 | ||
+ | </code> | ||
+ | |||
+ | create directory to be mount | ||
+ | <code bash> | ||
+ | mkdir -p /home/nfs/public /home/nfs/private | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ===== Showmount ===== | ||
+ | <code> | ||
+ | showmount <servername> -e | ||
</code> | </code> | ||