差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
nfs [2017/01/04 17:41] 127.0.0.1 |
nfs [2018/02/20 11:50] (目前版本) jz |
||
---|---|---|---|
行 5: | 行 5: | ||
===== exports ===== | ===== exports ===== | ||
- | ''/etc/exports'' | + | create folder for exporting |
<code> | <code> | ||
- | /usr/home/nfs/public -maproot=root 10.130.48.166 | + | mkdir -p /home/nfs/public /home/nfs/private |
- | /usr/home/nfs/private -maproot=root -ro 10.130.48.166 | + | |
</code> | </code> | ||
- | if exports is edited, use ''service mountd reload'' to reload | + | vi ''/etc/exports'' |
+ | <code> | ||
+ | /home/nfs/public -maproot=root -network=140.116.245.193/26 | ||
+ | /home/nfs/private -maproot=root -ro -network=140.116.245.193/26 | ||
+ | </code> | ||
+ | |||
+ | everytime exports is edited, use ''service mountd reload'' to reload | ||
+ | |||
+ | |||
+ | if ufs is used, without adding new disk, bind folder to folder like so: | ||
+ | <code> | ||
+ | mkdir -p /var/nfs/public | ||
+ | mkdir -p /var/nfs/private | ||
+ | vi /etc/fstab | ||
+ | </code> | ||
+ | |||
+ | add following content to fstab, and remount by doing ''mount -a'' | ||
+ | <code> | ||
+ | /var/nfs/public /usr/home/nfs/public nullfs rw 0 0 | ||
+ | /var/nfs/private /usr/home/nfs/private nullfs rw 0 0 | ||
+ | </code> | ||
+ | |||
if zfs is used, edit exports at ''/etc/zfs/exports'', | if zfs is used, edit exports at ''/etc/zfs/exports'', | ||
行 40: | 行 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> | ||