[SOLVED] Cannot mount network share to save my life

2 months ago by marighost to c/linuxquestions

Hello Linux gang! Hopefully this is a quick one and I'll feel like a goober after. I am trying to mount a network share on a new VM. On my first VM, this seemed to work flawlessly. Here is the fstab entry for the working VM:
//192.168.1.186/gilashare /home/marighost/gilashare cifs uid=1000,gid=1000,credentials=/home/marighost/.sharelogin,iocharset=utf8,file_mode=0777,dir_mode=0777,x-systemd.automount,_netdev 0 0

The permissions for the .sharelogin are chmod'd to be 600.

In the .sharelogin itself, I can assure you that my username and password are correct, however, my password does contain a semicolon, if that matters at all (it doesn't seem to for VM 1).

I copied these over 1:1 into my new VM, and get the following error:

mount: /home/marighost/gilashare: cannot mount //192.168.1.186/gilashare read-only. dmesg(1) may have more information after failed mount system call.

So I check dmesg | less and see:

`[565649.948728] CIFS: enabling forceuid mount option implicitly because uid= option is specified
[565649.948730] CIFS: enabling forcegid mount option implicitly because gid= option is specified
[565649.948731] CIFS: Attempting to mount //192.168.1.186/gilashare
[565649.950091] CIFS: VFS: cifs_mount failed w/return code = -13'

In searching for the solution for that return code (which doesn't really seem to map to a specific error), it seems like it's just "your password's wrong." But I can assure you that it isn't. .sharelogin on VM 2 has the same text and permissions as the file in VM 1. The fstab entries are identical. The mount points exist, each VM can see the share server and ping the IP.

I even tried mounting the share via the standard mount command with the following:
sudo mount -t cifs //192.168.1.186/gilashare /home/marighost/gilashare -o username=marighost,password=[REDACTED]

I mentioned earlier that my password contains a semicolon (;), which seems to effect Bash in ways I don't fully understand. I wrapped my password in the CLI with apostrophes (''), and the command takes, but nothing happens. Checking dmesg just shows [565649.948731] CIFS: Attempting to mount //192.168.1.186/gilashare with no errors, and the drive still does not mount.

I thank you for reading and taking the time to respond.

SOLVED EDIT: Remember to update your packages, folks. The Samba package was out of date on the file server. The reason VM1 worked is because they had the same package version. VM2 had the newer version.

BCsven 1 point 2 months ago

On the server that is failing to conect to, you've created the samba password for the user right. Which could be different from the users login password.

I'm sure you have, just that I got tripped up on that once.

And are you running SELinux on the server?

path: 0 25371354, hotness: undefined, score: 1, children: 6
marighost 1 point 2 months ago

Same password I'm afraid. I've logged in with the same password hundreds of times, as I'll access the share on my pc on occasion manually (as opposed to the auto mounting I'm trying to do), and it's the same user password across each machine.

All VMs and the samba share server running Debian. The samba share is technically a LXC, I guess.

path: 0 25371354 25374616, hotness: undefined, score: 1, children: 5
BCsven 1 point 2 months ago

Could it be a firewall issue with samba service/port blocked?

path: 0 25371354 25374616 25378674, hotness: undefined, score: 1, children: 4
marighost 1 point 2 months ago

Shouldn't be... I'm running Debian 13 on each VM without UFW, and didn't have to adjust any port blocking on VM1. VM2 can clearly see the Samba share, but the error seems to suggest that it's bad credentials, which I've checked over a dozen times now.

path: 0 25371354 25374616 25378674 25380740, hotness: undefined, score: 1, children: 3
BCsven 1 point 2 months ago

Samba package versions same on both VMs?

path: 0 25371354 25374616 25378674 25380740 25383914, hotness: undefined, score: 1, children: 2
IrateAnteater 1 point 2 months ago

The easy first step is to just remove the semicolon from your password to see if that's actually the problem.

path: 0 25357492, hotness: undefined, score: 1, children: 5
marighost 3 points 2 months ago

Changed the password on the share server to remove the semicolon. Rebooted the share server (which is also a VM), and updated the .sharelogin with the updated password. Saved, and just-in-case ran sudo systemctl daemon-reload (despite fstab not changing) and finally sudo mount -a. Same errors as mentioned in the OP, unfortunately.

path: 0 25357492 25357706, hotness: undefined, score: 3, children: 4
IrateAnteater 3 points 2 months ago

Some quick googling points to the possibility of the VM possibility defaulting to the wrong security type. You may need to add a "sec=_____" option to match whatever security type your share is using.

path: 0 25357492 25357706 25357952, hotness: undefined, score: 3, children: 3
marighost 1 point 2 months ago

Thanks for the replies. I'm not sure what the security type is, if it has a specific one. It seems strange that one VM would work without specifying the security type, while the other wouldn't. I forgot to mention that each VM is stock Debian 13.

path: 0 25357492 25357706 25357952 25358923, hotness: undefined, score: 1, children: 2
IrateAnteater 2 points 2 months ago

Just re-read your original post. Are you using the same username and password on both VMs? It might be the storage server not allowing the same user to be logged in twice. Try giving each VM a separate username and password.

path: 0 25357492 25357706 25357952 25358923 25359388, hotness: undefined, score: 2, children: 1
possiblylinux127 1 point 2 months ago

I personally wouldn't use fstab as a bad fstab or down fileshare will lead to a failed boot

I would instead use systemd mounts as they are easier to work with and can be managed like any service.

path: 0 25377753, hotness: undefined, score: 1, children: 1
marighost 1 point 2 months ago

About a week before I made this post, I did try the systemd mount by creating a service and attempted to enable it, but received a very similar error, so I gave up on that method and stuck with fstab which I know a little better. I really do not want to fuck around with systemd, to be honest.

path: 0 25377753 25380937, hotness: undefined, score: 1, children: 0
linuxquestions
linuxquestions

@lemmy.zip

login for more options
4272
313
210

Linux questions Rules (in addition of the Lemmy.zip rules)

  • stay on topic
  • be nice (no name calling)
  • do not post long blocks of text such as logs
  • do not delete your posts
  • only post questions (no information posts)

Tips for giving and receiving help

  • be as clear and specific
  • say thank you if a solution works
  • verify your solutions before posting them as facts.

Any rule violations will result in disciplinary actions

go to feed...