NFSでマウントするとnobodyになる

NFSでマウントした先で、ファイルのownerがnobodyに

書き換えられる問題に対処する方法です。

 

・前提

 CentOS6.6

 NFSv4

 

・NFSサーバのexportsの設定を下記の通りとする。

 

  # vi /etc/exports

 --------------------------------------------------------

 /exports/share 192.168.xxx.0/24(rw,no_subtree_check,no_root_squash,fsid=0,crossmnt)

 --------------------------------------------------------

 ※fsid=0, cossmnt とすること。

 

 サーバを再起動する。

 # /etc/rc.d/init.d/nfs restart

 # /etc/rc.d/init.d/rpcbind restart

 # /etc/rc.d/init.d/rpcidmapd restart

 

・クライアント側

 # mount -t nfs 192.168.xxx.xxx:/export/share /mnt/share

 

 下記のエラーがメッセージが表示されたら、「rpcbind」を再起動する。

 

 --------------------------------------------------------

 mount.nfs: rpc.statd is not running but is required for remote locking.

 mount.nfs: Either use '-o nolock' to keep locks local, or start statd.

 mount.nfs: an incorrect mount option was specified

 --------------------------------------------------------

 

 # /etc/rc.d/init/rpcbind restart

 

以上の操作で完了です。

 

 

写真素材のピクスタ