NFS Mount Fstab Freenas

Hi,

ich würde gerne einen NFS Share meiner Freenas im Ucs per Fstab einbinden.
Leider funktioniert das nicht. Wenn ich allerdings den Mount per mount -a verbinde wird
er wie gewünscht eingebunden. Hat da jemand einen tip für mich?

Nur damit ich das richtig verstehe: Beim (Re)Boot wird es nicht gemoutet, mit “mount -a” nach dem Boot schon ?

Genau so ist es. Nach dem boot ist er nicht mehr verbunden, wenn ich dann “mount -a” ausführe, wird es wie gewünscht verbunden.

Hi,

sorry but we prefer to use English here for our international users.

So you have an issue as your UCS host does not mount a NFS share from your FreeNAS box while a “mount -a” when the server is done with booting the mount happens without any problems?

Due to the “mount -a” working fine I assume your /etc/fstab is ok, but would you mind posting it here?

My guess would be some sort of issue with network/ DNS at boot. How is your share configured on the NAS side? Do you have restrictions regarding IP ranges or domain names?

One idea I have is the FreeNAS is configured to restrict access to domain or hosts by name and when the request from UCS arrives it tries to resolv the IP to name but has no success as the (possibly) configured DNS Sserver (on UCS) is not up and running.
But this is just a wild guess.

Let us know the configuration of:
UCS network (incl. DNS and routing)
FreeNAS network (incl. DNS and routing)
Configuration of FreeShare and restrictions there.

/CV

1 Like

Hi,

thanks for answer.

Here the fstab:

172.16.54.1:/mnt/pool4TB2x4/share03-4tb2x4-nextcloud    /mnt/freenas-nfs        nfs     auto    0       0

I use direct ip adress without dns names. The ucs is a vm on proxmox kvm Host.
The vm uses 2 Nic config. One Nic for internet and one Nic for direct connection via 10G to freenas.
Freenas uses no access restrictions. The seperate NFS Share Proxmox Host works good, i use it for vm storage.

Freenas Nic1:
172.16.54.1/24

UCS Nic2:
172.16.54.3/24

I use seperate DHCP and DNS server in Router for NIC1.

Do you need more info? How to get these infos?

Thanks.

Mein Standard ist “rw,soft”, nicht “auto”. Ich wusste nicht, dass man da überhaupt “auto” verwenden kann :slight_smile:

(Ich weiss was “soft” für Nachteile hat …)

Thanks for the posting, i tested several settings in fstab, all with the same result, it did not work after reboot.
But it worked with mount -a.

Hey,

I highly suggest you use systemd’s automounting for network file systems. This avoids two issues: network/DNS not working correctly yet when remote file sytems are mounted from /etc/fstab and having the connection fail when the share’s already been mounted.

The idea behind automounting is:

  • Upon boot systemd sets up monitoring of the mount point.
  • The kernel monitors that mount point for any type of access (cd, ls…).
  • As soon as access is detected, the current access is put on hold and the corresponding network share will be mounted by systemd. After mounting, the access continues.
  • You can also configure an idle timeout: after x minutes without access to the mount point, the share will be unmounted automatically again.

Adding systemd-specific automount options to your /etc/fstab is the easiest way to implement this, but you can also create full .mount and .automount systemd units, too, if you prefer those. You can read more about this in the systemd.mount man page, especially the section FSTAB.

For your case it should look something like this:

172.16.54.1:/mnt/pool4TB2x4/share03-4tb2x4-nextcloud /mnt/freenas-nfs nfs nfsvers=3,tcp,x-systemd.automount,x-systemd.idle-timeout=600 0 0

Mount automatically, unmount after 600 seconds of inactivity and use NFS over TCP (NFS over UDP is unreliable and you can end up with packet loss and damaged files).

Kind regards
mosu

1 Like

Thanks for the solutions. It works fine.