Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fstab entry (cifs) not waiting for network, making boot slow
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 324
Location: Somewhere in the 77

PostPosted: Wed Jan 22, 2025 12:24 pm    Post subject: fstab entry (cifs) not waiting for network, making boot slow Reply with quote

Hello,

On my LAN I have two machines with an entry in /etc/fstab to mount at boot an hard drive on the network (connected to my ISP routeur with Samba).

On my machine, it does the tricks perfectly with this line:

Code:
//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,rw,iocharset=utf8,uid=meself,credentials=/home/meself/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 2


As you can see, and as a side note, /home/meself/.freeboxcredentials contains the user and password needed to connect. It simply works.

But, on another desktop, having this line does not works as expected:

Code:
//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,rw,iocharset=utf8,uid=justine,credentials=/home/justine/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 2


And, finally, I switched the last column to 0 instead of 2, to ask the system to not do any checks of this remote hard disk, giving this line:

Code:
//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,x-systemd.after=network-online.target,x-systemd.mount-timeout=15,rw,iocharset=utf8,uid=justine,credentials=/home/justine/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 0


First problem: fstab does not wait for the network to be up, so it takes roughly 2 minutes to boot up. In the end, after booting up, the partition gets mounted:

Code:

$ mount
(… … …)
//192.168.1.254/Volume 3000Go 1 on /mnt/freebox type cifs (rw,relatime,vers=3.1.1,cache=strict,username=freebox,uid=1000,forceuid,gid=0,noforcegid,addr=192.168.1.254,file_mode=0660,dir_mode=0775,iocharset=utf8,soft,nounix,serverino,mapposix,reparse=nfs,rsize=65536,wsize=65536,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1,_netdev,x-systemd.after=network-online.target,x-systemd.mount-timeout=15)


Second problem: Even by adding this option below, it does not waits for network: x-systemd.after=network-online.target

Giving this line:

Code:
//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,x-systemd.after=network-online.target,rw,iocharset=utf8,uid=justine,credentials=/home/justine/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 2


Third problem: By adding another options to force the timeout to 15 seconds does not works too: x-systemd.mount-timeout=15

Giving this line:

Code:
//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,x-systemd.after=network-online.target,x-systemd.mount-timeout=15,rw,iocharset=utf8,uid=justine,credentials=/home/justine/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 2


Any ideas why these two machines, both using ethernet and with more or less the same setup (as far as I remember) it does not works ? 

If it helps, this is the full and actual fstab file on the second machine:

Code:

# EFI (Windows + Gentoo)
/dev/sda1      /efi      vfat      umask=0077      0 2
# Swap (Gentoo)
/dev/sda5      none      swap      sw         0 0
# Root (Gentoo)
/dev/sda6      /      xfs      defaults,noatime   0 1

//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,x-systemd.after=network-online.target,x-systemd.mount-timeout=15,rw,iocharset=utf8,uid=justine,credentials=/home/justine/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 2


The full dmesg of the last boot: https://bpa.st/7NXQ
(This output was made after I switched to 0 the last column of the /etc/fstab entry)

Where I guess these lines are interesting to debug:

Code:
[    7.126334] systemd-fstab-generator[668]: Checking was requested for "//192.168.1.254/Volume 3000Go 1", but it is not a device.
[    7.126496] systemd-ssh-generator[673]: → connect via 'ssh .host' locally
[    7.317929] systemd[1]: run-credentials-systemd\x2djournald.service.mount: Deactivated successfully.
[    7.319151] systemd[1]: initrd-switch-root.service: Deactivated successfully.


Code:
[  128.220063] CIFS: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.
[  128.227612] CIFS: enabling forceuid mount option implicitly because uid= option is specified
[  128.231449] CIFS: Attempting to mount //192.168.1.254/Volume 3000Go 1


Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
keekkenen
n00b
n00b


Joined: 05 Oct 2024
Posts: 32

PostPosted: Wed Jan 22, 2025 5:29 pm    Post subject: Reply with quote

kgdrenefort wrote:

On my machine, it does the tricks perfectly with this line:
Code:
//192.168.1.254/Volume\0403000Go\0401 /mnt/freebox cifs _netdev,rw,iocharset=utf8,uid=meself,credentials=/home/meself/.freeboxcredentials,file_mode=0660,dir_mode=0775 0 2

I have the same config
Code:
//192.168.0.46/video    /mnt/nas/video  cifs nofail,credentials=/root/.nas-cred,rw,iocharset=utf8,uid=ed 0 0

and it works fine. I authorize in plasma, then Wi-Fi is auto connected and I have mounted NAS resources.
kgdrenefort wrote:

Code:
[  128.220063] CIFS: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1).
To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.


Yes, I had the same message, but after changing cifs to smb3 it's go away.

I'm not sure, but maybe, your trouble related to kernel options.
_________________
7950x3d / x670e MSI Tomagawk / Sapphire RX 7800XT 16Gb / G.Skill 64Gb 5600 / A-Data Legend 960 2Tb (x2), A-Data SX8200PNP 256Gb
Back to top
View user's profile Send private message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 324
Location: Somewhere in the 77

PostPosted: Thu Jan 23, 2025 2:20 pm    Post subject: Reply with quote

[quote="keekkenen"]
kgdrenefort wrote:

kgdrenefort wrote:

Code:
[  128.220063] CIFS: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1).
To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.


Yes, I had the same message, but after changing cifs to smb3 it's go away.

I'm not sure, but maybe, your trouble related to kernel options.


Interesting, because I see CIFS is deprecated and it's better if possible to use smb3, thanks for that tip.

I don't think it'll help, nonetheless I'll try that instead of CIFS. Plus removing what below:

I'm still looking around for the issue, but as a workaround the booting taking may too much time, I added «noauto» in the option, making it not trying to be mounted at boot.

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
keekkenen
n00b
n00b


Joined: 05 Oct 2024
Posts: 32

PostPosted: Thu Jan 23, 2025 3:20 pm    Post subject: Reply with quote

kgdrenefort wrote:

Interesting, because I see CIFS is deprecated and it's better if possible to use smb3, thanks for that tip.

Oh, man, sorry for this, I misled you. It is working if mount share in console only and after rebooting I have an error
Quote:
CIFS: VFS: Error connecting to socket. Aborting operation.

I returned cifs back in my config and nas share mounted correctly.
_________________
7950x3d / x670e MSI Tomagawk / Sapphire RX 7800XT 16Gb / G.Skill 64Gb 5600 / A-Data Legend 960 2Tb (x2), A-Data SX8200PNP 256Gb
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6214
Location: Dallas area

PostPosted: Thu Jan 23, 2025 4:01 pm    Post subject: Reply with quote

Personally I wouldn't mount samba shares using fstab (auto mount),
I'd just do a mount of filesystem in something like /etc/local.d/baselayout1.start
which gets run once at the end of the boot cycle after all /etc/init.d/files get loaded.


Code:
//nas/game      /mnt/games   cifs      noauto,rw,guest,uid=don,gid=don,vers=1.0,user 0 0

_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum