You are on page 1of 12

MODULE 4: EXPORTS AND MOUNTS

EXERCISE

In this exercise, you practice what you learned about file sharing. You create volumes, qtrees, and files,
export them, and mount them from a mountpoint on the NFS client. To complete this exercise, you must be
familiar with the exportfs, mount, mkdir, and cd commands. You can use the lecture notes for reference.
OBJECTIVES

By the end of this exercise, you should be able to:

Mount the root volume of the storage system on an administration host


Export a volume using the command-line interface
Rename a volume and verify the automatic export
Export and mount a qtree
Export to a subnet
Export to a netgroup
Export a qtree using NetApp System Manager
Mount an export from an administration host

TASK 1: MOUNT THE ROOT VOLUME OF THE STORAGE SYSTEM ON AN ADMINISTRATION HOST

In the previous exercise, you configured a UNIX or Linux host as an administration host. In this task, you
mount the root volume so that you can modify configuration files from the administration host.
STEP ACTION

1.

Launch NetApp System Manager and navigate to: Storage > Exports.

2.

Notice that the root volume has been exported by default, as you observed from the commandline interface in the previous exercise:

3.

Log in to your UNIX or Linux machine from a PuTTY client.


NOTE: Your UNIX or Linux machine might use SSH. Check with your instructor if you have
any questions.

E4-1

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

4.

Create a mountpoint using the name of your assigned storage system:


# mkdir /mnt/system

Replace system with the name of your storage system.


5.

In /mnt/system, create a directory called vol0:


# mkdir /mnt/system/vol0

6.

Mount /vol/vol0 to this mountpoint.


# mount system:/vol/vol0 /mnt/system/vol0

7.

Change the directory to the mountpoint and list the contents.


# cd /mnt/system/vol0
# ls la

What are the contents of the directory? ____________________


Notice that under /mnt/system/vol0 there is an /etc directory.
Is this directory for your local UNIX host or your storage system? ______________
There is also an /etc directory under /.
Is this directory for your local host or your storage system? ____________________
NOTE: Because of the potential for confusion, memorize which system uses which /etc
directory.

TASK 2: EXPORT A VOLUME USING THE COMMAND-LINE INTERFACE

In this task, you create a new aggregate and volume and verify that the volume was exported automatically.
STEP ACTION

1.

Examine the contents of the /etc/exports file with the rdfile command.
system> rdfile /etc/exports

2.

Run this command:


system> exportfs

How does the output of the exportfs command differ from the output of the rdfile
command?
_____________________________________________________________________________
_____________________________________________________________________________

3.

Create an aggregate with three disks, one of which is a parity disk.


system> aggr create aggr1 t raid4 3

E4-2

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

4.

Create a flexible volume called NFStest:


system> vol create NFStest aggr1 100m

5.

Use the rdfile and exportfs commands to verify that the flexible volume was created and
exported:
system> rdfile /etc/exports
system> exportfs

Which option allows a newly created volume to be exported automatically?


HINT: Run system> options nfs.
___________________________________________
6.

Note the access permissions for the exported volume and record them here:
_____________________________

TASK 3: RENAME A VOLUME AND VERIFY THE AUTOMATIC EXPORT

In this task, you rename a volume that was automatically exported and verify the export after the renaming
operation. Then you mount the newly renamed volume from a host.
STEP ACTION

1.

Using the storage system command-line interface, rename the flexible volume that you created
from NFStest to NFSvol:
system> vol rename NFStest NFSvol

2.

View the exported file systems:


system> exportfs

Notice that the /etc/exports file has been modified and that the exports have been
automatically updated.
3.

Create a mountpoint on the UNIX host and mount the volume:


# mkdir /mnt/system/NFSvol
# mount system:/vol/NFSvol /mnt/system/NFSvol

4.

Verify the mount operation:


# cd /mnt/system/NFSvol
# ls

E4-3

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

TASK 4: EXPORT AND MOUNT A QTREE

In this task, you create a qtree. You then export it by editing the /etc/exports file and reload the persisted
exports. You then mount the qtree export.
STEP ACTION

1.

Using the storage system command-line interface, create a qtree named unix_tree on NFSvol:
system> qtree create /vol/NFSvol/unix_tree

2.

