Mint 19: fstab network mounts not working - probably because network not up until user logs in

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
User avatar
bernd.wechner
Level 3
Level 3
Posts: 141
Joined: Sat Sep 05, 2015 6:22 am

Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by bernd.wechner »

I've just installed Mint 19 on a new SSD. On Mint 18 I had a pile of network mounts coded in /etc/fstab.

On Mint 19 I'm finding a familiar problem (as in I had this with Mint 18 when I first used it), namely that I log in and these /etc/fstab network mounts are not mounted. Easy fixed I just have to type sudo mount -a in a terminal window and they appear.

Now from memory in Mint 18 (a long time ago now) I concluded (and was advised) that the network manager doesn't bring the cabled ethernet link up until after logging in. It was eth0 then and is eno1 lately. So that is my premise this time round too. That the reason they are not mounded is because when /etc/fstab is processed the network is not up yet.

Only this time I would like to try something new, that is, keep the network manager installed (for a few other reasons). It's not crucial but I'd rather look for a solution that includes it.

I notice that this is all now done under netplan: https://netplan.io/

and Network Manager is handed the reigns in:

Code: Select all

$ cat /etc/netplan/1-network-manager-all.yaml 
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
Great, but what I'd like is something slightly different more like:

Code: Select all

$ cat /etc/netplan/1-network-manager-all-but-eno1.yaml 
# Let NetworkManager manage all devices on this system except for the cabled ethernet link eno1 which we bring up at boot time
[What goes here?]
For [What goes here] I'm thinking:

Code: Select all

network:
    ethernets:
        eno1:
            addresses: []
            dhcp4: true
            optional: true
    version: 2
    renderer: NetworkManager
But I'm guessing blindly just comparing with an Ubuntu 18.04 server I have ;-).

I would like to understand better how to mix network manager with an ethernet link that is up at boot time so network drives mount successfully. Is that even possible, sensible or what?

I will of course do some reading at neplan.io but wanted to raise the question here too to see if ther eis experience out there that can be shared and to have the story/use-case on record in these forums I guess.

Reasons I'd like to try and mix these is that I work a fair bit with a VPN and also with a Wifi dongle on this box and I historically work with these all through system configs I guess but really like the idea of seeing them in my sys tray too. In short I like the idea of the network manager a lot, I just wish it had a clearly easily configurable way of starting at boot time and raising the wired network not at login time.

And perhaps such a things is doable and easy but I have'nt fallen over any clear documentation. Alas networking on Linux is a convoluted mess of different systems at play in my experience, mixes of network manager, systemd.network, upstart, systemd, netplan and more and getting one's head around this nest of things is not trivial to say the least, but this use case here I figure must be a fairly common desktop one. I mean I just want my NAS drives mounted at boot so I a) don't have to mount them manually and b) can access them in other other run contexts I guess (during startup, from daemons running when I'm not logged in etc).
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.
User avatar
bernd.wechner
Level 3
Level 3
Posts: 141
Joined: Sat Sep 05, 2015 6:22 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by bernd.wechner »

Seriously? Not a soul in the Mint community with any smarts in this space willing to share? I guess I'll move it over to AskUbuntu ...
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by altair4 »

On Mint 19 I'm finding a familiar problem (as in I had this with Mint 18 when I first used it), namely that I log in and these /etc/fstab network mounts are not mounted. Easy fixed I just have to type sudo mount -a in a terminal window and they appear.
Replace "gksu gedit" with "sudo -H xed":
altair4 wrote: Sat Jun 25, 2016 1:29 pm A couple of ideas:

** Create a script:

Code: Select all

gksu gedit /etc/network/if-up.d/fstab
** With this content:

Code: Select all

#!/bin/sh
mount -a
** Make it executable:

Code: Select all

sudo chmod +x /etc/network/if-up.d/fstab
Or ... and this isn't really making them mount at boot:

Add two more options to your list: noauto and user. For example:
//192.168.n.nnn/backup /media/username/nas cifs username=admin,password=password,sec=ntlm,noauto,user 0 0
noauto = will make it so it doesn’t mount at boot which seems counter-intuitive but ...
user = allows a regular user to mount - and later unmount - the share rather than root.
Since the mount points are already under /media a device icon will be created on the side panel of your file manager and other places.

When you boot into your system the shares will not be mounted but if you select the icon on the side panel of your file manager or pretty much any other application like gedit's "Open" and "Save" for example the system will use the instructions in fstab and mount it on demand seamlessly without any other intervention on your part.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
gm10

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by gm10 »

altair4 wrote: Tue Jul 10, 2018 7:50 am Replace "gksu gedit" with "sudo -H xed":
Actually xed admin://<path/file> is the polkit compatible variant of doing it now.
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by altair4 »

The problem is I can never remember the syntax. It's simple enough so it must be stubbornness on my part.

