Linux NFS Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * NFS =Export= Export without preventing access to the currently exported filesystems. Add the new filesystem definition to /etc/exports...")
 
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
Export without preventing access to the currently exported filesystems.
Export without preventing access to the currently exported filesystems.


Add the new filesystem definition to /etc/exports or /etc/exports.d/*.exports and then:
Add the new filesystem definition to [[Linux_NFS_Configuration#Exports_Configurations|/etc/exports or /etc/exports.d/*.exports]] and then:


  exportfs -av
  exportfs -av
=Mounting NFS Shares=
mount -t nfs 10.10.2.131:/opt/nfs0 /mnt/nfs
where /opt/nfs0 is the share exposed by the NFS server.
A non-existent directory on the exported share cannot be mounted - the directory will not be created remotely upon mount. If /opt/nfs0/red directory does not exist, the following command will fail:
mount -t nfs 10.10.2.131:/opt/nfs0/red ./tmp/
mount.nfs: mounting 10.10.2.131:/opt/nfs0/red failed, reason given by server: No such file or directory
However, if the directory is created on the share, the mount succeeds:
ssh 10.10.2.131
sudo mkdir opt/nfs0/red
exit
mount -t nfs 10.10.2.131:/opt/nfs0/red ./tmp/
Also see: {{Internal|Linux_NFS_Configuration#Mount_Options|Mount Options}}

Latest revision as of 22:18, 17 December 2019

Internal

Export

Export without preventing access to the currently exported filesystems.

Add the new filesystem definition to /etc/exports or /etc/exports.d/*.exports and then:

exportfs -av

Mounting NFS Shares

mount -t nfs 10.10.2.131:/opt/nfs0 /mnt/nfs

where /opt/nfs0 is the share exposed by the NFS server.

A non-existent directory on the exported share cannot be mounted - the directory will not be created remotely upon mount. If /opt/nfs0/red directory does not exist, the following command will fail:

mount -t nfs 10.10.2.131:/opt/nfs0/red ./tmp/
mount.nfs: mounting 10.10.2.131:/opt/nfs0/red failed, reason given by server: No such file or directory

However, if the directory is created on the share, the mount succeeds:

ssh 10.10.2.131
sudo mkdir opt/nfs0/red
exit
mount -t nfs 10.10.2.131:/opt/nfs0/red ./tmp/

Also see:

Mount Options