Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Error while loading samba network mount point during boot sequence

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Error while loading samba network mount point during boot sequence

#1 Post by MyGoul »

Hi all,

I'm facing an issue with a mount point defined in /etc/fstab during the boot sequence.

I have the following line in my /etc/fstab file :

Code: Select all

//192.168.1.60/movies /mnt/synology cifs vers=3.0,credentials=/root/.synocred 0 0
During the boot sequence I have the following error :

Code: Select all

[    2.754120] CIFS: Attempting to mount \\192.168.1.60\movies
[    2.754150] CIFS: VFS: Error connecting to socket. Aborting operation.
[    2.754172] CIFS: VFS: cifs_mount failed w/return code = -101
Once I'm connected after the boot sequence if I run command

Code: Select all

mount -a
the CIFS shared is correctly mounted.

It seems that system try to do mount before having network access.

How can I get around this problem ?

Debian version : 12.5
Running environment : VM running on top of proxmox

Thanks in advance.
Last edited by MyGoul on 2024-05-04 10:51, edited 3 times in total.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 681
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 89 times
Been thanked: 110 times

Re: Error while loading mount point during boot sequence

#2 Post by wizard10000 »

MyGoul wrote: 2024-05-03 16:32...It seems that system try to do mount before having network access.

How can I get around this problem ?
Add _netdev to your mount options in fstab. That will tell the system to wait for the network before attempting to mount the share.

Hope this helps -
we see things not as they are, but as we are.
-- anais nin

MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Re: Error while loading mount point during boot sequence

#3 Post by MyGoul »

It sounds like a very good idea, I changed the line accordingly :

Code: Select all

//192.168.1.60/movies /mnt/synology cifs vers=3.0,_netdev,credentials=/root/.synocred 0 0
But i still have the same issue...

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 681
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 89 times
Been thanked: 110 times

Re: Error while loading mount point during boot sequence

#4 Post by wizard10000 »

Does the share mount successfully if you do a manual mount?
we see things not as they are, but as we are.
-- anais nin

MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Re: Error while loading mount point during boot sequence

#5 Post by MyGoul »

The command :

Code: Select all

mount -a 
works like a charm !

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2148
Joined: 2010-06-07 16:59
Has thanked: 39 times
Been thanked: 233 times

Re: Error while loading mount point during boot sequence

#6 Post by FreewheelinFrank »

MyGoul wrote: 2024-05-03 17:48
works like a charm !
What do you expect from a wizard? :lol:

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 681
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 89 times
Been thanked: 110 times

Re: Error while loading mount point during boot sequence

#7 Post by wizard10000 »

Okay, next can you please just type "mount" in a terminal window and paste the relevant line here? I'm looking to see which mount options were actually applied. We don't need all the output, just the output for this share.
we see things not as they are, but as we are.
-- anais nin

MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Re: Error while loading mount point during boot sequence

#8 Post by MyGoul »

Here is hte outcome of the mount command :

Code: Select all

//192.168.1.60/movies on /mnt/synology type cifs (rw,relatime,vers=3.0,cache=strict,username=Proxmox,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.60,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1,_netdev)

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 681
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 89 times
Been thanked: 110 times

Re: Error while loading mount point during boot sequence

#9 Post by wizard10000 »

That all looks good - the error 101 in OP means the network is unreachable but we fixed that with the _netdev thing and the share should have mounted. SMB isn't my strong suit, let's see if anybody else has ideas.
we see things not as they are, but as we are.
-- anais nin

MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Re: Error while loading mount point during boot sequence

#10 Post by MyGoul »

I found several people struggling with similar issue, even several years ago without finding any real solution.

This option actually works : https://anteru.net/blog/2019/automatic- ... g-systemd/

But I must admit I'd like to understand how to fix the other way.
Last edited by MyGoul on 2024-05-03 18:30, edited 1 time in total.

Aki
Global Moderator
Global Moderator
Posts: 3103
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 77 times
Been thanked: 419 times

Re: Error while loading mount point during boot sequence

#11 Post by Aki »

@MyGoul:
What about the x-systemd.after=network-online.target fstab option ?

edit: by the way, it might be useful to other readers to specify in the subject of the first message that the topic is about network mount points; i.e.:
Error while loading network mount point during boot sequence
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Re: Error while loading mount point during boot sequence

#12 Post by MyGoul »

Aki wrote: 2024-05-03 19:58 @MyGoul:
What about the x-systemd.after=network-online.target fstab option ?

edit: by the way, it might be useful to other readers to specify in the subject of the first message that the topic is about network mount points; i.e.:
Error while loading network mount point during boot sequence
Did the change, same behaviour, result of the mount command after I did the mount -a command manually after the reboot :

Code: Select all

//192.168.1.60/movies on /mnt/synology type cifs (rw,relatime,vers=3.0,cache=strict,username=Proxmox,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.60,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1,_netdev,x-systemd.after=network-online.target)
Not sure to understand your comment about the title, did you change it ? I don't remember what I wrote first but it seems to fulfill your request ?
Last edited by MyGoul on 2024-05-03 20:28, edited 2 times in total.

Aki
Global Moderator
Global Moderator
Posts: 3103
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 77 times
Been thanked: 419 times

