nfs

注意 : ファイアウォールの設定によっては正しく動かない。

http://www.linux.or.jp/JF/JFdocs/NFS-HOWTO/ 参考


# chkconfig --level 345 nfs on
# chkconfig --level 345 nfslock on


server

/etc/exports に


/home 192.168.1.0/24(rw,sync)


# service nfs reload



client

/etc/fstab に次を書き足す.


[nfsServer]:/home /home nfs rw,hard,intr 0 0
※server=rh9 に対して、client=fc2 では、nfsvers=2のオプションも付けとかないとうまくいかない。



以下,その他の方法

  • a) mount server's disk (manual)

# mount -t nfs 192.168.1.101:/home [mountPoint...(ex: /mnt/home2)]

  • b) mount server's disk (auto)
    • b-1)file: /etc/auto.master


#Example
#[mountPointName1]

#add next line
/misc /etc/auto.misc

    • b-2)file: /etc/auto.misc


#Example
#[mountPointName2] -rw,intr,rsize=8192,wsize=8192 [serverName]:[shareDirectory]

#add next line
home -rw,intr,rsize=8192,wsize=8192 192.168.1.101:/home

    • b-3)command: chkconfig


# chkconfig --level 345 autofs on


192.168.1.101 の /home が、
[/etc/auto.master の mountPointName1]/[/etc/auto.misc の mountPointName2]
という名のディレクトリに、そこのディレクトリにアクセスした時点でマウントされる。
いまの例では /misc/home.

アクセスする前に、
$ls /misc
としても、/home は見えないが、
$cd /misc/home
としてやれば、見えない/misc/home -> nfsServer:/home に行ける。
/misc /etc/auto.misc