Verify that the security style is set to UNIX:


system> qtree security /vol/NFSvol/unix_tree unix

3.

Connect to your UNIX host.

4.

Verify your current location


# pwd
/mnt/system/vol0

If you are not at the vol0 mountpoint, change your directory to this location.
5.

Change the directory to your assigned storage systems /etc directory:


# cd etc

6.

Run vi on the exports file.


# vi exports

NOTE: If you are not familiar with this technique, refer to the following resource:
http://en.wikipedia.org/wiki/Vi
Your exports file is now available in the vi editor and the editor is in command mode.
7.

Scroll down to the last line.

8.

Press Shift-A (capital A) to append to the end of the line you are currently on.

9.

Press Enter to move to the next line.

10.

Type the following line:


/vol/NFSvol/unix_tree -rw=UNIX_or_Linux_Host,root=UNIX_or_Linux_Host

For UNIX_or_Linux_Host, provide your assigned UNIX or Linux host name or IP address.
11.

Press Esc to move out of append mode and back to command mode.

12.

Enter :wq to write the file and quit vi.

13.

Verify your changes:


# cat exports
...
/vol/NFSvol/unix_tree -rw=host1,root=host1

E4-4

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

14.

Using the storage system command-line interface, run the following commands to export the
new entry to memory:
system> exportfs a
system> exportfs

15.

Create the following mountpoint on the UNIX host:


# mkdir /mnt/system/unix_tree

16.

Mount the new export:


# mount system:/vol/NFSvol/unix_tree /mnt/system/unix_tree

17.

From the storage system, verify that unix_tree is mounted:


# mount

18.

Change your current directory to the new mountpoint:


# cd /mnt/system/unix_tree
# touch unix_file

19.

Verify that when you used the touch command, you created a new file:
# ls l

TASK 5: EXPORT TO A SUBNET

In this task, you will export a resource to a subnet.


STEP ACTION

1.

Create this qtree:


system> qtree create /vol/NFSvol/subnet

2.

Use the subnet address of the current training environment, as well as the IP address of your
assigned UNIX host and the correct subnet mask, to export the qtree that you just created to the
subnet. Choose one of these two commands:
/vol/NFSvol/subnet -rw=current_subnet/24,root=current_subnet/24

or
/vol/NFSvol/subnet -rw="current_subnet
subnet_mask",root="current_subnet subnet_mask"

For example:
/vol/NFSvol/subnet -rw=10.10.10.0/24,root=10.10.10.0/24

or
/vol/NFSvol/subnet -rw="10.10.10.0 255.255.255.0", root="10.10.10.0
255.255.255.0"

3.

Edit the /etc/exports file.

4.

Export the file system.

E4-5

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

5.

Mount the subnet qtree to /mnt/system/subnet:


# mkdir /mnt/system/subnet
# mount system:/vol/NFSvol/subnet /mnt/system/subnet

6.

Change the directory to the mountpoint and use the touch command to create a file named
subnet_file.

TASK 6: EXPORT TO A NETGROUP

In this task, you identify targets and resources, create the /etc/netgroup file, create the
/etc/nsswitch.conf file, and verify the content of the /etc/rmtab and /etc/hosts files.
STEP ACTION

1.

Verify the existence of the file called netgroup in one of two ways.

From the administration host with the ls command:


# cd /mnt/system/vol0/etc
# ls l net*
# more netgroup
From the storage system with the rdfile command:
system> rdfile /etc/netgroup

Does the netgroup file exist? ________________________________________If not, what


error message did you receive? ______________________
NOTE: If the file doesnt exist, you must create it.
2.

Use either a UNIX or Linux host or the wrfile command to create three groups: trustedhosts,
untrustedhosts, and allhosts. Add your assigned UNIX administration host to the trustedhost
group and create other dummy hosts for the untrustedhosts group. Place trustedhosts and
untrustedhosts in the allhosts folder:

From the UNIX host:


# cd /mnt/<system>/vol0/etc
# vi netgroup
trustedhosts (adminhost,,)(name_of_your_station,,)
untrustedhosts (host1,,)(host2,,)
allhosts trustedhosts untrustedhosts

From the storage system command-line interface:


