cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 461 Views

RHCSA Practice: Mastering autofs and NFS

MOUNT (on-demand)

Happy Friday, everyone!

Let's wrap up the week with a practical, multi-step challenge. Instead of a simple /etc/fstab entry, we're going to use the "automounter" to mount an NFS share only when it's accessed. This tests objectives like "Mount and unmount network file systems" and "Configure autofs".

The Scenario:

You need to configure your client machine to automatically mount an NFS share on demand. Here are the details:

  • The NFS server's hostname is: server.example.com
  • The share exported by the server is: /srv/data
  • You must configure autofs so that whenever a user tries to cd into /mnt/remote/data, it automatically mounts the share.

Your Challenge:

Post the configuration steps you would take. What files do you edit, and what do you add?

  1. What package(s) would you need to install on your client machine to make this work?
  2. What line would you add to the /etc/auto.master file (or a file in /etc/auto.master.d/)?
  3. What is the full content of the new map file you just created (e.g., /etc/auto.remote)?
  4. What command(s) do you need to run to enable and start the service?
  • Bonus Question: What is the main advantage of using autofs over /etc/fstab for network mounts?

Let's see those configurations! Have a fantastic weekend!

PS: the weekly challenges will be on break for a week.

5 Replies
Blue_bird
Starfighter Starfighter
Starfighter
  • 398 Views

1) dnf install autofs -y

2) /mnt/remote /etc/auto.remote --timeout=60

3) shared -rw,soft,intr fileserver.example.com:/shared

4) systemctl enable autofs  and systemctl start autofs


/etc/fstab mounts everything at boot time — if the network isn’t ready or the server is down, it can cause boot delays or failures.

autofs mounts only when accessed and unmounts automatically, saving network and system resources.

Thanks

Chetan_Tiwary_
Community Manager
Community Manager
  • 225 Views

@Blue_bird nice !

Chetan_Tiwary_
Community Manager
Community Manager
  • 194 Views

That bonus question is your concept checker and analyzer. 

1. Autofs only mounts network shares  when someone actually tries to access them. They are also automatically unmounted after a period of being idle and hence saves system resources and network bandwidth.

2. If a remote server is offline or unreachable during boot, an /etc/fstab mount can delay your system startup, causing it to hang or even fail the boot process.

Autofs completely avoids this problem because it only attempts the mount when access is requested, long after the system is fully up.

3. If the NFS server goes down, Autofs ensures that only the users currently trying to access that mount are affected. Other users or services on the client system won't hang or freeze.

4. Autofs lets you easily add or adjust mounts without having to restart the client machine or modify static configuration files.

Blue_bird
Starfighter Starfighter
Starfighter
  • 178 Views

Thank you so much..! for detailed explanation @Chetan_Tiwary_ 

Chetan_Tiwary_
Community Manager
Community Manager
  • 120 Views

my pleasure @Blue_bird !

Join the discussion
You must log in to join this conversation.