How does fstab not have DNS resolution at the ready?

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post please read how to get help
Post Reply
mauricev
Level 1
Level 1
Posts: 3
Joined: Wed Nov 18, 2020 7:43 pm

How does fstab not have DNS resolution at the ready?

Post by mauricev »

I have fstab with the following line

Code: Select all

//reststop.montefiore.org/PUBLIC /mnt/reststop cifs credentials=/home/kelly/reststopcredentials,iocharset=utf8,sec=ntlmssp,uid=1000,gid=1000 0 0
At boot, I get

Code: Select all

mount error: could not resolve address for reststop.montefiore.org: Unknown error
This implies DNS resolution is not yet available when the system mount command runs. Why might that be?

According to the documentation at http://codingberg.com/linux/systemd_whe ... unt_option, cifs should automatically be recognized as a network file system and cause it to delay processing this line until the network is brought up.

Once the system is up, sudo mount -a works and the share is mounted.
rene
Level 17
Level 17
Posts: 7526
Joined: Sun Mar 27, 2016 6:58 pm

Re: How does fstab not have DNS resolution at the ready?

Post by rene »

Off to bed so just a quick suggestion: I wonder if this "is" still this buglet: viewtopic.php?t=276346.

"Is" between quotes since you are explicitly not talking about WINS but DNS but I had/have the idea that it might be possible that mount.cifs relays DNS resolving trough winbind regardless. I.e., try the in the linked post suggested I guess: I believe what you do should certainly work --- even though it's fairly strange, and even though I can't resolve that hostname locally, implying that it might not be global DNS name but a locally served one, in which case you might as well use the "Windows name" of the box it seems.
t42
Level 5
Level 5
Posts: 869
Joined: Mon Jan 20, 2014 6:48 pm

Re: How does fstab not have DNS resolution at the ready?

Post by t42 »

Why just don't process the mount on boot and delay it until the actual requests from userspace. Try to reach systemd through comment in fstab to pass 'systemd.automount' , something like
*** cifs _netdev,noauto,comment=systemd.automount,credentials=*** ,forceuid,forcegid 0 0

edit
i missed _netdev , it may be needed in the line altair4 cited below as well
Last edited by t42 on Wed May 12, 2021 9:33 am, edited 1 time in total.
-=t42=-
altair4
Level 20
Level 20
Posts: 10512
Joined: Tue Feb 03, 2009 10:27 am

Re: How does fstab not have DNS resolution at the ready?

Post by altair4 »

mauricev wrote:
Tue May 11, 2021 7:30 pm
According to the documentation at http://codingberg.com/linux/systemd_whe ... unt_option, cifs should automatically be recognized as a network file system and cause it to delay processing this line until the network is brought up.
It all depends on what "after the network is up" means: https://www.freedesktop.org/wiki/Softwa ... orkTarget/

Anyway, since the share can be mounted after login with a mount -a did you try the suggestion by the link you posted:
//reststop.montefiore.org/PUBLIC /mnt/reststop cifs credentials=/home/kelly/reststopcredentials,iocharset=utf8,sec=ntlmssp,uid=1000,gid=1000,noauto,x-systemd.automount 0 0
It will mount when accessed which will be after login so the expectation is that everything will be "up" at that point.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
rene
Level 17
Level 17
Posts: 7526
Joined: Sun Mar 27, 2016 6:58 pm

Re: How does fstab not have DNS resolution at the ready?

Post by rene »

Both alternative answer though forego that it should work. It's the reason I expect that we need a network-online.target rather than network.target here somewhere. Depends, possibly, on what OP has installed in the first place between winbind/samba.
Post Reply