カスタム検索
|
Tweet |
|
|
NFSの接続実験
(CentOS4)
Modified: 20 August 2006
サーバー側 − 共有ディレクトリの設定
サーバー側("192.168.0.94")で、共有ディレクトリを設定します。
"/etc/exports" に、共有ディレクトリと、アクセスを許可するクライアント("192.168.0.96")を指定します。
/home/tomo/source 192.168.0.96
サーバー側 − サービスの起動
以下のサービスを起動します。
# service portmap start portmap を起動中: [ OK ] # service nfs start NFS サービスを起動中: [ OK ] NFS クォータを起動中: [ OK ] NFS デーモンを起動中: [ OK ] NFS mountd を起動中: [ OK ] Starting RPC idmapd: [ OK ] #
NFS関連プロセスを確認します。
: : 1771 ? Ss 0:00 portmap 818 ? Ss 0:00 rpc.rquotad 822 ? S 0:00 [nfsd] 823 ? S 0:00 [nfsd] 824 ? S 0:00 [nfsd] 825 ? S 0:00 [nfsd] 826 ? S 0:00 [nfsd] 827 ? S 0:00 [nfsd] 828 ? S 0:00 [nfsd] 829 ? S 0:00 [nfsd] 830 ? S 0:00 [lockd] 831 ? S 0:00 [rpciod] 835 ? Ss 0:00 rpc.mountd 855 ? Ss 0:00 rpc.idmapd : :
クライアント側 − サービスの起動
portmapの起動
クライアント側では、portmap のみ起動します。
# service portmap start portmap を起動中: [ OK ] #
クライアント側 − マウントする
exportsで設定していた、ホスト名とディレクトリ名を指定して、マウントします。
# mount -t nfs 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を実行しない")を指定します。