Cifs経由でDFS共有をマウントするとDFS-Linkが失敗する

Cifs経由でDFS共有をマウントするとDFS-Linkが失敗する

cifsを介してDFS共有をマウントしようとしています。共有は次のように生成されます。

\\mydomain.local\FilesDFS株です。
以下のように、この共有を正常にマウントできます。

# mount -t cifs //mydomain.local/Files ~/fileserver -o username=myuser,domain=mydomain.local,password=hunter2

その後、期待通りに ~/fileserver のディレクトリを繰り返すことができます。

# ls ~/fileserver
folder1 folder2

ただし、フォルダ1にCDを挿入しようとすると、次のエラーが発生します。

# cd folder1
cd: folder1: No such file or directory

エラーが発生するまで1〜2秒かかります。
これは、フォルダ1が他のファイルサーバーへのDFSリンクであるためだと思います。 \\fileserver2.mydomain.local\Fileshare$\somedirectory\folder1

これで、次のようにdmesgを確認しました。

# dmesg
CIFS: Attempting to mount //fileserver2.mydomain.local/Fileshare/somedirectory/folder1
No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
FS-Cache: Duplicate cookie detected
FS-Cache: O-cookie c=0000000088cf85cb [p=00000000a52bce0c fl=222 nc=0 na=1]
FS-Cache: O-cookie d=00000000ff7a58d3 n=000000005109413d
FS-Cache: O-key=[5] '46696c6573'
FS-Cache: N-cookie c=00000000c39f9d7a [p=00000000a52bce0c fl=2 nc=0 na=1]
FS-Cache: N-cookie d=00000000ff7a58d3 n=00000000930f66cf
FS-Cache: N-key=[5] '46696c6573'
No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
FS-Cache: Duplicate cookie detected
FS-Cache: O-cookie c=0000000088cf85cb [p=00000000a52bce0c fl=222 nc=0 na=1]
FS-Cache: O-cookie d=00000000ff7a58d3 n=000000005109413d
FS-Cache: O-key=[5] '46696c6573'
FS-Cache: N-cookie c=000000007c6a3385 [p=00000000a52bce0c fl=2 nc=0 na=1]
FS-Cache: N-cookie d=00000000ff7a58d3 n=00000000f006535b
FS-Cache: N-key=[5] '46696c6573'
No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
CIFS VFS: \\fileserver2.mydomain.local cannot query dirs between root and final path, enabling CIFS_MOUNT_USE_PREFIX_PATH
CIFS VFS: Autodisabling the use of server inode numbers on new server.
CIFS VFS: The server doesn't seem to support them properly or the files might be on different servers (DFS).
CIFS VFS: Hardlinks will not be recognized on this mount. Consider mounting with the "noserverino" option to silence this message.
CIFS VFS: cifs_read_super: get root inode failed

共有を直接マウントする権限がないため、「ルートパスと最終パス間のディレクトリを照会できません」が実際の問題のようです。Fileshare$ただし、この共有をfileserver2に直接マウントすることもできます。 DFSの他のサーバーに接続するには、多くのコンテンツをマウントする必要があります。somedirectoryfolder1

幸いなことに、プレミアムアカウントを使用してインストールを試すことができました。できる両方にアクセスし、Fileshare$somedirectorymyuser」の代わりにそのユーザーを使用してインストールすると、フォルダ1にアクセスできます。

# mount -t cifs //mydomain.local/Files ~/fileserver -o username=adminuser,domain=mydomain.local,password=hunter2
# ls ~/fileserver/folder1
file1 file2 file3

ただし、日常的な作業にはこの昇格されたアカウントを使用できず、DFS共有またはファイルサーバーの権限を変更することもできません。

興味深いことに、smbclientは以下を介してナビゲートできますmyuser

# smbclient '\\mydomain.local\Files' -U '[email protected]'
# smb: \> ls folder1
.
..
file1
file2
file3

私はさまざまなインストールオプションを試しました(ほとんど切迫しています)。

vers=1.0
vers=3.0
noserverino
sec=ntlmv2
sec=ntlmssp

私が何を試すことができるかを知っている人はいますか?

ところで、DFS共有はWindowsサーバーにあります。

ベストアンサー1

DFS展開の既定の共有パスとは異なる共有に接続しようとすると、同様の効果が得られます。

これはカーネルのインストールが「ターゲットヒント」を認識しないと推測されます。

例:提供された共有は\\ad.example.com\dir1他のサーバーの実際の共有を指します\\server1.ad.example.com\dir1

マウントコマンド

mount -t cifs //ad.example.com/dir1 /mnt

/mnt の内容にアクセスできるようにします。

一方、\\ad.example.com\upperdir 他のサーバーの実際の共有を指すサブディレクトリ "dir2"がある共有もあります。\\server2.ad.example.com\dir2

今コマンドを使用すると

mount -t cifs //ad.example.com/upperdir /mnt

「/mnt」でサブディレクトリ「dir2」を見ることができますが、それにアクセスしようとすると、jaffexで説明したのと同じエラーが発生します(ファイルやディレクトリはありません)。

これはカーネルバージョン5.4.0を使用せず、私のUbuntu 20.04システムでのみ発生します。 ubuntu 18.04とカーネル4.15.0の同じ組み合わせを使用すると、2番目の部分も機能します。 「/proc/fs/cifs/dfscache」を見ると、サーバーが使用する正しい共有を提供しているようです。

cache entry: path=\ad.example.com\upperdir\dir2,type=link,ttl=1800,etime=779521798,interlink=no,path_consumed=31,expired=yes
\server2.ad.example.com\dir2 (target hint)

だから私はcifsカーネルモジュールの何かが新しいカーネルで異なる動作をしていると思います。

おすすめ記事