CIFS (SMB、Samba)を快適に使いたい
この記事を作った動機 linux上で、cifsとVPNを使って自分のファイルサーバにアクセスしているのですが、以下のような不満点があり、どうしたらいいか考えてみた結果、いくつか興味深いオプジョンが見つかったので、それを記録しておくだけです。ちなみに、完全な解決とまでは行ってないですが、多少改善が見られた程度って感じです。 大きなファイルをやり取りすると、同時に他のファイル操作をしたときにもっさりする なにかと、特にvpn環境だと理由不明のファイルマネージャ等のプチフリが多発する ちょっとしたまとめ sudo mount -t cifs -o user=username,password="password",gid=1000,uid=1000,vers=3.11,multichannel,max_channels=16,compress //192.168.xxx.xxx/shareName /Path/To/Mount/Point 特に気になったオプション vers=3.11 smbプロトコルのバージョンを指定する項目で、以下のバージョンが選べる模様です。新しいほどいろんな機能が使えるようです。今回の場合は、使いたい機能が、3.11にあるので、それを指定している前提で、その他気になったオプションをリストアップします。 vers=arg SMB protocol version. Allowed values are: • 1.0 - The classic CIFS/SMBv1 protocol. • 2.0 - The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and Windows Server 2008. Note that the initial release version of Windows Vista spoke a slightly different dialect (2.000) that is not supported. • 2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2. • 3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012. • 3.02 or 3.0.2 - The SMBv3.0.2 protocol that was introduced in Microsoft Windows 8.1 and Windows Server 2012R2. • 3.1.1 or 3.11 - The SMBv3.1.1 protocol that was introduced in Microsoft Windows 10 and Windows Server 2016. • 3 - The SMBv3.0 protocol version and above. • default - Tries to negotiate the highest SMB2+ version supported by both the client and server. If no dialect is specified on mount vers=default is used. To check Di‐ alect refer to /proc/fs/cifs/DebugData Note too that while this option governs the protocol version used, not all features of each version are available. The default since v4.13.5 is for the client and server to negotiate the highest possible version greater than or equal to 2.1. In kernels prior to v4.13, the default was 1.0. For kernels between v4.13 and v4.13.5 the default is 3.0. multichannel manページを読んでいる限り、一つだけでなく複数のデータをやり取りするための、よくわかってないですが、複数のTCPセッション(複数の通信路)みたいなのを開くっぽいです。これを指定して見ると、大きなファイルを操作していても快適にファイルマネージャとか、レスポンスよくいろんなファイル操作が行える傾向にありました。一つだけの通信路では、やはり厳しいものがあるようです。 ...