2

Following this question, CIFS randomly losing connection to Windows share , about share problems of a Debian Jessie server mounting a remote Windows CIFS dir hosted by a Windows server ;

I just found out I have like 12 times the same remote CIFS mountpoint mounted with the same name in the same dir, when doing sudo mount -a.

How can that happen? How can I prevent that?

My /etc/fstab, some mounts made with:

//10.2.1.2/XX/ZZ/YY /mnt/mount_point cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0770,dir_mode=0770,uid=1001,gid=1001 0 0

and some more with:

//10.2.1.2/XX/ZZ/YY /mnt/mount_point cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0770,dir_mode=0770,uid=1001,gid=1001,vers=2.1 0 0

Example of the multiple mountpoints:

$mount //10.2.1.2/XX/ZZ/YY on /mnt/mount_point type cifs (rw,relatime,vers=1.0,cache=strict,username=someusername,domain=XXX,uid=1001,forceuid,gid=1001,forcegid,addr=10.2.1.2,file_mode=0770,dir_mode=0770,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1) //10.2.1.2/XX/ZZ/YY on /mnt/mount_point type cifs (rw,relatime,vers=1.0,cache=strict,username=someusername,domain=XXX,uid=1001,forceuid,gid=1001,forcegid,addr=10.2.1.2,file_mode=0770,dir_mode=0770,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1) //10.2.1.2/XX/ZZ/YY on /mnt/mount_point type cifs (rw,relatime,vers=1.0,cache=strict,username=someusername,domain=XXX,uid=1001,forceuid,gid=1001,forcegid,addr=10.2.1.2,file_mode=0770,dir_mode=0770,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1) //10.2.1.2/XX/ZZ/YY on /mnt/mount_point type cifs (rw,relatime,vers=2.1,cache=strict,username=someusername,domain=XXX,uid=1001,forceuid,gid=1001,forcegid,addr=10.2.1.2,file_mode=0770,dir_mode=0770,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1) //10.2.1.2/XX/ZZ/YY on /mnt/mount_point type cifs (rw,relatime,vers=2.1,cache=strict,username=someusername,domain=XXX,uid=1001,forceuid,gid=1001,forcegid,addr=10.2.1.2,file_mode=0770,dir_mode=0770,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

3

There has been an open bug in Debian in the past, #589218 cifs-utils: "mount -a" mounts cifs shares multiple times (+1 time for each call of "mount -a")

However the general consensus seems to be this is a feature, and not a bug.

Please do avoid doing sudo mount -a when trying to recover the service, and start doing:

sudo mount -o remount -a

Otherwise, you are mounting (yet) again the remote share in your mount point.

On other hand, at least the good news is that you can unmount them in the reverse other you mounted them, and I would use as a remediation manoeuvre, n-1 times the corresponding umount command.

  • Whilst I answered my own question, I am still trying to piece together the "whys" of this being a feature in a more satisfying way than I am finding online. – Rui F Ribeiro May 30 '17 at 12:57
  • 1
    "sudo mount -o remount -a" does not fix this for me. It creates multiple mount lines, one for each time I run it just like "mount -a". One thing that might cause this is the IP-address (shows up in the "addr" mount param) always changes for me - DNS is configured to return a different one each time. Note that I am on Red Hat. – Curtis Yallop Aug 3 '17 at 20:26
  • @CurtisYallop Yeah, could be the DNS. What about doing it using the IP address? – Rui F Ribeiro Aug 3 '17 at 20:27
  • I tried using IP address and it still shows multiple mount lines. The IP address doesn't change now that I specify the IP address. The mount lines from "cat /proc/mounts | grep /mysharename" are completely identical. Kernel 3.10.0-514.26.2.el7.x86_64. I can umount them and re-mount them. – Curtis Yallop Aug 25 '17 at 20:24

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.