====== 30 NFSサーバ ====== ====== サーバ側 ====== IP:192.168.30.250 ===== ①インストール ===== # yum install nfs-utils ===== ②nfs設定ファイル ===== 192.168.30.0/24からのみマウントさせる。 # vi /etc/exports /export/common 192.168.30.0/24(rw,async,no_root_squash) ===== ③portmapを起動する ===== # /etc/rc.d/init.d/portmap start ===== ④nfsを起動する ===== # /etc/rc.d/init.d/nfs start ===== ⑤iptableを利用している場合 ===== /etc/sysconfig/nfsへ下記を追加 STATD_PORT=32765 STATD_OUTGOING_PORT=32766 MOUNTD_PORT=32767 LOCKD_TCPPORT=32768 LOCKD_UDPPORT=32768 nfsポート(2049)、ポートマッパー(111)、上記のマウントポートなど(32765:32768)を開ける iptables -A INPUT -p tcp -m tcp -m multiport --dports 111,2049 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 32765:32768 -j ACCEPT iptables -A INPUT -p udp -m udp -m multiport --dports 111,2049 -j ACCEPT iptables -A INPUT -p udp -m udp --dport 32765:32768 -j ACCEPT ====== クライアント側 ====== IP:192.168.30.10 # mount -t nfs 192.168.30.250:/export /mnt ===== エラー1 ===== この場合NFSサーバ側 hosts.allow で開放されてない # mount -t nfs 192.168.30.250:/export /mnt mount: mount to NFS server '192.168.30.250' failed: RPC Error: Program not registered. ===== エラー2 ===== mount: wrong fs type, bad option, bad superblock on hogehogehoge, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program) In some cases useful info is found in syslog - try dmesg | tail or so ==== 対応 ==== 必要なモジュールがない。 下記をインストール。 # yum install nfs-utils ===== エラー3 ===== # mount 192.168.11.51:/work /mnt/work mount.nfs: Input/output error ==== 対応 ==== これはクライアント側で、portmapが起動してない時のエラーなのでportmapを起動 # /etc/init.d/portmap start {{tag>NFS}}