Il 20/11/19 12:29, Kenneth Porter ha scritto:> --On Wednesday, November 20, 2019 10:37 AM +0100 Alessandro Baggi > <alessandro.baggi at gmail.com> wrote: > >> 2) Due to the problem 1, It cannot mount samba shares on boot saying >> "Not >> suitable address found". After the network is available I can mount >> samba >> shares. > > Are the shares mounted as systemd mount or automount units that wait > for networking? > > <https://www.freedesktop.org/software/systemd/man/systemd.automount.html>Really I don't know,? I can say that they have an entry in fstab and I have several mnt-share.mount unit as generated.
> On Nov 20, 2019, at 06:45, Alessandro Baggi <alessandro.baggi at gmail.com> wrote: > > ? > Il 20/11/19 12:29, Kenneth Porter ha scritto: >> --On Wednesday, November 20, 2019 10:37 AM +0100 Alessandro Baggi <alessandro.baggi at gmail.com> wrote: >>> 2) Due to the problem 1, It cannot mount samba shares on boot saying "Not >>> suitable address found". After the network is available I can mount samba >>> shares. >> Are the shares mounted as systemd mount or automount units that wait for networking? >> <https://www.freedesktop.org/software/systemd/man/systemd.automount.html> > > > Really I don't know, I can say that they have an entry in fstab and I have several mnt-share.mount unit as generated.For the .mount units, you could make them run after the network-waits-online service, thus making sure that they only mount after a stable network is up. Adding _netdev to the fstab mount options also does that, I think. The best solution I?ve found for this issue is to use .automount units for every network .mount unit. It will only mount the volume when it?s actually read or written to, which might be well after the boot, and uncounted it after inactivity. It prevents stale mounts if the file server reboots or dies too. -- Jonathan Billings <billings at negate.org>
Once upon a time, Alessandro Baggi <alessandro.baggi at gmail.com> said:> Really I don't know,? I can say that they have an entry in fstab and > I have several mnt-share.mount unit as generated.Are the fstab entries marked "_netdev"? -- Chris Adams <linux at cmadams.net>
Il 20/11/19 14:44, Chris Adams ha scritto:> Once upon a time, Alessandro Baggi <alessandro.baggi at gmail.com> said: >> Really I don't know,? I can say that they have an entry in fstab and >> I have several mnt-share.mount unit as generated. > Are the fstab entries marked "_netdev"?No
--On Wednesday, November 20, 2019 12:45 PM +0100 Alessandro Baggi <alessandro.baggi at gmail.com> wrote:> Really I don't know,? I can say that they have an entry in fstab and I > have several mnt-share.mount unit as generated.fstab is no longer parsed directly by the mount command at boot time. Since C7, when systemd was introduced, it's now parsed by systemd to create unit files. It's a transition mechanism. I recommend converting all the mounts not created by the installer to permanent real unit files so you can use all the power of unit syntax. (How does systemd know the difference between generated files and hand-crafted ones? Can one just remove the fstab entry once the generated one is present? That would make migration easier.) Read up on what systemd does with fstab: <https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html>
> On Nov 20, 2019, at 16:17, Kenneth Porter <shiva at sewingwitch.com> wrote: > (How does systemd know the difference between generated files and hand-crafted ones? Can one just remove the fstab entry once the generated one is present? That would make migration easier.)Mount units created by the systemd generator are dynamically created each boot. You can create a persistent one in /etc/systemd/system to override the dynamic one from fstab. -- Jonathan Billings <billings at negate.org>