You are on page 1of 31

NFS

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

MODULE OBJECTIVES

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

NFS OVERVIEW

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

NFS OVERVIEW
The Network File System (NFS) is a protocol originally developed by Sun Microsystems in 1984, allowing
users on a client computer to access files over a network as easily as if the network devices were attached to
its local disks. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure
Call (ONC RPC) system. The NFS protocol is specified in RFC 1094, RC 1813, and RFC 3530.

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

EXPORTED RESOURCES OVERVIEW


In the diagram above, SS1 contains resources that many users need such as data_files, eng_files, and
misc_files.
To use a resource, SS1 must have the resource exported and Client1 must have the resource mounted. A user
on Client1 can then change to the directory (cd) that contains the mounted resource and access it as if it were
stored locally (assuming that permissions are set appropriately).

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

SETTING UP AND CONFIGURING NFS

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

SETTING UP NFS

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

CLI: NFS SETUP


When you license NFS on a storage system, it starts the daemons (rpc.mountd and nfsd) that handle NFS RPC
protocol.
The following are NFS configurable options:
nfs.v3.enable
nfs.v4.enable
nfs.tcp.enable
nfs.udp.xfersize

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

SYSTEM MANAGER: NFS SETUP

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

SYSTEM MANAGER: NFS SETUP (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

10

EXPORTING RESOURCES

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

11

EXPORTING RESOURCES
To export resources, use one of the following methods:
For persistence across reboots, specify the resources to export in the /etc/exports file; and then execute the
exportfs -a command to make changes effective immediately.
For temporary access, use the exportfs command to export resources not specified in the /etc/exports
file, or to export resources specified in the file but with different access permissions.
FIVE RULES FOR CREATING EXPORTS

1. You must export each volume separately. If you create, rename, or destroy a volume, the /etc/exports file is
updated automatically. This functionality can be disabled using the options nfs.export.autoupdate switch.
2. The storage system must be able to resolve host names if used in exports:
/etc/hosts, NIS, DNS
3. Access must be granted in a positive way:
A host is excluded when it is not listed or it is preceded by a dash (-).
If no host is specified, all hosts have access.
4. Subdirectories of parent exports can be exported with different option specifications.
5. Permissions are determined by matching the longest prefix to the access permissions in the /etc/exports file.

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

12

ADDING AN EXPORT: /ETC/EXPORTS


System administrators must control how NFS clients access files and directories on a storage system. Exported
resources are resources made available to hosts. NFS clients can only mount resources that have been
exported from a storage system licensed for NFS.
To export directories, add an entry for each directory to the /etc/exports file, using the full path to the directory
and options. The full path name must include /vol.
Export specifications use the following options to restrict access:
root = list of hosts, netgroup names, and subnets

rw = list of hosts, netgroup names, and subnets


ro = list of hosts, netgroup names, and subnets

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

13

TEST YOUR KNOWLEDGE

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

14

EXPORTING

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

15

THE EXPORTFS COMMAND


To specify which file system paths Data ONTAP automatically exports when NFS starts up, add export entries
to (or remove them from) the /etc/exports file. To manually export or unexport file system paths, use the
exportfs command in the storage system CLI.
EDITING THE /ETC/EXPORTS FILE
To add export entries to (or remove from) the /etc/exports file, use a text editor on an NFS client that has root
access to the storage system.
The following is an example of /etc/exports file entries:

#Auto-generated by setup Mon Mar 24 14:39:40 PDT 2008


/vol/vol0

-sec=sys,ro,rw=sun,root=sun,nosuid

/vol/vol0/home

-sec=sys,rw,root=sun,nosuid

/vol/flexvol1

-sec=sys,rw,root=sun,nosuid

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

16

TEMPORARY EXPORTS

OPTION
Root Access
Read-Write
Access
Read-Only
Access
Anonymous
User ID

DESCRIPTION
The root option specifies that the root on the client has root
permissions for the resource when it is mounted from the storage
system.
The rw option gives read-write access to specific hosts. If no host
is specified, all hosts have read-write access.
The ro option gives read-only access to specific hosts. If no host is
specified, all hosts have read-only access.
The anon option determines the UID of the root user on the
client.

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

17

COMMON EXPORTFS OPTIONS


To export a file system path and add a corresponding export entry to the /etc/exports file, enter the following
command:
exportfs -p [options] path
NOTE: If you do not specify an export option, Data ONTAP automatically exports the file system path with
the rw and sec=sys export options.
To export all file system paths specified in the /etc/exports file and unexport all file system paths not specified
in the /etc/exports file, enter the following command:
exportfs r
To unexport all file system paths without removing the corresponding export entries from the /etc/exports file,
enter the following command:
exportfs uav
To unexport a file system path without removing the corresponding export entry from the /etc/exports file,
enter the following command:
exportfs -u path
To unexport a file system path and remove the corresponding export entry from the /etc/exports file, enter the
following command:
exportfs -z path

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

18

SYSTEM MANAGER: EXPORTING

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

19

SYSTEM MANAGER: EXPORTING (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

20

SYSTEM MANAGER: EXPORTING (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

21

SYSTEM MANAGER: EXPORTING (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

22

SYSTEM MANAGER: EXPORTING (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

23

SYSTEM MANAGER: EXPORTING (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

24

SYSTEM MANAGER: EXPORTING (CONT.)

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

25

MOUNTING

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

26

MOUNTING FROM A CLIENT


Use the mount command to mount an exported NFS directory from another machine.
An alternate way to mount an NFS export is to add a line to the /etc/fstab (called /etc/vfstab on
some UNIX systems). This line must specify the NFS server host name, the exported directory on
the server, and the local machine directory where the NFS share is to be mounted. For more
information, see the NFS documentation for your client.

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

27

OTHER NFS ADMINISTRATION RESOURCES

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

28

MODULE SUMMARY

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

29

EXERCISE
Please refer to your Exercise Guide for more instruction.

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

30

CHECK YOUR UNDERSTANDING: ANSWERS

2011 NetApp, Inc. This material is intended for training use only. Not authorized for reproduction purposes.

33

You might also like