Network File System shares, or NFS exports, are easily mounted to Linux servers. Before an NFS export can be mounted, the nfs-utils package must be installed.
yum install nfs-utils
Additionally, the 'portmap' service must be running and enabled.
service portmap start
chkconfig portmap on
To mount the share, you'll need the following information.
The hostname, domain name, or IP of the NFS server.
The full path of the export on the server.
Also, be sure that the NFS server allows access from the host for the desired export.
Manually Mounting
Mounting NFS shares to the client is done using the mount command, in a similar fashion to mounting local file systems.
mount -t nfs4 -o options host:/remote/path/ /local/mount/point
For example: To mount an export '/var/data' on host '10.10.1.10' to the local directory '/remote/data', the following command would be used.
mount -t nfs4 10.10.1.10:/var/data /remote/data
The '-t nfs4' can usually be dropped completely. You'll now be able to access the remote directory under '/remote/data' as though it were part of the local filesystem.
For information on the various mount options, which can improve transfer performance and permissions, refer to the nfs man page.
man nfs
Mount via fstab
NFS mounts can also be specified within the /etc/fstab file for ease of mounting, and mounting on system startup. The format is the same as with local mounts.
host:/remote/path /local/mount/point nfs4 defaults 0 0
For the previously used example export, this would be:
10.10.1.10:/var/data /remote/data nfs4 defaults 0 0
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment