0% found this document useful (0 votes)
12 views4 pages

Nfs 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

Nfs 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

The default NFS version in Red Hat Enterprise Linux 8 is 4.2.

NFSv4 and NFSv3 major


versions are
supported. NFSv2 is no longer supported. NFSv4 uses only the TCP protocol to
communicate with
the server; earlier NFS versions could use either TCP or UDP.

NFS servers export shares (directories). NFS clients mount an exported share to a
local mount
point (directory), which must exist. NFS shares can be mounted a number of ways:
• Manually, using the mount command.
• Automatically at boot time using /etc/fstab entries.
• On demand, using either the autofs service or the systemd.automount facility

Mounting NFS Shares


To mount an NFS share, follow these three steps:

1. Identify: The administrator of the NFS client system can identify available NFS
shares in
various ways:
The administrator for the NFS server may provide export details, including security
requirements.
Alternatively, the client administrator can identify NFSv4 shares by mounting the
root
directory of the NFS server and exploring the exported directories. Do this as the
root user.
Access to shares that use Kerberos security will be denied, but the share
(directory) name will
be visible. Other shared directories will be browsable.
[user@host ~]$ sudo mkdir mountpoint
[user@host ~]$ sudo mount serverb:/ mountpoint
[user@host ~]$ sudo ls mountpoint

Mount temporarily: Mount the NFS share using the mount command:
[user@host ~]$ sudo mount -t nfs -o rw,sync serverb:/share mountpoint

sudo vim /etc/fstab


...
serverb:/share /mountpoint nfs rw,soft 0 0

NOTE
Unmounting a share does not remove its /etc/fstab entry. Unless you remove or
comment out the entry, the NFS share will be remounted either at the next system
boot or when the NFS client service is restarted

##################################333

Use the nfsconf --set section key value to set a value for the key in the specified
Use the nfsconf --get section key to retrieve the value for the key

###################################################
Automounter Benefits
• Users do not need to have root privileges to run the mount and umount commands.
• NFS shares configured in the automounter are available to all users on the
machine, subject to
access permissions.
• NFS shares are not permanently connected like entries in /etc/fstab, freeing
network and
system resources.
• The automounter is configured on the client side; no server-side configuration is
required.
• The automounter uses the same options as the mount command, including security
options.
• The automounter supports both direct and indirect mount-point mapping, for
flexibility in
mount-point locations.
• autofs creates and removes indirect mount points, eliminating manual management.
• NFS is the default automounter network file system, but other network file
systems can be
automatically mounted.
• autofs is a service that is managed like other system services.
#########################################################################33

Create an automount
1-Install the autofs package

sudo yum install autofs

2-Add a master map file to /etc/auto.master.d. This file identifies the base
directory used
for mount points and identifies the mapping file used for creating the automounts.

sudo vim /etc/auto.master.d/demo.autofs

The name of the master map file is arbitrary (although typically meaningful), but
it must have
an extension of .autofs for the subsystem to recognize it

###################################################################################
###33
Direct Maps
Direct maps are used to map an NFS share to an existing absolute path mount point.

create master map file

1- touch /etc/auto.master.d/direct.autofs

/- /etc/auto.direct (All direct map entries use /- as the base


directory. In this case, the mapping file that contains the mount details is
/etc/auto.direct.)

2- crate mapping file

touch /etc/auto.direct

/mnt/docs -rw,sync serverb:/shares/docs (The mount point (or key) is always


an absolute path)

In this example the /mnt directory exists, and it is not managed by autofs. The
full directory /
mnt/docs will be created and removed automatically by the autofs service
###################################################################################
#############
Indirect mapping ()

When an NFS server exports multiple subdirectories within a directory, then the
automounter can
be configured to access any one of those subdirectories using a single mapping
entry.

1- create master map file

1- touch /etc/auto.master.d/indirect.autofs

/shareMP /etc/auto.indirect (/shareMP directory as the base


for indirect automounts)

2- crate mapping file (for a basic indirect mapping entry)

touch /etc/auto.indirect

work -rw,sync serverb:/shares/work

#################################################################
OR 2- create mapping file ( Indirect Wildcard Map)

touch /etc/auto.indirect

* -rw,sync serverb:/shares/&

The mount point (or key) is an asterisk character (*), and the subdirectory on the
source location is
an ampersand character (&). Everything else in the entry is the same.

When a user attempts to access /shares/work, the key * (which is work in this
example)
replaces the ampersand in the source location and serverb:/shares/work is mounted.
As with
the indirect example, the work directory is created and removed automatically by
autofs

You might also like