Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created September 17, 2012 12:08
Show Gist options
  • Save nekoya/3736951 to your computer and use it in GitHub Desktop.
Save nekoya/3736951 to your computer and use it in GitHub Desktop.
wiki/network/nfs

NFS server

RHEL6

sudo yum install nfs-utils.x86_64

/etc/hosts.allow, /etc/hosts.deny, /etc/exports の設定をしてnfsを上げてみる。

TX100 /home/ryo% sudo /etc/init.d/nfs start
NFS サービスを起動中:                                      [  OK  ]
NFS クォータを起動中: サービスを登録できません: RPC: 受け取れません; errno = 接続を拒否されました
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
                                                           [失敗]
NFS デーモンを起動中: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsd
                                                           [失敗]

失敗。rpcbindを先に上げておく必要があるらしい。

TX100 /home/ryo% sudo /etc/init.d/rpcbind start
rpcbind を起動中:                                          [  OK  ]
TX100 /home/ryo% sudo /etc/init.d/nfs start
NFS サービスを起動中:                                      [  OK  ]
NFS クォータを起動中:                                      [  OK  ]
NFS デーモンを起動中:                                      [  OK  ]
NFS mountd を起動中:                                       [  OK  ]
RPC idmapd を起動中:                                       [  OK  ]

configs

etc/hosts.deny

portmap: ALL
lockd:   ALL
mountd:  ALL
rquotad: ALL
statd:   ALL

/etc/hosts.allow

portmap: 192.168.10.0/255.255.255.0
lockd:   192.168.10.0/255.255.255.0
rquotad: 192.168.10.0/255.255.255.0
mountd:  192.168.10.0/255.255.255.0
statd:   192.168.10.0/255.255.255.0

etc/exports

ml115

/share    192.168.10.0/255.255.255.0(rw,no_root_squash)

op

/home     192.168.10.0/255.255.255.0(rw,no_root_squash)

etc/fstab

/dev/data/data          /share                  ext3    defaults        1 2

service

sudo /etc/init.d/nfs start
sudo chkconfig nfs on

NFS client

usage

sudo mount -t nfs ml115:/share /share

etc/fstab

/share                  /share                  nfs     defaults        0 0
op:/home                /home                   nfs     rw              0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment