Why is it bad to put NFS mounts (or symlinks to NFS mounts) in the root directory?
Sometimes people wonder why NFS mounts are created in /mnt or /hosts subdirectories under root, like /mnt/jobs, instead of just /jobs. There’s several reasons, one in particular is very important.. to avoid hanging up the entire OS when there’s an NFS outage! Whenever the operating system wants to access a file or program, say /usr/bin/man, the operating system starts at the root (/), and walks the directory contents of the root directory until it hits ‘usr’, then walks the directory list of /usr until it finds ‘bin’, etc. If you have a mount (or symlink pointing to a mount) in the root directory, and it just happens to appear earlier in the directory entries than /usr, invoking /usr/bin/man will involve stepping over your mount/symlink while searching for /usr. If the NFS server is down, your app will hang when it tries to step over the mount point/symlink, causing it to freeze up your shell. (Similar to how running ‘df’ freezes the shell during NFS outages) Consider you’re an adminis