List NFS mounts with mount
In this step, you will learn how to identify Network File System (NFS) mounts on your Linux system using the mount
command. NFS allows a system to share directories and files with others over a network.
The mount
command is used to attach filesystems to a specific mount point in the file system hierarchy. When used without any arguments, it displays a list of all currently mounted filesystems, including NFS mounts.
Open your terminal. You are likely already in the ~/project
directory.
Type the following command and press Enter:
mount
This command will output a lot of information about all the filesystems currently mounted on your system. Look for lines that include type nfs
or mention a remote server path followed by a local mount point.
For example, you might see output similar to this (the exact output will vary depending on the system configuration):
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=999999k,nr_inodes=999999,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=999999k,mode=755)
/dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,size=999999k,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
...
192.168.1.100:/shared_nfs on /mnt/nfs_share type nfs4 (rw,relatime,vers=4.2,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.200,local_lock=none,addr=192.168.1.100)
...
In the example output above, the line starting with 192.168.1.100:/shared_nfs
indicates an NFS mount.
192.168.1.100:/shared_nfs
is the remote NFS server and the shared directory on that server.
/mnt/nfs_share
is the local mount point on your system where the remote directory is accessible.
type nfs4
confirms it is an NFS version 4 mount.
By examining the output of the mount
command, you can identify if any NFS shares are currently mounted on your system and where they are mounted.
Click Continue to proceed.