When I run sudo mount -a I get no errors and all runs OK.
However, when I reboot and try to open the mount point in caja I get an error telling me it's only available to root. If I then run mount -a again I can open it fine.
My aim is to access the share via digKam which seems to work ok but I can't figure out why I cant brows it via caja without running mount -a. Surely this is the same as running fstab at boot?
Am I going crazy ?
That’s a good question. First, I’m guessing the mount fails at boot for some reason. The permissions of /media/nasphotoshare/with nothing mounted there can give that error. After boot, try this to see if root reads it ok. I doubt it will:
sudo ls /media/nasphotoshare/
Assuming it’s not mounted, that brings up the question of why? You may get some clues from /var/log/boot.log:
cat /var/log/boot.log | grep nasphotoshare
Something like the credentials file not being accessible at that time would do it. I’d try explicit user= pass= (I forget the syntax) temporarily just to test this.
Hope this gets you looking in the right direction. I tend to be sloppy with permissions.
EDIT: For reference, here’s my working fstab entry with a few options evolved. This is working on 18.04:
Hi Bill,
Many thanks for your reply. I now have to working but only with explicit user and password in the fstab.
Going through your suggestions:
sudo ls /media/nasphotoshare/ did indeed fail. I got no error reports but it didn't return any content.
Looking at boot.log: I could see no reference to nasphotoshare at all?
I then put my username and password explicitly in the fstab line but it still didn't work
I checked all my file permissions and ownership and could see nothing amiss so I tried simple using your working example with my details. Still no good.
So with a little bit of help from google and the ubuntu forum I added 'user' option to the line and bingo, it worked.
I then removed my explicit username and password and entered the reference to .smbcredentials again. Sadly this failed so I am now back to having the user and password explicitly declared in the fstab.
So, all in all a successful day. I'm sure I'll get to the bottom of why I can't get .smbcredentials to work but I'm happy that, at least I can get it working.
Many thanks for your help.
Glad it’s working but dang, something about the .smbcredentials file remains. It’s pretty much down to format, permissions or mounting. Make sure it’s not a Windows line ending file, that got me in the past. I notice mine has “username=” but I don’t think that’s important. Egad, mine is old, dated 2011.
Good Luck!
EDIT: Logic tells me for some reason, that .smbcredentials file isn’t mounted at the fstab time for some reason. The fstab order could be involved. This is because it does work later so permissions and format should be eliminated. Let us know how it goes.
Thanks Bill, don't think it's a windows line ending as I created it in
Linux. I've had to put it on my to do list as I spent a lot of time just
getting it working. I'll get to it soon and let you know what I find.
Well, still trying to get my .smbcredentials file to work.
I have recreated the file, made sure there are no spaces where there shouldn't be and checked line feeds are OK.
I ran
I can still get it going by running sudo mount -a in a terminal but that is running as root.
Does the fstab file run as user at login time? In which case should I "the user" not have read permissions?
Still trying to get my mind round Linux and its user:group:permissions
As you say above Bill, I'm sure it's a problem with the time of running and/or who is running the fstab file but I'm just managing to confuse myself (easily done btw ;)).
Anyway, if someone could just clarify if I have the ownership and permissions set correctly please that would be a gteat start.
Regards
Clive
For security DO NOT leave it this way. This can now be edited. If it doesn’t work now, something is wrong with the file syntax or something strange with unusual characters or something is doing it.
Well this is a real head-scratcher. Root access is fine except during boot. Is your home directory a separate partition? Is it a Linux file system?
I think _netdev, which I’m sure you need, delays mounting until network comes up, so things should be pretty stable at that time. Forgive me while I’m just thinking aloud.
I wonder if it has anything to do with /media/nasphotoshare and /media having some special attention. Try /mnt/nasphotoshare maybe? I put all my mounts in /mnt.