Cannot setup Network NAS Mount in /home
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Re: Cannot setup Network NAS Mount in /home
Hey Altair4, when you get this.. the reason your updated fstab line didn't work (per my way) was the 'noauto' option in the line.. I was using sudo mount -a and it wasn't not working due to that.. Once I set to AUTO or removed it, it was fine and then started mounting upon 'sudo mount -a' execution.
NOW, upon rebooting, this doesn't automount though.. I'm currently looking up things that pertain to "fstab cifs is not mounting on boot" via a google search. There is a lot of stuff to sift through
https://superuser.com/questions/1244364 ... -on-reboot
I'm currently playing around with the auto & _devnet option in the line now.
Let me know if you have any ideas.. I'm still stuck trying to it to mount at restart/boot.
NOW, upon rebooting, this doesn't automount though.. I'm currently looking up things that pertain to "fstab cifs is not mounting on boot" via a google search. There is a lot of stuff to sift through
https://superuser.com/questions/1244364 ... -on-reboot
I'm currently playing around with the auto & _devnet option in the line now.
Let me know if you have any ideas.. I'm still stuck trying to it to mount at restart/boot.
Re: Cannot setup Network NAS Mount in /home
It won't automount because you have
I normally just go with
Instead of rebooting to test if it works you can
Instead of putting the password and uname in fstab you can use a credentials file, e.g.
credentials is a two line text file of the form:
you can put it wherever you want - just supply the full pathname in fstab. You still have a plain text file in the system, but you can set the permissions so it is readable only by root. An improvement, but still not brilliant.
You can replace the IP address with hostname.local, in my case
noauto
in your mount options.
Code: Select all
//192.168.50.1/download2\040\050at\040\asus_nas\051 /home/parrish/ASUS_NAS cifs user=*******,password=*********,vers=1.0,uid=1000,nounix,noauto,user 0 0
defaults,uid=1000,gid=1000,nofail
in my mount options, don't need to set the version as my NAS works with later versions of SMB. nofail
means linux won't keep trying to mount the NAS if it is not there.Instead of rebooting to test if it works you can
sudo mount -a
, this tells mint to reread and mount what it finds in fstab. Another alternative is to test with mount before changing fstab, syntax for mount is slightly different - stuff in a different order. You can have the same share mounted multiple times in the filesystem. Instead of putting the password and uname in fstab you can use a credentials file, e.g.
Code: Select all
//diskstation.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,nofail 0 0
Code: Select all
username=xxx
password=yyy
You can replace the IP address with hostname.local, in my case
diskstation.local
is the same as 192.168.0.5
. Useful if your IP address is dynamically allocated, less useful when it is the router.Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Cannot setup Network NAS Mount in /home
I have a slightly different perspective on all this - not better just different - than AndyMH.the reason your updated fstab line didn't work (per my way) was the 'noauto' option in the line.. I was using sudo mount -a and it wasn't not working due to that.. Once I set to AUTO or removed it, it was fine and then started mounting upon 'sudo mount -a' execution.
The issue for most users is that the instructions in fstab related to network shares are read and executed before the entire network stack is up and operational in Linux. Since it's not functional at the time fstab is read the mount fails. The fact that it will only mount with a
sudo mount -a
implies you fall into this problem.I use two approaches to remedy this issue:
[1] Without systemd - This is the one I suggested above.
** Create a mount point in your home directory or under /media
** This will automatically create a link on the side panel of your file manager.
** Set the mount declaration in fstab with the
noauto,user
options so that it does not mount at boot.** Require the user to open the file manager and select the link on the side panel to mount.
This solves the problem but it requires the user to use the file manager to mount.
[2] With systemd
** You need to create a mountpoint outside of your home directory or /media - something like under /mnt.
** You can create a bookmark in your file manager to the /mnt/ASUS_NAS folder if you want.
** Set the mount declaration with the options
noauto,x-systemd.automount
So for example your mount statement would look something like this:
Code: Select all
//192.168.50.1/download2\040\050at\040\asus_nas\051 /mnt/ASUS_NAS cifs user=*******,password=*********,vers=1.0,uid=1000,nounix,noauto,x-systemd.automount 0 0
Code: Select all
sudo systemctl daemon-reload
Code: Select all
sudo systemctl restart remote-fs.target
Side Note: Both of these methods assume you don't have some wacky password with special characters in it. If you do then follow AndyMH's recommendation on using a credentials file since that is your only way out.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: Cannot setup Network NAS Mount in /home
No you were right, I missed the bit about not mounting on boot,
x-systemd.automount
is not just better, it was the right answer.Quick question:
Home orYou need to create a mountpoint outside of your home directory or /media
/media/you
I understand, why not /media
?Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Cannot setup Network NAS Mount in /home
Your suggestion of this:AndyMH wrote: ⤴Mon Aug 15, 2022 4:58 am It won't automount because you havenoauto
in your mount options.I normally just go withCode: Select all
//192.168.50.1/download2\040\050at\040\asus_nas\051 /home/parrish/ASUS_NAS cifs user=*******,password=*********,vers=1.0,uid=1000,nounix,noauto,user 0 0
defaults,uid=1000,gid=1000,nofail
in my mount options, don't need to set the version as my NAS works with later versions of SMB.nofail
means linux won't keep trying to mount the NAS if it is not there.
Instead of rebooting to test if it works you cansudo mount -a
, this tells mint to reread and mount what it finds in fstab. Another alternative is to test with mount before changing fstab, syntax for mount is slightly different - stuff in a different order. You can have the same share mounted multiple times in the filesystem.
Instead of putting the password and uname in fstab you can use a credentials file, e.g.credentials is a two line text file of the form:Code: Select all
//diskstation.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,nofail 0 0
you can put it wherever you want - just supply the full pathname in fstab. You still have a plain text file in the system, but you can set the permissions so it is readable only by root. An improvement, but still not brilliant.Code: Select all
username=xxx password=yyy
You can replace the IP address with hostname.local, in my casediskstation.local
is the same as192.168.0.5
. Useful if your IP address is dynamically allocated, less useful when it is the router.
Code: Select all
//diskstation.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,nofail 0 0
sudo mount -a
[sudo] password for parrish:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
In essence back to square one... with that...
but with:
Code: Select all
/192.168.50.1/download2\040\050at\040asus_nas\051 /home/parrish/ASUS_NAS cifs credentials=/home/parrish/.smbcredentials,vers=1.0,uid=1000,nounix,nofail,user 0 0
Hey guys, i don't know if the matters but I'm in Texas, USA... not sure if anything about the installation on might be different due to the locale. I wouldn't think so BUT I'm not familiar enough with linux distros and location settings to know what all it does for a 'clean installation'.
Re: Cannot setup Network NAS Mount in /home
diskstation
is the hostname for my NAS, I'm guessing that for your router it might be rt-ax86u-11d8
so rt-ax86u-11d8.local
might work.Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Cannot setup Network NAS Mount in /home
Hey Altair,
I did try the 'x-systemd.automount' and upon reboot it didn't mount .. No error or anything, just didn't mount. again it still mounts when I run sudo mount -a. ... SO, if you guys want to throw hands up and say "I DON'T KNOW"... i wouldn't blame you .
I'm down with Altair in the boot process that....
"instructions in fstab related to network shares are read and executed before the entire network stack is up and operational in Linux."
Andy, I totally appreciate your help and suggestion on this. Getting into the FSTAB is new to me and I know I can totally mess up things if I play with the wrong line. ... but since how I'm only adding a line I'm pretty confident I won't necessarily mess that up .. hehehe..
So if you guys, want to give up I totally understand... Just let me know.. I may keep poking around on options on the 'boot process' to see if there anything that might can be done there.
Thanks again for the help suggestions... This has DEFINITELY been a great learning experience thank you guys.
I did try the 'x-systemd.automount' and upon reboot it didn't mount .. No error or anything, just didn't mount. again it still mounts when I run sudo mount -a. ... SO, if you guys want to throw hands up and say "I DON'T KNOW"... i wouldn't blame you .
I'm down with Altair in the boot process that....
"instructions in fstab related to network shares are read and executed before the entire network stack is up and operational in Linux."
Andy, I totally appreciate your help and suggestion on this. Getting into the FSTAB is new to me and I know I can totally mess up things if I play with the wrong line. ... but since how I'm only adding a line I'm pretty confident I won't necessarily mess that up .. hehehe..
So if you guys, want to give up I totally understand... Just let me know.. I may keep poking around on options on the 'boot process' to see if there anything that might can be done there.
Thanks again for the help suggestions... This has DEFINITELY been a great learning experience thank you guys.
Re: Cannot setup Network NAS Mount in /home
Ok dumb assumption here and let me know if I'm wrong.. IF sudo mount -a works and FSTAB doesn't would the name really matter in fstab? again my assumption (probably wrong) but just trying to understand the logic in this fstab.
I'll try this and report back.. Thanks
Re: Cannot setup Network NAS Mount in /home
It's just something else to try, it won't fix the mount on boot issue - altair4 provided the fix for that using
Hostname is a distraction for you as it is unlikely that the IP address of your router will change. It is useful connecting to devices where the IP address is dynamically allocated to a device by the router (the router is running a service called DCHP to do this) and the IP address may change. The hostname is fixed and is broadcast using a service called avahi or mDNS or bonjour (if you are apple).
x-systemd.automount
.Hostname is a distraction for you as it is unlikely that the IP address of your router will change. It is useful connecting to devices where the IP address is dynamically allocated to a device by the router (the router is running a service called DCHP to do this) and the IP address may change. The hostname is fixed and is broadcast using a service called avahi or mDNS or bonjour (if you are apple).
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Cannot setup Network NAS Mount in /home
So Andy, I did add this:
Code: Select all
//rt-ax86u-11d8.local/download2\040\050at\040asus_nas\051 /home/parrish/ASUS_NAS cifs credentials=/home/parrish/.smbcredentials,vers=1.0,uid=1000,nounix,nofail,user 0 0
Also I did try that x-systemd.automount... That didn't work either.. but again works with sudo mount -a ...
Ya... I know, I'm throwing my hands up at this point in time as well but i'm still plugging away at options.. hahahahaha
Re: Cannot setup Network NAS Mount in /home
When you create a mount point for something in $HOME or anywhere in /media the system automatically creates a link to it on the side panel of your file manager and the desktop if you permit it.
This action makes x-systemd.automount think it's being accessed so it tries to mount - still too early for the network stack issue.
As for this:
If you have a mount point as described someplace other than your home directory or /media and you still have the noauto,x-systemd.automount operators present in the mount statement a sudo mount -a is not necessary since it will mount when you, another process, or any application selects the /mnt/XXX folder.I did try the 'x-systemd.automount' and upon reboot it didn't mount .. No error or anything, just didn't mount. again it still mounts when I run sudo mount -a. ... SO, if you guys want to throw hands up and say "I DON'T KNOW"... i wouldn't blame you .
So instead of "I DON't KNOW" I'm going with "I really cannot reproduce this symptom".
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: Cannot setup Network NAS Mount in /home
Hey Andy, sorry I missed this... Let me try making in the /media location... sorry about that, didn't mean to miss this..AndyMH wrote: ⤴Mon Aug 15, 2022 9:16 amNo you were right, I missed the bit about not mounting on boot,x-systemd.automount
is not just better, it was the right answer.
Quick question:Home orYou need to create a mountpoint outside of your home directory or /media/media/you
I understand, why not/media
?
Re: Cannot setup Network NAS Mount in /home
AndyMH wrote: ⤴Mon Aug 15, 2022 9:16 amNo you were right, I missed the bit about not mounting on boot,x-systemd.automount
is not just better, it was the right answer.
Quick question:Home orYou need to create a mountpoint outside of your home directory or /media/media/you
I understand, why not/media
?
Code: Select all
//rt-ax86u-11d8.local/download2\040\050at\040asus_nas\051 /media cifs credentials=/home/parrish/.smbcredentials,vers=1.0,uid=1000,nounix,nofail,x-systemd.automount,user 0 0
Re: Cannot setup Network NAS Mount in /home
To your reply Altair4 about 'cannot reproduce' the issue. That is totally cool.. And trust me, I get it. hehehehe. In essence, 'cannot reproduce the issue' turns into.. 'I don't know'.. hahahaha So it is essentially one in the same. Not matter, it's all ok the fact you got me to be able to at least MOUNT IT via sudo mount -a is great enough. The mount at boot up would have been a bonus. But again, I will take what I can get and it's all good. I'm going to mark this as solved based on the title. I want to thank both you and Andy for the help and direction.. This, again, has turned into a valuable learning lesson about CIFS, Mounting & FSTAB. Thank you both.
Re: Cannot setup Network NAS Mount in /home [SOLVED]
more info to come as I'm researching more.
Last edited by Tazzin on Mon Aug 15, 2022 4:29 pm, edited 1 time in total.
Re: Cannot setup Network NAS Mount in /home
Wait for altair4, he (or she) knows a lot more about cifs mounts than me. There may be another
x-systemd.
mount option I'm not familiar with. It does sound like a timing issue. You could mount it with a mount command in your autostart preferences, but this is starting to get messy as you would need a policy kit to run mount as admin without a password and run it with pkexec (you would be running it as pkexec mount -a
instead of sudo mount -a
). Leave this as a backstop.Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Cannot setup Network NAS Mount in /home
Ok Andy thanks for the heads up. I did find a little more info (but didn't help anything) in the boot messages:AndyMH wrote: ⤴Mon Aug 15, 2022 10:57 am Wait for altair4, he (or she) knows a lot more about cifs mounts than me. There may be anotherx-systemd.
mount option I'm not familiar with. It does sound like a timing issue. You could mount it with a mount command in your autostart preferences, but this is starting to get messy as you would need a policy kit to run mount as admin without a password and run it with pkexec (you would be running it aspkexec mount -a
instead ofsudo mount -a
). Leave this as a backstop.
what I have is:
//192.168.50.1/download2\040\050at\040asus_nas\051/
Suppose to looke like this //192.168.50.1/download2 (at asus_nas)/
This works with sudo mount -a
on reboot I get this:
[ 29.539468] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
[ 29.539481] CIFS: Attempting to mount \\192.168.50.1\download2
[ 29.563835] CIFS: VFS: cifs_mount failed w/return code = -6
The path isn't complete like /download2 (at asus_nas)/
So this appears to be FSTAB not readying the octal values???
And I'm sure the 'return code = -6' is probably bad path or something cause the name isn't complete. I'm guessing. PLEASE NOTE that that message(s) are that last of the boot messages, so it appears the x-systemd.automount and/or the _netdev appears to be working as that is the last messages i get in the boot messages.
Something else I JUST ran across.. while reviewing MAN FSTAB, in "The first field (fs_spec)", there is NO MENTION of octal values to be used.. BUT in "The second field (fs_file)" here is mentions the following: ....... If the name of the mount point contains spaces or tabs these can be escaped as '\040' and '\011' respectively.
Since how sudo mount -a does mount with octal values, I'm guessing is should also read on boot??? But since how it didn't indicate that, maybe the first field doesn't read octal values on a 'boot' sequence or something.
Re: Cannot setup Network NAS Mount in /home
Running low on power again so I will leave you with this:
I created a share on a server
I added a file to folder being shared on that server:
I created a folder on my client at
I created in fstab a mount declaration to mount it as an automount:
Although I don't need to do this I rebooted the client and immediately opened up a terminal:
I've done this countless times for may people without issue. However I will admit that the usual difficulty is a space in the name of things like I describe above and not the multitude of characters in your situation.
I created a share on a server
gort
with a share name of Test Share
I added a file to folder being shared on that server:
mousepad.txt
I created a folder on my client at
/mnt/GortTestShare
to act as the mount point.I created in fstab a mount declaration to mount it as an automount:
Code: Select all
//gort.local/test\040share /mnt/GortTestShare cifs guest,uid=1000,noauto,x-systemd.automount 0 0
That's what I meant when I said I cannot reproduce your symptom.First I ran mount to see if it was mounted:
altair@sme2:~$ mount | grep cifs
It was not. That is what I wanted. A systemd automount will only mount when the mount point is accessed by the user directly or by a process or by an application.
Then I ran a command to list the contents of the mount point:
altair@sme2:~$ ls -l /mnt/GortTestShare
total 4
-rwxr-xr-x 1 altair root 4 Aug 15 17:23 mousepad.txt
The act of issuing an ls command on the mount point was enough for systemd to mount the share and display it's contents which was only the one file ( mousepad.txt ) I added to the share on the gort server.
After the ls command I can verify that the share is indeed mounted: :
altair@sme2:~$ mount | grep cifs
//gort.local/test share on /mnt/GortTestShare type cifs (rw,relatime,vers=3.1.1,sec=none,cache=strict,uid=1000,noforceuid,gid=0,noforcegid,addr=192.168.1.131,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,x-systemd.automount)
I've done this countless times for may people without issue. However I will admit that the usual difficulty is a space in the name of things like I describe above and not the multitude of characters in your situation.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: Cannot setup Network NAS Mount in /home
Hey Altair,
Thanks for the explanation of your process.. I understand your process of information and it 'not being reproducible. I get that whole heartedly . But in the essence of not being able to connect to my routers shared USB, this is whole 'I don't know thing'. The question as to why FSTAB it not recognizing the \040 and beyond??? I DON'T KNOW. . This is out of my league as I'm no where near a linux guru .. been in windows most all of my life but being in IT I have dabbled in Linux here and there and getting more and more into it . I wish Asus had made the code on the router to where it didn't have that additional spaces and ( and ) . I'd never would have probably had this issue .
Needless to say I'm plugging away at researching to see if anything will work in the meanwhile. But also in the meanwhile, I'm using sudo mount -a post boot.
Thanks again.
Thanks for the explanation of your process.. I understand your process of information and it 'not being reproducible. I get that whole heartedly . But in the essence of not being able to connect to my routers shared USB, this is whole 'I don't know thing'. The question as to why FSTAB it not recognizing the \040 and beyond??? I DON'T KNOW. . This is out of my league as I'm no where near a linux guru .. been in windows most all of my life but being in IT I have dabbled in Linux here and there and getting more and more into it . I wish Asus had made the code on the router to where it didn't have that additional spaces and ( and ) . I'd never would have probably had this issue .
Needless to say I'm plugging away at researching to see if anything will work in the meanwhile. But also in the meanwhile, I'm using sudo mount -a post boot.
Thanks again.
Re: Cannot setup Network NAS Mount in /home [SOLVED]
OK GUYS!
I got it working!
//192.168.50.1/download2\040(at\040asus_nas)/
the only thing that needed was the 'SPACES' \040... the parenthesis and the underscore are considered 'normal' characters and not special character based on the code of FSTAB and the Character Map of Linux (that's just my take on it based on how FSTAB is handling octal values vs 'normal character' values)...
The above entry automounted on reboot. So this is solved! Thank you guys so much again..
[solved]
I got it working!
//192.168.50.1/download2\040(at\040asus_nas)/
the only thing that needed was the 'SPACES' \040... the parenthesis and the underscore are considered 'normal' characters and not special character based on the code of FSTAB and the Character Map of Linux (that's just my take on it based on how FSTAB is handling octal values vs 'normal character' values)...
The above entry automounted on reboot. So this is solved! Thank you guys so much again..
[solved]