Bug 32631 - cifs not mount remote folder at boot time even when "auto" is in fstab line
Summary: cifs not mount remote folder at boot time even when "auto" is in fstab line
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Buchan Milne
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-16 20:46 CET by JollyJoker
Modified: 2024-01-07 19:36 CET (History)
3 users (show)

See Also:
Source RPM: samba,systemd
CVE:
Status comment:


Attachments

Description JollyJoker 2023-12-16 20:46:47 CET
Description of problem:

When Mageia starts, it does not auto-mount shared smb resources. Thats my fstab config:

//192.168.1.11/AAA /mnt/AAAA cifs user,gid=1000,credentials=/etc/samba/auth.192.168.1.11.usuario,uid=1000,_netdev,auto,nofail 0 0
//192.168.1.37/BBB /mnt/BBBB cifs user,gid=1000,credentials=/etc/samba/auth.192.168.1.37.usuario,uid=1000,_netdev,auto,nofail 0 0

If I use (root) command: 

mount /mnt/BBB 

It works 

Version-Release number of selected component (if applicable):
samba-4.17.12-1.mga9

How reproducible:


Steps to Reproduce:
1.
2.
3.
katnatek 2023-12-16 21:26:58 CET

CC: (none) => bgmilne

Comment 1 katnatek 2023-12-16 21:27:40 CET
@Buchan Milne , I add you to CC because you send the last update to samba
Comment 2 Morgan Leijström 2023-12-16 22:13:01 CET
@JollyJoker: is this a regression?
(did it work before last updates to samba, kernel or other parts)

CC: (none) => fri

Comment 3 JollyJoker 2023-12-16 22:15:55 CET
(In reply to Morgan Leijström from comment #2)
> @JollyJoker: is this a regression?
> (did it work before last updates to samba, kernel or other parts)

Yes, It work before last updates to samba
katnatek 2023-12-17 01:35:49 CET

Summary: SMB self-assembly does not work => cifs not mount remote folder at boot time even when "auto" is in fstab line

Comment 4 Lewis Smith 2023-12-17 21:19:53 CET
Curious that although I see that 4.17.12 is the current M9 version, I cannot see it in the Cauldron record; only 4.17.10. Never mind.

In the light of previous comments, changing Buchan from CC to Assignee.

Assignee: bugsquad => bgmilne
CC: bgmilne => (none)

Comment 5 PC LX 2024-01-06 01:47:55 CET
What does the command "systemctl --failed" show?
And the command "journalctl -b0 -u *.mount"?

CC: (none) => mageia

Comment 6 JollyJoker 2024-01-06 20:06:23 CET
(In reply to PC LX from comment #5)
> What does the command "systemctl --failed" show?
> And the command "journalctl -b0 -u *.mount"?

1.- Command:

https://privatebin.net/?8264c7e60dffb712#AiStmSZB5Nkd2DiJCBTBdZDpPtZ1JCadjc7HcxTcjiYH

2.- Command:

https://privatebin.net/?be27bb93aebd3b44#DwYdeWdz7TC9QJ8s7bcanwYCpZC9nKKYRJxnDojoiV6p
Comment 7 PC LX 2024-01-06 20:24:17 CET
From the journal:
"mount error(101): Network is unreachable"

It seem systemd is trying to mount the file system before the network is ready.

To tell systemd to make the mount after the network is online.

Try the following as root:

# systemctl edit mnt-AAA.mount

and enter the following 3 lines:

[Unit]
After=network-online.target
Wants=network-online.target


Do the above for mnt-BBB.mount also.

I think this should help with the issue.

Sometimes this does not work but it usually does.

In case the above does not work in https://systemd.io/NETWORK_ONLINE/ there is more information on the subject and a more reliable (but brute-force) way to guarantee a service is run after a network connection to a server is possible.
Comment 8 Dave Hodgins 2024-01-06 20:52:12 CET
Try adding the options ...
_netdev,x-systemd.automount,x-systemd.mount-timeout=30s,x-systemd.device-timeout=30s
to the fstab entry for the cifs mount.

CC: (none) => davidwhodgins

Comment 9 JollyJoker 2024-01-06 21:25:50 CET
(In reply to PC LX from comment #7)
> From the journal:
> "mount error(101): Network is unreachable"
> 
> It seem systemd is trying to mount the file system before the network is
> ready.
> 
> To tell systemd to make the mount after the network is online.
> 
> Try the following as root:
> 
> # systemctl edit mnt-AAA.mount
> 
> and enter the following 3 lines:
> 
> [Unit]
> After=network-online.target
> Wants=network-online.target
> 
> 
> Do the above for mnt-BBB.mount also.
> 
> I think this should help with the issue.
> 
> Sometimes this does not work but it usually does.
> 
> In case the above does not work in https://systemd.io/NETWORK_ONLINE/ there
> is more information on the subject and a more reliable (but brute-force) way
> to guarantee a service is run after a network connection to a server is
> possible.

It doesn't work for me, same result. Thanks
Comment 10 JollyJoker 2024-01-06 21:43:32 CET
(In reply to Dave Hodgins from comment #8)
> Try adding the options ...
> _netdev,x-systemd.automount,x-systemd.mount-timeout=30s,x-systemd.device-
> timeout=30s
> to the fstab entry for the cifs mount.

It works for me. 

The strange thing is that before the last samba update the units were assembled perfectly without having to add options to the fstab. 

Anyway, thanks
katnatek 2024-01-07 19:36:16 CET

Source RPM: samba-4.17.12-1.mga9 => samba,systemd


Note You need to log in before you can comment on or make changes to this bug.