Loading...
Linux Interview Questions

NFS (Network File System)

1. What is NFS?
A) NFS (Network File System) is a distributed file system protocol that allows a client to access files over a network as if they were on a local disk.

2. Which ports does NFS use?
A) NFSv3: TCP/UDP 2049, plus random ports for rpcbind.
NFSv4: TCP 2049 (uses a single port, firewall-friendly).

3. What is the difference between NFSv3 and NFSv4?
A) NFSv3: Stateless, requires multiple ports.
NFSv4: Stateful, single TCP port (2049), supports ACLs, Kerberos, and strong security.

4. What configuration file is used for NFS exports?
A)

/etc/exports

5. What command is used to export shared directories?
A)

exportfs -a

6. How do you mount an NFS share manually?
A)

mount -t nfs :/shared_dir /mnt

7. How do you make NFS mounts persistent across reboots?
A)

  •  Add entry to /etc/fstab:
  •  server_ip:/shared_dir /mnt nfs defaults 0 0

8. What is the purpose of showmount -e?
A) Displays exported NFS shares from a server.

9. How do you check currently mounted NFS shares?
A)

mount | grep nfs
df -hT | grep nfs

10. What is the role of rpcbind in NFS?
A) Maps RPC services (like NFS, mountd, statd) to dynamic ports.
Required for NFSv3, not for NFSv4.

11. What is the difference between hard and soft mounts in NFS?
A) Hard mount: Retries indefinitely if server is down (recommended for critical data).
Soft mount: Returns error after timeout (risk of data corruption).

12. What is NFS locking and which daemons are involved?
A) Provides file locking in multi-client environments.
Daemons: rpc.lockd, rpc.statd.

13. What is Kerberos authentication in NFS?
A) NFSv4 supports Kerberos (krb5, krb5i, krb5p) for secure authentication, integrity, and encryption.

14. What are common NFS mount options?
A)

  • rw/ro → Read-write or read-only.
  • sync/async → Write mode.
  • hard/soft → Retry behavior.
  • no_root_squash → Root user on client has root access on server.
  • sec=krb5 → Kerberos authentication.

15. What is root squashing in NFS?
A) Maps root user from client to an unprivileged user (nobody) on the server for security.

16.NFS client cannot mount share, what do you check?
A)

  •  Service status (systemctl status nfs-server)
  •  Firewall rules (firewall-cmd –list-all)
  • /etc/exports syntax and permissions
  • Network connectivity (ping, telnet 2049)

17. How do you troubleshoot NFS performance issues?
A)

  •  Check network latency (ping, iperf).
  • Use nfsstat to analyze performance.
  • Enable async for faster writes.
  • Check disk I/O (iostat, sar).

18. What logs would you check for NFS issues?
A) Server: /var/log/messages, /var/log/syslog
Client: dmesg, journalctl -xe

Leave a Reply

Your email address will not be published. Required fields are marked *