Jump to content

Fstab failing to mount CIFS share at boot on Rock64 running Armbian 23.11.1 Bookworm CLI.


Recommended Posts

I am about ready to shoot my want to be server.

I have an Ubuntu samba server running a public share on my LAN. The share has no username or password required to make it windows friendly. No other system has issues accessing it.

 

I have a new ROCK64 running Armbian 23.11.1 Bookworm CLI.

It will not mount a CIFS share at boot, but will mount it with a mount -a command.

 

Fstab entries that have not worked:

//192.168.15.150/15tb_NAS/Data/ /mnt/NAS cifs rw,user=,password=,file_mode=0777,dir_mode=0777,async,x-systemd.automount 0 0

//192.168.15.150/15tb_NAS/Data/ /mnt/NAS cifs vers=3.0,rw,user=,password=,file_mode=0777,dir_mode=0777,async,x-systemd.automount,_netdev,x-systemd.after=network-online.target 0 0

//192.168.15.150/15tb_NAS/Data/ /mnt/NAS cifs rw,user=,password=,file_mode=0777,dir_mode=0777,async,x-systemd.automount,_netdev 0 0

 

Relivant journalctl -xb output:

 

Feb 08 14:58:37 rock64 mount[1355]: mount error(101): Network is unreachable

Feb 08 14:58:37 rock64 mount[1355]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Feb 08 14:58:37 rock64 kernel: CIFS: Attempting to mount \\192.168.15.150\15tb_NAS

Feb 08 14:58:37 rock64 kernel: CIFS: VFS: Error connecting to socket. Aborting operation. Feb 08 14:58:37 rock64 kernel: CIFS: VFS: cifs_mount failed w/return code = -101

 

This looks like the network is not coming up in time, but I have tried x-systemd.automount and _netdev  and x-systemd.after=network-online.target as options to make the system wait for the network.

Shouldn't one of those fix the issue?

 

Maybe I have been looking at this to long, and can't see the forest for the trees.

Can anyone else see an issue here? I figure it's user error, but maybe there is a bug in this build?

Feel free to ask questions if something is missing, and I will provide whatever I can.

 

 

 

 

Edited by wizardknight
Link to comment
Share on other sites

So I switched to a pure Debian install, and the exact same line

//192.168.15.150/15tb_NAS/Data/ /mnt/NAS cifs rw,user=,password=,file_mode=0777,dir_mode=0777,async,x-systemd.automount 0 0

worked without issue.

I am forced to assume there is an issue with this OS.

Link to comment
Share on other sites

On 2/9/2024 at 1:18 AM, wizardknight said:

This looks like the network is not coming up in time

 

I can confirm this bug on another (Rockchip) device running Bookworm user space, but with NFS.

 

https://unix.stackexchange.com/questions/554961/nfs-mount-fails-on-boot-although-ip-address-is-configured

This comment is telling:
"After almost 2 years, this is the only one that worked! There must be a bug around network-online.target"

 

On 2/9/2024 at 1:18 AM, wizardknight said:

Feel free to ask questions if something is missing, and I will provide whatever I can.

 

Try to manually implement solutions to the OS you can find on stackexchange and others. When you get it working, look into build framework how to implement it. It seems some additional tweaking of systemd services is needed. We can maintain this OS only with your help - there are too many of issues in open source software.

Link to comment
Share on other sites

A bit necro thread, but did you try using systemd instead?

Something like:

sudo nano /etc/systemd/system/mnt-NAS.service (the name "mnt-NAS" should be your actual location you want to mount it, ie: /mnt/NAS)

[Unit]
Description=File server network mount (samba)
After=network-online.target
Requisite=network-online.target

[Mount]
What=//192.168.15.150/15tb_NAS/Data/
Where=/mnt/NAS
Type=cifs
Options=vers=3,_netdev,cache=loose,credentials=/home/YOUR_USERNAME/.smbcredentials,nofail,noatime,uid=YOUR_USERNAME,gid=YOUR_USERGROUP,dir_mode=0755,file_mode=0644
TimeoutSec=15

[Install]
WantedBy=multi-user.target

(note that I am not sure about the "what" line here. I think that has to be the same as the [name] you created in your samba server config, so this might be why it is not working properly, you will have to experiment around that)

 

Then just activate the mount to run at boot with:

systemctrl daemon-reload
systemctrl enable mnt-NAS.mount

Add --now to the enable line if you want to mount it immediately and not have to reboot.

 

If you want to unmount:

sudo systemctl stop mnt-NAS.service

 

And to start it again:

sudo systemctl start mnt-NAS.service

 

On 2/9/2024 at 1:18 AM, wizardknight said:

The share has no username or password required to make it windows friendly

 

That has nothing to do with "windows friendly" that is just a big hole in your security.

Just add a user on the windows server (I understand it as that is where you have your samba server?). IIRC you can access the old windows user manager with typing "manage" and starting the "manage computer" in the windoze start menu, you only need a local user, not a complete user with a microsoft account with email address and all. I honestly do not remember exactly how I did it, but it CAN absolutely work without problems. I think the samba user (that you add with smbpasswd -a on linux, I do not remember how to do that on windows, it was a while ago and I no longer use it, i am only looking at my old notes here) has to have the same name as the windows user you created.

I use a .smbcredentials file, but you can try without any credentials I guess.

 

Also, obv remove the fstab lines if you want to mount it using systemd instead. Just comment them out with adding a # in front of the lines.

 

Good luck!

Edited by bedna
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines