fstab vs autofs which is better for simultaneous NFS requests and for surviving from TrueNAS server reboot?

wyang

Dabbler
Joined
Jul 8, 2020
Messages
24
Greetings,

My server configuration
Type: SuperMicro SYS-6029U-E1CR25M
Processor: Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz
Memory: 12 x 32GB Samsung M393A4K40DB2-CVF
Storage: 2 x 256GB NVMe SSD, INTEL SSDPEKKA256GB; 12 x 16TB HDD, Seagate ST16000NM001G-2KK103

TrueNAS-12.0-U7
- Boot: 1 x 2-way mirror (SSD)
- Pool: 2 x 6-wide RAIDZ2 data VDEVs

fstab vs autofs, which way is better for simultaneous NFS requests and for surviving from TrueNAS server reboot?

Thank you.
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
for the part of surviving reboots fstab is fine - I'm using it one several servers and they reconnect fine when I've rebooted TrueNAS for upgrades.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
The automounter has the significant upside of not having filesystems unnecessarily mounted from the filer. When they're not being used, they get unmounted (eventually). This can be a win in some cases.
 
Joined
Oct 22, 2019
Messages
3,641
fstab vs autofs, which way is better for simultaneous NFS requests and for surviving from TrueNAS server reboot?
autofs, for all intents and purposes, has been superseded by systemd automounts in most recent Linux distros.

Once you understand the format, it's fairly straightforward to create systemd mount/automount units.
 

wyang

Dabbler
Joined
Jul 8, 2020
Messages
24
Thank you @jgreco and @winnielinnie for the advices.

In our environment, NFS clients (CentOS 7 servers and K8s pods on these servers) save daily application data backups to NFS shares. Some NFS clients save backups to a same NFS share.

For this kind of use case, which way is better? the reason behind? Thanks very much!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Context is key here.

Let's say you have a NFS server and you have a bunch of fstab mounts. One day, you need to replace the server, or swap in a new disk, or otherwise change the underlying NFS mount in a fundamental way. You might need to wander around to each of your dozens? Hundreds? of systems doing dumps to this system. New attempts to access the filesystem will tend to hang, even if you have soft mount enabled.

By way of comparison, you'd have a much smaller scale problem with automounts, which unmount when they are not in use. Attempts to access the path if the server is crashed will fail, which is generally better in that you don't have processes stacking up trying to access the failed mountpoint. That isn't always the correct thing to happen, of course, but it can be a useful behaviour.
 

wyang

Dabbler
Joined
Jul 8, 2020
Messages
24
Thanks very much @jgreco for the clarification with the context!

Thanks very much to all of you! The advices are really helpful to me.
 
Top