*内容 [#v04566f1]
-NFS関係の設定
---------------------------
* サーバー・クライアント共通の設定 [#mc2a5238]
- portmapが動作していることを確認
# rpcinfo -u localhost portmap
*サーバー側の設定 [#o3eedcf4]
- /etc/exportsを設定
-- 最近のバージョンはsync/asyncを明示しないと警告が出るようになった。
/home neworder(rw,sync)
/mnt/cdrom neworder(ro,sync)
- /etc/exportsを書き換えたらnfsdを再起動
/etc/rc.d/init.d/nfs restart
exportfs -ar
- /etc/hosts.allowでマウントを許可する
portmap: XXX.XXX.XXX.XXX
** iptablesの設定 [#p3a81f30]
Vine 4.1の場合、iptablesでポートが塞がれているので設定する必要がある。
- /etc/sysconfig/nfsを新規に作成します。
LOCKD_PORT=XXXX
STATD_PORT=YYYY
MOUNTD_PORT=ZZZZ
- /etc/sysconfig/iptablesの設定を変更
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 111,XXXX,YYYY,ZZZZ -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp -m multiport --dports 111,XXXX,YYYY,ZZZZ -j ACCEPT
*** /etc/exportsの書式 [#p0d578b5]
- ()の中は,ro(read only) rw(read and write)
- クライアントのrootに書き込み権を渡したい場合は(no_root_squash)を付記
* クライアントの設定 [#zb72c384]
- ちゃんとexportされているのか確認
showmount -e サーバー名
** autofsの設定 [#e5078a40]
$ mkdir /mnt/auto
- /etc/auto.masterの編集
# Sample auto.master file # Format of this file:
# mountpoint map options # For details of the format look at autofs(8).
/mnt/auto /etc/auto.misc rsize=8192, wsize=8192 --timeout 180
/etc/auto.miscの編集
cdrom -fstype=iso9660,ro,user :/dev/cdrom
floppy -fstype=auto,rw :/dev/fd0
#
neworder neworder:/home
* うまく動作しなかったとき [#ic2cec54]
** サ−バ−側 [#od54bd94]
- /etc/exportsの内容を変更した場合
exportfs -ar
- iptables等firewallを疑う
** クライアント側 [#gb1d6661]
showmount -e [server name]
を実行し,確認.
*関連リンク [#k85f221d]
- http://yang.amp.i.kyoto-u.ac.jp/~yyama/Linux/NFS.html
- http://warp.syns.net/14/index.html
- http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ja/ref-guide/s1-nfs-client-config.html