Laptop won't Mount USB NAS drive on Boot Up

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
88+richard m
Level 1
Level 1
Posts: 35
Joined: Thu Jul 15, 2021 4:21 pm

Laptop won't Mount USB NAS drive on Boot Up

Post by 88+richard m »

I have installed the latest version of LM on a Lenovo IdeaPad S340. Everything is working fine except that the laptop will not mount my NAS drive.
I had the same problem with my desktop computer and it was solved by inserting the following line in /etc/fstab:

//192.168.1.1/network /media/NAS cifs guest,uid=1000,vers=1.0

I have added this line to fstab on the laptop, but it simply does not work. Somehow, the computer "knows" that the NAS folder is supposed to be a drive because if I double click on the NAS folder icon, it responds with a message "Unable to mount NAS - mount:/media/NAS:operation permitted for root only".

Note: I can ping 192.168.1.1 from the laptop and I get a reasonably fast response. I also tried to mount the NAS drive from the terminal, but i obviously don't understand that process either.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
88+richard m
Level 1
Level 1
Posts: 35
Joined: Thu Jul 15, 2021 4:21 pm

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by 88+richard m »

OOPS mea culpa -- apparently the line I added to the fstab works -- sort of. Once the system has booted, if I execute "sudo mount -a", the NAS is mounted and seems to function as required. So, the question only remains -- Why does the desktop mount the drive on boot up and it shows up on the desktop display, while the laptop requires the extra step with the terminal -- could it be a timing issue?? Any help greatly appreciated.
legacypowers
Level 4
Level 4
Posts: 270
Joined: Sat Dec 19, 2020 8:53 am

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by legacypowers »

88+richard m wrote: Sat Dec 04, 2021 6:25 pm OOPS mea culpa -- apparently the line I added to the fstab works -- sort of. Once the system has booted, if I execute "sudo mount -a", the NAS is mounted and seems to function as required. So, the question only remains -- Why does the desktop mount the drive on boot up and it shows up on the desktop display, while the laptop requires the extra step with the terminal -- could it be a timing issue?? Any help greatly appreciated.
I'm not sure, but you tried with on your desktop using a wired network connection right? if you do the same on your laptop(using a wired network connection) it still behaving like you mentioned?
Terminal - zsh wrote: ╭─legacy@forums.linuxmint.com
╰─➜ _
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by altair4 »

Why does the desktop mount the drive on boot up and it shows up on the desktop display, while the laptop requires the extra step with the terminal -- could it be a timing issue??
Yes it's a timing issue.

One option around this issue is to add noauto,user to your list of options in fstab.

[1] Unmount the share:

Code: Select all

sudo umount /media/NAS
[2] Change this:
//192.168.1.1/network /media/NAS cifs guest,uid=1000,vers=1.0 0 0
To this:
//192.168.1.1/network /media/NAS cifs guest,uid=1000,vers=1.0,noauto,user 0 0
[3] Then make systemd happy:

Code: Select all

sudo systemctl daemon-reload

Code: Select all

sudo systemctl restart remote-fs.target
The way this works is when the system boots it does not mount the remote share automatically noauto. Instead it will create a mount laucher on the desktop and on the side panel of your file manager that when selected will mount the share with the instructions in fstab - as an ordinary user user so sudo is not required.

Another option is a systemd automount which also does not mount at boot but will mount more seamlessly than the above option. You will have to change your mount point to be somewhere other than under /media or your home directory so it depends on how you are using this remote share.

Something like this:

Code: Select all

//192.168.1.1/network /mnt/NAS cifs guest,uid=1000,vers=1.0,noauto,x-systemd.automount 0 0
Followed by the systemctl commands.

This works "on contact". Anything accessing the /mnt/NAS folder will initiate the mount.

This method does not create an icon on the desktop or in the file manager.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by AndyMH »

altair4, thought you'd respond on this one. Could you also use x-systemd.requires= so it waits until the network is up, although I don't know what the dependency is that you would specify?
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by altair4 »

I've seen x-systemd.requires used as a dependency to make sure that something is mounted before something else is mounted. Never for a network up status...

Truth is systemd is supposed to know based on the filesystem type ( like cifs ) that the network is supposed to up first but that doesn't seem to work. _netdev was an option used since forever but that doesn't seem to do anything now. I've also seen x-systemd.after=network-online.target used ....

I think the problem with all of these is what we think of as the network up - meaning I can actually access something else in the network - and what systemd thinks of as network up - meaning all of the dependent services are up and running - are two different things.

I prefer a more direct approach to mount as needed rather than rely on something that appears to be dependent on humidity levels and sun spot activity. But that's just me. Whatever works in your situation is the way to go.
Last edited by altair4 on Sun Dec 05, 2021 11:05 am, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by AndyMH »

Thanks for that, know my way round the standard fstab options, but have found the x-systemd options a bit opaque.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
88+richard m
Level 1
Level 1
Posts: 35
Joined: Thu Jul 15, 2021 4:21 pm

Re: Laptop won't Mount USB NAS drive on Boot Up

Post by 88+richard m »

Thanks to everyone for the responses. I will work through all of these suggestions over the next few days.
My practical side tells me to simply accept the additional step to access the NAS. My research scientist side is still curious as to why my two Linux Mint boxes respond so differently.
The desktop system and the laptop are currently located within two feet of one another. All networking is via wireless as they are in a different building from the one where the router is located. The ONLY difference is that the desktop has a dongle with a big antenna and the laptop relies upon its crummy built in antenna. Hence, the desktop is running on 5.8 GHz and the laptop is running on 2.4 GHz.
The router is on at all times and is even on a UPS, so there has never been a problem for the desktop to locate and mount the NAS at boot up.

Again, many thanks for the information.
Locked

Return to “Networking”