system> wrfile /etc/netgroup
trustedhosts (adminhost,,)(name_of_your_station,,)
untrustedhosts (host1,,)(host2,,)
allhosts trustedhosts untrustedhosts

NOTE: Use the wrfile command sparingly. If the vi editor or other equivalent commands
are available, use them instead.
3.

Press Enter after the last line and then Ctrl-C to save the entries.
NOTE: If an error message is generated, disregard it.

E4-6

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

4.

Verify your entries:


system> rdfile /etc/netgroup

NOTE: It may take up to 60 seconds for modifications of the netgroup file to take effect.
5.

Verify that the rmtab file exists and identify the contents of the file in one of two ways:

From the UNIX host:


# ls l /mnt/storage_system/vol0/etc/rmtab
# more /mnt/storage_system/vol0/etc/rmtab
# more !$

From the storage system:


system> rdfile /etc/rmtab

NOTE: The rmtab file includes a list of all hosts mounted since the storage system was started.
6.

Verify that the nsswitch.conf file exists on the storage system:


# ls l /mnt/system/vol0/etc/nsswitch.conf
# more !$

Or, from the storage system:


system> rdfile /etc/nsswitch.conf

NOTE: The nsswitch.conf file contains information that defines the order in which
hostnames-to-IP-addresses, passwords, netgroups, and other configurations are resolved.
7.

View the contents of the /etc/hosts file:


system> rdfile /etc/hosts

What is the output of this command?


_____________________________________________________________________________
_____________________________________________________________________________
Ensure that your assigned UNIX host is on the list.
8.

Create a qtree in the NFSvol volume named netgroupA.

9.

Export netgroupA to the trusted targets (the trustedhosts netgroup) with read-write permissions.

10.

Mount the netgroupA qtree to the following location:


/mnt/system/netgroupA

Here system is the name of your storage system.


11.

Change the directory to the mountpoint and create a file named netgroup_file.
You have successfully exported a resource to a netgroup.

E4-7

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

TASK 7: EXPORT A QTREE USING NETAPP SYSTEM MANAGER

In this task, you export a qtree using NetApp System Manager and change the logical name of the export.
STEP ACTION

1.

In NetApp System Manager, navigate to Storage > Qtrees.

2.

Click the Create button.

3.

In the Create Qtree dialog box, enter this information:

Name: readTree
Volume: NFSvol
Enable oplocks: Cleared
Securtiy Style: unix

4.

Click Create to create the new qtree.

5.

Click Storage > Exports.

6.

Click Create.
The Create Export dialogue box appears:

Click Browse.
7.

E4-8

The Browse For Folder dialog box appears.

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

8.

Expand aggr1 and select NFSvol. Select the readTree folder.

9.

Verify that the folder path to export is /vol/NFSvol/readTree and click OK.

10.

On the Host Permissions area, click Edit.

E4-9

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

11.

In the Client Permissions session, click Edit, select All hosts, and Read-Only and Allow. Click
Save

12.

Verify that the permissions setting has been added to the Host permissions list:

Review the Share Summary page and click Modify.

E4-10

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

13.

Click Create to end the wizard.

14.

Navigate to Storage > Shared Folders > Exports and identify the new export.

TASK 8: MOUNT AN EXPORT FROM AN ADMIN HOST

In this task, you mount the export that you created earlier in this exercise.
STEP ACTION

1.

Establish a PuTTY session to the administration host and create a directory for your storage
system.

2.

In the /system_name directory, create a directory called readTree:


# mkdir /mnt/system_name/readTree

E4-11

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

STEP ACTION

3.

Mount the storage system root volume to the readTree directory and view the contents (use the
storage system name or IP address):
# mount IP_address:/readTree /mnt/system_name/readTree
# cd /mnt/system_name/readTree

4.

You should now be able to view the directory structure of your storage system root volume:
# ls al /mnt/system_name/readTree

How does this path compare with the path of the local client root?
HINT: Use # ls al /.
______________________________________________________________

5.

Try to create a file at the root of the storage system:


# touch foo

Were you successful, and why or why not?


_______________________________________
END OF EXERCISE

E4-12

Accelerated NCDA Boot Camp Data ONTAP 7-Mode: Exports and Mounts

2011 NetApp, Inc. This material is intended only for training. Reproduction is not authorized.

You might also like