3

I have a series of Windows shared disks mounted on my Linux machine. I have lines like this in /etc/fstab:

//10.5.0.136/i /media/i cifs credentials=/home/trosendal/.smbcredentials,vers=2.0,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0

to mount each disk. It has worked great for years and now I get a weirdness where I get an incomplete listing of the files similarly to what was described here: Incomplete directory listing when accessing a share. Here's an illustration of the problem:

trosendal@trosendal-ThinkPad-T480:/media/i$ ls
BKT  DOA  GDK  KMF  KOM  KVT  MIK  POV  VES  VIP  VOL
trosendal@trosendal-ThinkPad-T480:/media/i$ cd ESS
trosendal@trosendal-ThinkPad-T480:/media/i/ESS$ ls
'Arkiv X'                   hso
 brevlåda                  'Model Comparison.ppt'
...

Notice that the directory ESS is missing but I can navigate to it. The same happens in emacs (dired) or in the gnome file explorer. Certain directories missing others not. Ideas?

3

The problem was apparently related to the version of the cifs protocol that I had selected in fstab. According to an excerpt of the manual

 $ man mount.cifs

 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.1.1 or 3.11 - The SMBv3.1.1 protocol that was introduced in Microsoft Windows Server 2016.

          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.

I'm not sure what server version the administrator of this disk is using and so I must have just guessed wrong at some point and not noticed the consequence. Here's an illustration of the difference when I select vers=2.0 like in the fstab line I wrote in my question above:

trosendal@trosendal-ThinkPad-T480:~$ cd /media/i/
trosendal@trosendal-ThinkPad-T480:/media/i$ ls
BKT  DOA  GDK  KMF  KOM  KVT  MIK  POV  VES  VIP  VOL

Then if I change to vers=1.0 I get the desired:

trosendal@trosendal-ThinkPad-T480:/$ ls /media/i/
trosendal@trosendal-ThinkPad-T480:/$ ls /media/i/
BKT  DOA  ESS  GDK  KMF  KOM  KVT  MIK  POV  VES  VIP  VOL

I must admit this solution feels a little hacky since I don't understand how to determine which is correct beyond trial and error. Any insight into how to troubleshoot such a situation is welcome.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.