Re: Error while loading mount point during boot sequence

#13 Post by Aki »

MyGoul wrote: 2024-05-03 20:26 Not sure to understand your comment about the title, did you change it ? I don't remember what I wrote first but it seems to fulfill your request ?
I was asking you to update the subject of the first post, so that other users with similar questions can easily spot this discussion; the subject could be: [Solved] Error while loading samba network mount point during boot sequence
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

MyGoul
Posts: 5
Joined: 2024-05-03 16:07

Re: Error while loading samba network mount point during boot sequence

#14 Post by MyGoul »

Changed as requested but not marked as [solved] :wink:

Aki
Global Moderator
Global Moderator
Posts: 3103
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 77 times
Been thanked: 419 times

Re: Error while loading mount point during boot sequence

#15 Post by Aki »

Hello @MyGoul,
MyGoul wrote: 2024-05-03 18:29 [..] I'd like to understand how to fix the other way.
Quite an interesting topic, a very common question.

I did some tests using two Debian 12.5 installations (both using wired network interfaces statically configured with ifupdown):
  1. a virtual machine operating as SMB/CIFS server
  2. a virtual machine operating as CIFS client (with cifs-utils package installed)
First of all, I set up the /etc/fstab configuration as in your first post in the CIFS client (I used the same filename for credentials and the same CIFS options, but different sharename and mountpoint):

Code: Select all

//192.168.122.155/homes	/mnt cifs vers=3.0,credentials=/root/.synocred 0 0
After rebooting, it worked fine:

Code: Select all

$ su -l -c "journalctl -b -g mnt\|cifs"
Password: 
May 05 21:52:16 debian-bookworm systemd[1]: Mounting mnt.mount - /mnt...
May 05 21:52:17 debian-bookworm kernel: Key type cifs.spnego registered
May 05 21:52:17 debian-bookworm kernel: Key type cifs.idmap registered
May 05 21:52:17 debian-bookworm kernel: CIFS: Attempting to mount \\192.168.122.155\homes
May 05 21:52:18 debian-bookworm systemd[1]: Mounted mnt.mount - /mnt
I suppose it happened because the network connection was established very quickly by both server and client (both with static configuration for a wired connection) and, at the same time, my CIFS client was a little bit slower at booting then yours (IIRC, your last log recorded a failed CIFS mount attempt after 2 seconds since boot!).

Then, I changed the /etc/fstab configuration in the CIFS client according to [1][2]; it should activate the same services as you reported in your previous post:

Code: Select all

//192.168.122.155/homes	/mnt	cifs	vers=3.0,credentials=/root/.synocred,_netdev, nofail,x-systemd.automount	0	0
I tested the latter with the same previous client/server conditions and it worked:

Code: Select all

$ su -l -c "journalctl -b -g mnt\|cifs"
Password: 
May 05 22:13:04 debian-bookworm systemd[1]: Mounting mnt.mount - /mnt...
May 05 22:13:06 debian-bookworm kernel: Key type cifs.spnego registered
May 05 22:13:06 debian-bookworm kernel: Key type cifs.idmap registered
May 05 22:13:06 debian-bookworm kernel: CIFS: Attempting to mount \\192.168.122>
May 05 22:13:06 debian-bookworm systemd[1]: Mounted mnt.mount - /mnt.
Then I tested the latter configuration again, but booting the CIFS client with CIFS services stopped on the CIFS server.

This is the CIFS client log after boot:

Code: Select all

$ su -l -c "journalctl -b -g mnt\|cifs"
Password: 
May 05 22:32:21 debian-bookworm systemd[1]: Set up automount mnt.automount.
The
After that I restarted CIFS services on the CIFS server; then, I tried accessing the remote CIFS share from the client and it worked flawlessly:

Code: Select all

$ cd /mnt/
$ su -l -c "journalctl -b -g mnt\|cifs"
Password: 
May 05 22:32:21 debian-bookworm systemd[1]: Set up automount mnt.automount.
May 05 22:42:33 debian-bookworm systemd[1]: mnt.automount: Got automount reques>
May 05 22:42:33 debian-bookworm systemd[1]: Mounting mnt.mount - /mnt...
May 05 22:42:34 debian-bookworm kernel: Key type cifs.spnego registered
May 05 22:42:34 debian-bookworm kernel: Key type cifs.idmap registered
May 05 22:42:34 debian-bookworm kernel: CIFS: Attempting to mount \\192.168.122>
May 05 22:42:34 debian-bookworm systemd[1]: Mounted mnt.mount - /mnt.
-----=====------ -----=====------ -----=====------ -----=====------
Therefore, the entry in your /etc/fstab can be configured adding _netdev,nofail,x-systemd.automount parameters to the CIFS mount point share options, as:

Code: Select all

//192.168.1.60/movies /mnt/synology cifs vers=3.0,credentials=/root/.synocred,_netdev,nofail,x-systemd.automount  0 0   
The .mount and .automount systemd services you manually configured must be removed, of course.

Hope this helps. Please, let me know.


--
[1] systemd.automount — Automount unit configuration
[2] systemd.mount — Mount unit configuration

EDIT Sun 12 May 20:52:25 CEST 2024: This topic may be of interest to many users: @Best_Threads.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply