カスタム検索
|
Tweet |
|
|
NFSの接続実験
Modified: 17 August 2003
サーバー側 − 共有ディレクトリの設定
サーバー側("192.168.0.94")で、共有ディレクトリを設定します。
"/etc/exports" に、共有ディレクトリと、アクセスを許可するクライアント("192.168.0.96")を指定します。
/home/tomo/source 192.168.0.96
サーバー側 − サービスの起動
portmapの起動
まず、portmapを起動します。
/etc/rc.d/init.d/portmap start
nfsの起動
次に、nfsを起動します。
/etc/rc.d/init.d/nfs start
nfslockの起動
次に、nfslockを起動します。
/etc/rc.d/init.d/nfslock start
NFS関連プロセスを確認します。
: : 16835 ? S 0:00 portmap 16938 ? S 0:00 rpc.rquotad 16943 ? S 0:00 rpc.mountd 16948 ? SW 0:00 [nfsd] 16949 ? SW 0:00 [nfsd] 16950 ? SW 0:00 [nfsd] 16951 ? SW 0:00 [nfsd] 16952 ? SW 0:00 [nfsd] 16953 ? SW 0:00 [nfsd] 16954 ? SW 0:00 [nfsd] 16955 ? SW 0:00 [nfsd] 16958 ? SW 0:00 [lockd] 16959 ? SW 0:00 [rpciod] 17035 ? S 0:00 rpc.statd : :
クライアント側 − サービスの起動
portmapの起動
クライアント側では、portmap のみ起動します。
/etc/rc.d/init.d/portmap start
クライアント側 − マウントする
exportsで設定していた、ホスト名とディレクトリ名を指定して、マウントします。
# mount 192.168.0.94:/home/tomo/sources /mnt #"df" コマンドで内容を確認します。
# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/sda1 9795908 1291352 8006948 14% / none 31000 0 31000 0% /dev/shm 192.168.0.94:/home/tomo/sources 9795912 3819984 5478320 42% /mnt #
起動時にマウントさせる方法
クライアント側の "/etc/fstab"に、以下のように記述し、再起動して確認します。
192.168.0.94:/home/tomo/source /mnt nfs rw,nosuid 0 0サーバーのホスト名("192.168.0.94")、ディレクトリ名("/home/tomo/source")。
クライアント側のマウントポイント("/mnt")。
そして、オプション("rw":読み書き可能、"nosuid:suidを実行しない")を指定します。