Nfs – Is it possible to view the contents of an underlying NFS mount without unmounting the NFS content

filesystemsmountnfs

I have a shared directory on a server – let's call it /home/shared – which is mounted with content from another server via nfs.

When it is unmounted /home/shared is supposed to be empty – however, running du -x on the directory indicates that it is not empty.

I cannot unmount the NFS content to inspect the mount point, since it is in use by others.

Is there any way that I can view/edit the contents of the actual mount point (not the NFS content) while leaving the NFS content mounted for others to use?

Best Answer

It might be easier to:

$ sudo mount --bind /directory_above_the_mount_point /some_temporary_directory

then, the /directory_above_the_mount_point/mount_point remains to show the mounted filesystem and at the same moment you can access the underlying filesystem (mount point) at /some_temporary_directory/mount_point.