Network File Services  «Prev  Next»

Lesson 7 Displaying currently mounted NFS filesystems
Objective Display currently mounted NFS filesystems.

Displaying currently mounted NFS Filesystems

To display the currently mounted NFS filesystems on a Red Hat Linux system, you can use the `df` command or examine the `/proc/mounts` file. Here are a couple of methods you can use:
  1. Using the `df` command: The `df` command can show all mounted filesystems, including NFS mounts. You can use a command like this to filter for NFS mounts:
    df -hT | grep nfs
    
    This command lists all filesystems with their type and sizes in human-readable form (`-h` for human-readable, `-T` to include the filesystem type), and then filters the output for entries that contain "nfs".
  2. Examining the
    /proc/mounts
    
    file: This file contains a list of all mounts in the system. You can use `grep` to filter for NFS mounts:
    cat /proc/mounts | grep nfs
    
    This will show you all NFS mount points, the NFS server, and mount options.

Both methods will give you the details about what NFS filesystems are currently mounted and their respective details on your system.


With your NFS server running, you might occasionally want to know what clients have mounts to your system. Keeping track of this information provides diagnostic, performance, and security data that will help to maintain your NFS server. The
showmount
command displays currently mounted NFS filesystems. To show all currently mounted NFS filesystems, use the -a parameter. Optionally, you may specify a hostname as the last parameter. Each line of showmount's output is a mounted filesystem. The name before the colon (:) is the host that obtained the mount. The name after the colon is the mounted directory.The image below shows the output of showmount -a on a sample system.

Output from the "showmount -a" command.

[root@localhost/root]# showmount -a
nexus.mycompany.com:/docs
nexus.mycompany.com:/proj
replicant.mycompany.com:/proj
tyrell.mycompany.com:/usr
[root@localhost/root]#

If you provide NFS services across the Internet, you should routinely check the system log and the list of mounted systems.
The next lesson explains how to use the automounter with NFS.

Mounting NFS File Systems

Use the mount command to mount a shared NFS directory from another machine:
mount shadow.redhatlinux.com:/misc/export /misc/local
Warning: The mount point directory on local machine (/misc/local in the above example) must exist.
In this command,
shadow.redhatlinux.com
is the hostname of the NFS file server, /misc/export is the directory that shadowman is exporting, and /misc/local is the location to mount the file system on the local machine. After the mount command runs (and if the client has proper permissions from the shadow.redhatlinux.com NFS server) the client user can execute the command ls
/misc/local 
to display a listing of the files in /misc/export on shadow.redhatlinux.com.

SEMrush Software 6 SEMrush Banner 6