As a Xubuntu user I don't have to use it since pkexec is a one to one replacement for gksu for it's default text editor and file manager. If I had the same problem with mousepad in Xunbuntu that Mint has with xed then I would think the admin:// approach would be memorized by now.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
gm10

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by gm10 »

altair4 wrote: Tue Jul 10, 2018 8:56 am As a Xubuntu user I don't have to use it since pkexec is a one to one replacement for gksu for it's default text editor and file manager. If I had the same problem with mousepad in Xunbuntu that Mint has with xed then I would think the admin:// approach would be memorized by now.
pkexec xed still worked in the Mint 19 beta, it's all a question of supplying the proper policy file now. Besides, there's always sudoedit (aka sudo nano), was nothing ever wrong with that one.
User avatar
bernd.wechner
Level 3
Level 3
Posts: 141
Joined: Sat Sep 05, 2015 6:22 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by bernd.wechner »

Hey, thanks so much fro dropping a line. I'd been waiting patiently for a while. Just checked in again. Oddly didn't get an email notification so will have to check on that.

Still, alas hooking into ifup can't really solve the issue. The problem is the if does not go up! Until I've logged in.

The solution you suggest is in fact fine for saving me the hassle of doing

Code: Select all

mount -a
after I log in yes. But that is not in fact the biggest problem. The bigger problem is I need these network drives mounted even when I am not logged in! And I can do that, easy really, I just turn off the network manager, and I force the if up on boot. From memory it's as simple as adding to /etc/network/interfaces:

Code: Select all

auto eno1
iface eno1 inet dhcp
But the problem is I want to use the network manager (for other reasons). I don't need to. In fact I never have. I'd just like to.

Oddly I'm puzzled now why I can't use network manager AND put those lines /etc/network/interfaces. I might try that. I think I have tried it in past and it didn't work. But worth checking again. Still part of me wants to understand how to use netplan (https://netplan.io/) which is now stock standard on Mint 19, to have the wired interface come up on boot while keeping Network Manager active, so I could turn it off, and connect with wireless for example using a nice GUI.
gm10

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by gm10 »

Just a thought: Your NetworkManager connection does have the boxes checked for automatically connecting and allowing all users to connect, right? Because if it's user-specific you'd indeed have to log in first.
User avatar
bernd.wechner
Level 3
Level 3
Posts: 141
Joined: Sat Sep 05, 2015 6:22 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by bernd.wechner »

Well, just tried that and two surprising issues:

1) When I reboot and log on, on a console (ALT_CTRL+1), the mounts where not mounted. Forgot to check if eno1 was up. Will do that next. Reboots meen bye by, until done then back here ;-).

2) On NetworkManager The Wired Interface is now listed as unmanaged. That rings a loud bell and I'm pretty sure I should have expected. And this pains me. I'd like to bring it up on boot, but be able to log on and turn it off (bring it down) with network manager.
User avatar
bernd.wechner
Level 3
Level 3
Posts: 141
Joined: Sat Sep 05, 2015 6:22 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by bernd.wechner »

Just rebooted and checked. The eno1 interface is up on boot. Great. Just as needed.

The Wired interface is listed as unmanaged. Not desirable. Wish Network Manager would let me manage it. Looking for way to do that.

So:
gm10 wrote: Mon Jul 30, 2018 8:49 am Just a thought: Your NetworkManager connection does have the boxes checked for automatically connecting and allowing all users to connect, right? Because if it's user-specific you'd indeed have to log in first.
Hmmm, I don't see any such boxes. But then I'm not sure where to look. So I had a poke around. I see two dialogs accessible from the Network Manager systray icon:

Network Settings
Network Connections

On the latter I see the wired link and can double click it raising anew dialog box and on its General Tab I do see "All users may connect to this network" checked.

So I guess I should reset /etc/network/interfaces to default and come back and look at that box and check it if it's not checked and then reboot again and see. Load of boot cycles here.
User avatar
bernd.wechner
Level 3
Level 3
Posts: 141
Joined: Sat Sep 05, 2015 6:22 am

Re: Mint 19: fstab network mounts not working - probably because network not up until user logs in

Post by bernd.wechner »

Done. Reset /etc/network/interfaces ... conifirmed on console that net was not up after boot. Confirmed that it came up after X login only.Confirmed that Wired interface is now listed on network manager, (I can turn it on and off, it's not listed as unmanaged), but also note that on Network Settings for the Wired Interface on the general Tab and "All users may connect to this network" is checked.

Still it seems if managed the interface is brought up by Network Manager only on an X login. Not on boot.

I'd like to bring it up on boot. And still be able to manage it. This is looking tricky. How to bring up the network and still have Network Manager manage it (from a different start state is all, up, not down).
Locked

Return to “Networking”