私はしばらくNFSで奇妙な問題に直面しました。一見すると、ランダムなディレクトリサブセット(常に同じ)は、NFSマウント後に/
古いファイルハンドルとして表示され続けます。
ランダムに見える問題ディレクトリセットを明示的にエクスポートして問題を解決できましたが、時々エクスポートにランダムディレクトリを追加する必要がないように問題をより完全に解決できることを確認したいと思います。テーブル。
以下では、開いたファイルハンドルが表示されないファイルシステムをマウントしてls
からlsof
。明確にするために、コマンド間に空行が追加されました。
# mount -t nfs -o vers=4,noac,hard,intr 192.168.0.2:/ /nfs -vvv
mount.nfs: trying text-based options 'vers=4,noac,hard,intr,addr=192.168.0.2,clientaddr=192.168.0.4'
192.168.0.2:/ on /nfs type nfs (rw,vers=4,noac,hard,intr)
# lsof | grep /nfs
# ls -lh /nfs
ls: cannot access /nfs/usr: Stale file handle
ls: cannot access /nfs/root: Stale file handle
ls: cannot access /nfs/etc: Stale file handle
ls: cannot access /nfs/home: Stale file handle
lrwxrwxrwx 1 root root 7 Mar 27 2017 bin -> usr/bin
drwxr-xr-x 6 root root 16K Jan 1 1970 boot
drwxr-xr-x 438 i336 users 36K Feb 28 12:12 data
drwxr-xr-x 2 root root 4.0K Mar 14 2016 dev
d????????? ? ? ? ? ? etc
d????????? ? ? ? ? ? home
lrwxrwxrwx 1 root root 7 Mar 27 2017 lib -> usr/lib
lrwxrwxrwx 1 root root 7 Mar 27 2017 lib64 -> usr/lib
drwxr-xr-x 15 root root 4.0K Oct 15 15:51 mnt
drwxr-xr-x 2 root root 4.0K Aug 9 2017 nfs
drwxr-xr-x 14 root root 4.0K Jan 28 17:00 opt
dr-xr-xr-x 2 root root 4.0K Mar 14 2016 proc
d????????? ? ? ? ? ? root
drwxr-xr-x 2 root root 4.0K Mar 14 2016 run
lrwxrwxrwx 1 root root 7 Mar 27 2017 sbin -> usr/bin
drwxr-xr-x 6 root root 4.0K Jun 22 2016 srv
dr-xr-xr-x 2 root root 4.0K Mar 14 2016 sys
drwxrwxrwt 2 root root 4.0K Dec 10 2016 tmp
d????????? ? ? ? ? ? usr
drwxr-xr-x 15 root root 4.0K May 24 2017 var
# lsof | grep /nfs
#
問題のサブディレクトリはマウントポイントではありません。完全に正常に見えます。
$ ls -dlh /usr /root /etc /home
drwxr-xr-x 123 root root 12K Mar 3 13:34 /etc
drwxr-xr-x 7 root root 4.0K Jul 28 2017 /home
drwxrwxrwx 32 root root 4.0K Mar 3 13:55 /root
drwxr-xr-x 15 root root 4.0K Feb 24 17:48 /usr
これらのディレクトリのsyslogには関連エラーはありません。表示される唯一の情報は、他のディレクトリのセットを参照しています。
... rpc.mountd[10080]: Cannot export /proc, possibly unsupported filesystem or fsid= required
... rpc.mountd[10080]: Cannot export /dev, possibly unsupported filesystem or fsid= required
... rpc.mountd[10080]: Cannot export /sys, possibly unsupported filesystem or fsid= required
... rpc.mountd[10080]: Cannot export /tmp, possibly unsupported filesystem or fsid= required
... rpc.mountd[10080]: Cannot export /run, possibly unsupported filesystem or fsid= required
現在の状況は次のとおりです/etc/exports
。
/ *(rw,subtree_check,no_root_squash,nohide,crossmnt,fsid=0,sync)
サーバーはArch Linuxを実行し、現在のカーネルは4.10.3です。
クライアントはSlackware 14.1で、カーネルは4.1.6です。
ベストアンサー1
exports
NFS 4では、ファイルは正常に見えません。
/ *(rw,subtree_check,no_root_squash,nohide,crossmnt,fsid=0,sync)
代わりに従うべきだと思います。Arch Linuxのガイドライン
その行のためにfsid=0
。これは「いわゆるNFSルート」という特別なエクスポートを宣言します。
次に、指示に従って後続の行から独自のエクスポートを宣言します。次のようにサーバーのルートファイルシステムをエクスポートできます(NFSルートと混同しないでください)。古いGentooの投稿。