Exporting File Systems To UNIX
Exporting File Systems To UNIX
Process Overview
Existing File System Create Mountpoint Mount FS to Mountpoint Export Mounted FS NFS Mount from Clients
EMC Global Education
2004 EMC Corporation. All rights reserved. 4
Exporting file systems to UNIX Before a file system can be accessed by clients, the file system must be mounted and exported. After creating a file system on the Symmetrix or CLARiiON using the nas_fs command: The Celerra administrator must:
Create a mountpoint on a Data Mover. Mount the file system to the mountpoint. Export the mounted file system.
Mountpoints
Create Mountpoint Mount FS to Mountpoint Export Mounted FS NFS Mount from Clients
File systems are mounted to mountpoints Mountpoints are located on Data Movers When mounting a file system with the CLI, a mountpoint is created automatically When creating a file system with Celerra Manager, it is mounted automatically File systems can be mounted to directories (subdirectories)
File system fs1 mounted to /mp1/dir1
Creating a mountpoint A mountpoint can be created on a Data Mover before you can mount a file system. The Celerra will create the mountpoint when a file system is mounted. You must delete the mountpoint manually (with CLI, the GUI deletes the mountpoint when the file system is deleted). Each file system can be mounted (rw) on only one mountpoint, and each mountpoint can provide access to one file system at a time. Celerra supports having multiple Data Movers mounting the same file system concurrently only if all mounts are read only. The read only (ro) and read write (rw) mount options are discussed in relation to the server_mount command. Naming mountpoints Mountpoint names must begin with a "/" followed by alphanumeric characters (for example, /new). Mounting a file system You can mount a file system, rooted on a subdirectory of an already exported file system, as long as the file system has not previously been mounted above or below that mount point. For example:
File system fs1 is mounted to /mp1 Directory /dir1 is create in /mp1 File system fs2 is then mounted to /mp1/dir1 However, file system fs1 cannot be mounted to /mp1/dir1
Maximum number of nested mountpoints The maximum number of nested mountpoints that you can create under a directory is eight. However, you can only mount a file system up to the seventh level.
Creating a Mountpoint
Command
server_mountpoint mover_name -create mountpoint
Example
server_mountpoint server_2 c /mp1 server_2: done
To create a mountpoint:
server_mountpoint mover_name -create mountpoint
Note: It is not necessary to create a mountpoint prior to mounting the file system. The mount command will create the mountpoint and mount the file system. The name of the mountpoint will be the file system name.
Mounting a file system Once you create a mountpoint, you must mount your file system to the mountpoint in order to provide user access. File systems are mounted permanently by default. If you perform a temporary unmount (default), in the case of a system reboot, the mount table is activated and the file system is automatically mounted again.
Mounting Options
Mount options
Read-write/read-only Access Checking Policy (CIFS) Opportunistic Locks (CIFS) File Locking (CIFS) Notify (CIFS)
Mount as
Permanent (default) Temporary
Mount options Mount options vary for NFS and CIFS. When performing a mount, you can institute the following options to define the mount: Read-write: When a file system is mounted read-write (default) on a Data Mover, only that Data Mover is allowed access to the file system. No other Data Mover is allowed read or read-write access to that file system. Read-only: When a file system is mounted read-only on a Data Mover, clients cannot write to the file system regardless of the export permissions. A file system can be mounted read-only on several Data Movers concurrently, as long as no Data Mover has mounted the file system as read-write. Additional options for NFS users applicable for the CIFS mount are: File locking Opportunistic locks Notify Access checking policies
Example
server_mount server_2 fs1 /mp1
10
Command syntax To mount a file system to a mountpoint, type the following command: server_mount server_2 option <options> <file_system> </mountpoint> Examples To mount file system fs1 to mountpoint /mp1 on server_2, type the following command: server_mount server_2 fs1 /mp1 To mount the file system as read-only, type the following command: server_mount server_2 o ro fs1 /mp1 To mount the file system with a UNIX access policy (for CIFS), type the following command: server_mount server_2 o accesspolicy=UNIX fs1 /mp1 Mountpoint options can be combined by separating each option with a comma when typing the command, for example: server_mount server_2 o rwlock,nooplock fs1 /mp1
11
With Celerra Manager, the file system is mounted, by default, at the time you create it. A file system called marketing is shown here. When marketing was created, it was automatically mounted to a mountpoint called marketing.
12
Unmounting a file system Celerra file systems can be unmounted permanently or temporarily. Permanent unmount When a file system is unmounted permanently, the file system entries are removed from the mount table and the entries are not remounted at boot up. Examples: To permanently unmount mountpoint /mp1 on server_2, type the following command: server_umount server_2 p /mp1 To permanently unmount all file systems from all mountpoints, type the following command: server_umount ALL p a Temporary unmount When a file system is unmounted temporarily, the entries remain in the mount table and are remounted again when the Data Mover reboots. When a temporary unmount takes place, neither the file system nor the mountpoint can be deleted. Example To temporarily unmount mountpoint /mp1 on server_2, type the following command: server_umount server_2 t /mp1 Note: There is not an option to unmount a file system with Celerra Manager
13
14
Exporting file systems After creating a mountpoint and mounting a file system, you must export the path to allow NFS and/or CIFS users to access the system. Command Paths are exported from Data Movers using the server_export command. This adds an entry to the export table. Entries to the table are permanent and are automatically re-exported if the Data Mover reboots. Export options Options used when exporting the file system play an integral part of managing security to the file system. You can ignore existing options in an export entry by including the -ignore option. This forces the system to ignore the options in the export table and follow the specific guidelines of that export. It is not necessary to export the root of a file system. It is sometimes advantageous to export a directory on the file system rather than the file system itself.
Example
server_export server_2 /mp1
15
To export a file system for NFS access, use the following command: server_export server_2 option <options> </mountpoint> For example, to export the file system mounted to /mp1 on server_2: server_export server_2 /mp1 Note: Refer to the Celerra Command Reference manual for the syntax of this command and the options available.
16
This slide shows how to export an NFS file system using Celerra Manager.
17
Note: Refer to the Celerra Command Reference manual for the syntax of this command and the options available.
18
This slide shows how to permanently unexport an NFS file system using Celerra Manager.
19
Export security options The server_export command provides a variety of security options. The various options can be configured to reference a(n) IP host address, IP subnet, or Netgroup. Anonymous users Anonymous users can also be associated with a particular UID. (Celerra will first parse the /.etc/passwd, /.etc/hosts, /.etc/netgroups files for resolution of host names, UIDs, and netgroups. An NIS server will then be checked if the Data Mover has been configured to do so with the server_nis command.) The anon= option The anon= option specifies a UID that will be applied to anonymous users. A value of 0 assigns root privilege to unknown users. Alternatively, an organization can create an account for such purposes, such as guest. The default is anon=nobody; unknown users will be denied access. server_export server_2 o anon=guest /mp1 Assigning root privilege The Celerra Administrator can assign root privilege to a particular entity, such as the networks UNIX administrator's workstation. server_export server_2 o root=192.168.64.10 /mp1 Note: Refer to the slide titled Exporting File Systems (NFS) (Celerra Manager) to view the export options using Celerra Manager.
20
21
Mounting the file system Once the file system has been exported from the Celerra, NFS clients will need to NFS mount the file system. When this has been done, NFS redirects any references to a given local directory out, through the network, to the file system on the Data Mover. The typical procedure involves the use of a local directory, whether pre-existing or created specifically for this purpose.
22
Example In the example below a directory named /hmarine on a Sun Solaris workstation is being NFS mounted to a Celerra file system that is mounted to /mp1 on a Data Mover with the IP address 192.168.101.20. Similar syntax can be used for other clients supporting NFS. As root create a new directory. # mkdir /hmarine At this point /hmarine is a directory. Performing an ls command on /hmarine should yield no results because the directory is empty. NFS mount /hmarine to the Data Movers /mp1 exported file system. # mount 192.168.101.20:/mp1 /hmarine If a host name resolution solution (such as DNS) has been employed, the command could be as follows: # mount cel1dm2:/mp1 /hmarine After mounting /hmarine to the Data Movers exported /mp1, /hmarine now is a file system, not a directory. An ls command on /hmarine should now yield contents of lost&found (which is at the root of all file systems).
On NFS Clients
server_commands
Create Mountpoint Mount FS to Mountpoint Export Mounted FS Create Local Directory NFS Mount to Data Mover
23
This slide summarizes what needs to occur when creating a file system, and making it available to NFS clients on the network. 1. A meta volume is created using either a stripe, slice, or disk volume 2. A file system is created on the meta volume 3. Mountpoint is created 4. The file system is mounted to the mountpoint 5. The mountpoint is exported for NFS 6. The NFS client creates a local directory and mounts the remote Celerra file system
24
Order of Resolution
User User Access Access
IsIsaPW PW Is a a PW or Group or Group or Group file on file on file on DM? DM? DM?
No
No
Yes
Query Query NIS NIS
Is the Is the User/ Is the User/ User/ Group Group Group listed? listed? ? listed
No
Yes
Access Access granted granted
EMC Global Education
2004 EMC Corporation. All rights reserved. 25
User and Group IDs Celerra Data Movers compare users to UIDs and groups to GIDs using traditional passwd and group files or by querying NIS. Data movers will check their local /.etc/passwd and /.etc/group files first, and then check with NIS if the Data Mover has been configured for NIS.
Example
# /nas/sbin/server_user server_2 -add -passwd itechi
26
Adding users Users can be added to /.etc/passwd on a Data Mover with the server_user command. This command opens to a script that allows you to create or modify a user account. The server_user command also allows you to add or delete an optional password to a user account. This command must be run from the /nas/sbin directory as root. # /nas/sbin/server_user server_2 -add -passwd itechi Creating new user itechi User ID: 1007 Group ID: 105 Comment: Ira Techi, IS admin Home Directory: Shell: Changing password for new user itechi New passwd: Retype new passwd: server_2: done Password and group files In addition to server_user, passwd and group files can be created manually, or copied from another system, and then placed into /.etc using the server_file command.
Example
server_nis server_2 hmarine.com 192.168.64.10,192.168.64.11
NIS
27
NIS (Network Information Service) is a Network service that converts hostnames to IP addresses or IP addresses to hostnames. NIS can also be used to store user and group names used in authentication. Command syntax server_nis server_2 <nis_domain_name> <IP_Addr_of_NIS_server1>, <IP_Addr_of_NIS_server2>, Example server_nis server_2 hmarine.com 192.168.64.10,192.168.64.10 Note: EMC recommends that two NIS servers are configured for each Data Mover for redundancy.
28
This slide shows how to define an NIS server using Celerra Manager.
29
Copying passwd and group files onto a Data Mover Alternatively, passwd and group files can be copied from the NIS server using ypcat and then FTPd to the Data Movers /.etc directory using server_file. Examples To copy files from an NIS client, type the following command: # ypcat passwd >passwd # ypcat group >group To copy passwd and group files to Control Station and then FTP these files to the Data Mover, type the following command: server_file server_2 -put passwd passwd server_file server_2 -put group group
Module Summary
Key Points covered in this module: Before a file system can be accessed by clients, it must be mounted and exported from the Celerra. When a file system is mounted read/write on a Data Mover (default), only that Data Mover is allowed access to the file system. When a file system is mounted read-only on a Data Mover, clients cannot write to the file system regardless of the export permissions. The server_mount command is used to mount a file system The server_export command, or Celerra Manager is used to export a mounted file system for client access. Once a file system has been exported from the Celerra, NFS clients need to mount the file system for access.
EMC Global Education
2004 EMC Corporation. All rights reserved. 30
Closing Slide
31