[SOLVED] CIFS automount woes

Hello All,

So I’ve been trying to get my nas share to automount on boot and can’t get it to work. I have tried going to fstab way, which refuses to mount on boot, but if I run “mount -a” works with no issues. Tried creating a systemd service per arch’s wiki, and last tried creating a systemd.link file.

The systemd.link approach is erratic, in that it’s not working on boot, but I can get it to work after boot as well. If I run:>

[media@mediapc ~]$ udevadm test-builtin net_setup_link /sys/devices/pci0000:00/0000:00:01.3/0000:03:00.2/0000:20:01.0/0000:22:00.0/net/enp34s0
Load module index
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /usr/lib/systemd/network/80-iwd.link
Parsed configuration file /etc/systemd/network/50-wired.link
Created link configuration context.
ID_NET_DRIVER=r8169
ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
Could not set WakeOnLan of enp34s0 to magic: Operation not permitted
ethtool: could not set ethtool features for enp34s0
Could not set offload features of enp34s0: Operation not permitted
Using default interface naming scheme ‘v245’.
ID_NET_LINK_FILE=/etc/systemd/network/50-wired.link
ID_NET_NAME=enp34s0
Unload module index
Unloaded link configuration context.

So after I run it with sudo and I get:>

[media@mediapc ~]$ sudo udevadm test-builtin net_setup_link /sys/devices/pci0000:00/0000:00:01.3/0000:03:00.2/0000:20:01.0/0000:22:00.0/net/enp34s0
[sudo] password for media:
Load module index
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /usr/lib/systemd/network/80-iwd.link
Parsed configuration file /etc/systemd/network/50-wired.link
Created link configuration context.
ID_NET_DRIVER=r8169
ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
Using default interface naming scheme ‘v245’.
ID_NET_LINK_FILE=/etc/systemd/network/50-wired.link
ID_NET_NAME=enp34s0
Unload module index
Unloaded link configuration context

Can someone clue me in as to what’s going on here? It’s really a minor annoyance since it’s easy enough to manually mount the drive which is what I’ve been doing for the past few months, but since I’m stuck at the house anyways, thought I might tackle this.

This is on a desktop with an MSI X470 board, Antergos, with the Plasma DE. If any more info is needed let me know and I’ll try to get that for you. Thanks guys.

Just a thought, mounting a NAS share would require networking to be up, and it appears to me that this is delayed till NetworkManager establishes the connection.
Certainly on KDE plasma I get the notifications after logging in on my desktop.

Sorry I cannot help more, I’ve not done this stuff myself, so cannot speak with any authority.
This link may be useful,
https://wiki.archlinux.org/index.php/Systemd#Running_services_after_the_network_is_up

@daab

Any suggestion is welcomed… including that I need more sleep. I’m not sure what the hell was going through my mind when I posted this. CIFS issue is resolved by following the instructions on creating a systemd unit from: https://wiki.archlinux.org/index.php/Samba#Automatic_mounting

The “_netdev” option didn’t come up as a valid one for me. Anyways, I’ll open a different topic with the WOL issues once I get some sleep.

Hello,
I am not sure what you are trying to do for sure, but I think you are trying to setup a network share on boot-up right?
I have both of my Music and Documents on my main server and I have a CIFS setup to auto connect the shares on my fstab. If you wish I created a setup how-to that I found on Ubuntu form and modified it so it was readable for the average human. You can give it a look and see. I know this is marked “Solved” but wanted to add my 2 cents… Lol
It is on my Github here:

https://github.com/bescott9944/Setup_Network_Music

It works all the time and if the server is down you system will still boot…
Take care! :alien:
LLAP

I was trying this today and modifyinf fstab worked fine except whenever i was rebooting(msg = a stop job is running for user 1000) or waking up the system from sleep it would take exactly 2 mins…so i edited the file mentioned in the below link and evrything looks fine as of now:

I had similar options in my fstab, but the difference might be that I needed to mount the partition rw by users. At boot it wouldn’t mount, but if I ran

sudo mount -a

It would mount fine, and I’d have proper access. The only issue was getting it to mount at boot, and the “auto” option was in there. I’m fairly sure I was missing something else, that I would now notice and go “Oh that’s what was missing… I’m such an idiot”

I know some time ago I had something similar happening. If I remember correctly after it was announced that Antergos was not going to be developed anymore I tried manjaro for a bit, and I think I had it was then that my shutdowns would take 2+ mins. Don’t recall it happening while booting or waking though, but I could be mistaken about that.

I’ll have a better read to both your and @bescott9944 suggested reading and see if I can spot what I’ve been overlooking. I rather have options as far as getting things done, so I would be very much interested in getting the mount to work with fstab as an option to my current solution with a systemd unit.

here is my fstab entry which works for me at boot:-

network

//192.168.1.10/f /mnt/F cifs username=youruser,password=yourpass,uid=1000,gid=1000,rw,iocharset=utf8,_netdev,file_mode=0777,dir_mode=0777,x-systemd.automount,x-systemd.mount-timeout=30,_netdev,auto 0 0
//192.168.1.10/f/music /home/sunny/Music cifs username=youruser,password=yourpass,uid=1000,gid=1000,rw,iocharset=utf8,_netdev,file_mode=0777,dir_mode=0777,x-systemd.automount,x-systemd.mount-timeout=30,_netdev,auto 0 0

BTW my user name and password are the ones which i use to login to my windows system(on which the drive is located)
and i edited the files mentioned in:-

resolved all my problems(at least i have not faced it since yesterday)i am gonna change the auto to noauto to check something else.

1 Like

I read the Launchpad above and it is a good read. I have not had any issues booting, rebooting, or shutting down any of my systems.
I used my cifs instructions in all my fstab’s on 5 Dell laptops, 8 or 10 various desktops mosty custom builds out of junk stuff off of eBay, a few Dell desktops and 1 Acer laptop.
I run Arch, Mint, MX, EndeavourOS, Debian 10, Ubuntu, Manjaro an several other Arch and Debian based distros and have not had any issues loading the settings in my Fstab. While you can chance and set the permission in the cifs statement I don’t see any issue there either… :slight_smile: Maybe I’m just lucky don’t know…
@sunny way has most of the same commands as the article I found but I use credentials for my login/password and his is in the clear. It all works and that is the important part… Lol
Good luck @masr with the read and give my setup a read, It is in a straightforward setup… :alien: (Copy & Past)
LLAP