C H A P T E R 3 |
Performing Operations |
This chapter presents topics related to file system operations. This chapter contains the following sections:
The attributes specific to Sun StorageTek SAM file systems include both user settings and general file states. This section describes these characteristics and describes how to view them using the sls command.
The user-specified attributes of a file and its system-specified states are stored in the file's inode. You can use the sls(1) -D command to display these inode attributes. For more information about sls(1) options, see the sls(1) man page.
A user can specify the following commands to set attributes:
Users can set attributes from within applications by specifying the following application programming interface (API) routines:
TABLE 3-1 shows the user-specified attributes that are listed in the inode.
You can set the attributes shown in TABLE 3-1 on both files and directories. After directory attributes are set, files that are created in the directory inherit all the directory attributes. Files created before an attribute is applied to the parent directory do not inherit directory attributes.
If you have the WORM-FS package installed, you can also apply WORM (write once read many) attributes to a file, and set the file's retention period. See Configuring WORM-FS File Systems for details.
TABLE 3-2 shows the various states that the file systems set for a file. These states are stored in the inode.
Users can gather information about file states by using the sls(1) command, which is described in Displaying File Information.
The Sun StorageTek SAM sls(1) command extends the standard UNIX ls(1) command and provides more information about a file. CODE EXAMPLE 3-1 shows detailed sls(1) command output that displays the inode information for file hgc2.
Note - TABLE 3-3 describes the meaning of each row of sls(1) output shown in CODE EXAMPLE 3-1. |
The file's mode and permissions, the number of hard links to the file, the owner of the file, and the group to which the owner belongs. |
||
The file's length in bytes, the file's admin ID number, and the file's inode number. By default, the admin ID number is 0. If this number is greater than 0, it indicates the file's accounting category for counting files and blocks. You can set this number to a value greater than 0 even when file system quotas are not enabled on this file system. For information about file system quotas, see Administering File System Quotas. The inode number is a two-part number that contains the inode number itself, followed by a period (.), followed by the inode generation number. |
||
The file attributes specific to the file. For more information about this line, see the sls(1) man page. |
||
The segment index information. This line does not appear unless the file is a segment index. The general format for this line is as follows: segments n, offline o, archdone a, damaged d;
|
||
Archive copy lines. The sls(1) command displays one archive copy line for each active or expired archive copy. The four positions in this line indicate the following: 1 - Either an expired or an active entry.
|
||
The format of the rest of the archive copy line is as follows:
|
||
The time the file content and the file's attributes were last changed. |
||
The time the file was created and became resident in the file system. |
If you are using the optional WORM-FS package, a retention line will also appear in the sls(1) output. The format of the retention line is as follows:
This indicates whether a retention period has been set for this file and, if so, what its length is. The retention-end date indicates the date on which the retention period expires. For more information about using the WORM-FS feature, see Configuring WORM-FS File Systems.
If a file has checksum-related attributes (generate, use, or valid), the sls(1) command returns a checksum line. You can use the ssum(1) command to set these attributes. The format of the checksum line is as follows:
The system displays the preceding line if checksum attributes are set for a file. You can interpret this line as follows:
This section describes how to propagate configuration file changes throughout the system. The procedures describe the propagation of changes for the following files:
You must perform these procedures under the following circumstances:
The following sections describe these procedures:
|
1. Use vi(1) or another editor to edit the file and change the file system information.
2. If you are changing the mcf file, use the sam-fsd(1M) command to check the mcf file for errors:
If the output from this command shows errors, correct them before proceeding to the next step.
3. If you are removing or changing information related to one or more file systems, issue a samcmd(1M) aridle command to idle the archiver for each affected file system defined in the mcf file.
Use this command in the following format:
For fsname, specify the name of the file system.
4. If you are removing or changing information related to one or more drives, issue a samcmd(1M) idle command to idle the archiver for each equipment ordinal assigned to each affected drive in the mcf file.
Use this command in the following format:
For eq, specify the Equipment Ordinal number of the drive.
5. Issue the umount(1M) command to unmount each file system affected by the changes.
For instructions on unmounting the file system, see Unmounting a File System.
6. Use the samd(1M) config command to propagate the changes:
7. Use the mount(1M) command to remount the file systems you unmounted.
For more information about these files, see the defaults.conf(4) or mcf(4) man pages.
|
1. Edit the file and change the removable media drive information.
2. If you are changing the mcf file, use the sam-fsd(1M) command to check the mcf file for errors:
If the output from this command shows errors, correct them before proceeding to the next step.
3. If you are removing or changing information related to one or more file systems, issue a samcmd(1M) aridle command to idle the archiver for each affected file system defined in the mcf file.
Use this command in the following format:
For fsname, specify the name of the file system.
4. If you are removing or changing information related to one or more drives, issue a samcmd(1M) idle command for the Equipment Ordinal number assigned to each affected drive in the mcf file.
Use this command in the following format:
For eq, specify the Equipment Ordinal number of the drive.
5. Use the samd(1M) stop command to stop all removable media activity:
6. Use the samd(1M) config command to propagate the changes and restart the system:
7. Use the samd(1M) start command to restart all removable media activity:
For more information about these files, see the defaults.conf(4) or mcf(4) man pages.
|
1. Use vi(1) or another editor to edit the archiver.cmd or stager.cmd file.
2. If you are changing an existing archiver.cmd file, use the archiver(1M) -lv command to validate the changes you made in the archiver.cmd file.
4. Use the samd(1M) config command to propagate the file changes and restart the system:
You can mount a Sun StorageTek SAM file system by using the Solaris OS mount(1M) command.
Mount parameters are used to manipulate file system characteristics. There are several ways to specify mount parameters. Methods at the top of the hierarchy override methods lower in the hierarchy. You can specify mount options in the following ways, listed in hierarchical order from the top down:
You can also specify mount options by using the samu(1M) operator utility or the samcmd(1M) command. Mount options enabled or disabled in this way persist until the file system is unmounted.
The following subsections describe ways to specify mount options. The Sun StorageTek Storage Archive Manager Installation and Upgrade Guide also includes information about mounting a file system.
The Solaris OS mount(1M) command mounts the file system and enables you to specify settings that override the settings specified in the /etc/vfstab file and in the /etc/opt/SUNWsamfs/samfs.cmd file. For example, you can specify the stripe width, read-ahead, write-behind, and high-water and low-water marks for disk cache utilization.
One way to use the mount(1M) command in conjunction with the samfs.cmd file is to use the samfs.cmd file as your main location for mount options and to use options on the mount(1M) command when experimenting with or tuning your system.
For example, the following command mounts file system qfs1 at /work with setuid execution disallowed and qwrite enabled. The qfs1 file system name is the Equipment Identifier. This also appears in the mcf file's Equipment Identifier field for this file system. To specify more than one mount option, separate each with a comma.
For more information about the mount(1M) command, see the mount_samfs(1M) man page.
Each Sun StorageTek SAM file system that is defined in the mcf file must have a line in the /etc/vfstab Solaris OS system file. This is required for mounting the file system.
The following is an example of a file system line in the /etc/vfstab file:
From left to right, the fields shown indicate the following:
The fields in the /etc/vfstab file must be separated by either space or tab characters.
The mount parameters field can contain any of the mount parameters listed as arguments to the -o option on the mount_samfs(1M) man page. These parameters are nearly identical to those that you can specify as directive lines in the samfs.cmd file or as arguments to the -o option in the mount(1M) command. As with the samfs.cmd file, you can include specifications for various I/O settings, read-ahead, write-behind, the stripe width, various storage and archive management settings, Qwrite, and other features.
For more information about possible mount parameters, see the mount_samfs(1M) man page. For more information about modifying the /etc/vfstab file, see the vfstab(4) man page.
The /etc/opt/SUNWsamfs/samfs.cmd file enables you to specify mount parameters for all of your Sun StorageTek SAM file systems. This file can be useful when you have multiple file systems configured and you want to specify the same mount parameters for all of them.
Using this file enables you to define all mount parameters in one place in an easily readable format. Directives specified toward the beginning of this file are global directives and apply to all Sun StorageTek SAM file systems. The second part of this file enables you to indicate the specific parameters that you want to apply to each individual file system. The ability to specify the common parameters once, and in only one place, differentiates this file from the /etc/vfstab file, in which you must specify all mount parameters for each file system.
The mount parameters that can be specified in the samfs.cmd file are nearly identical to those that you can specify in the /etc/vfstab file or as arguments to the -o option with the mount(1M) command. The possible mount parameters you can specify pertain to I/O settings, read-ahead, write-behind, the stripe width, various storage and archive management settings, WORM-FS, Qwrite, and other features. For more information about the mount parameters that can be specified in this file, see the samfs.cmd(4) man page.
In the samfs.cmd file, directives are written one per line. The file can contain comments, which must begin with a pound character (#). Characters that appear to the right of the pound character are treated as comments.
For a directive that applies globally to all file systems, place the line before any fs = line. For a directive that is specific to a particular file system, start the line with
fs = and place it after all global directives. Directives specific to a particular file system override global directives.
CODE EXAMPLE 3-2 shows a sample samfs.cmd file that sets the low-water and high-water marks for disk cache utilization for all file systems and specifies individualized parameters for two specific file systems.
low = 50 high = 75 fs = samfs1 high = 65 writebehind = 512 readahead = 1024 fs = samfs5 partial = 64 |
The directives in the samfs.cmd file override any default system settings, but arguments to the mount(1M) command override any directives in this file. Entries in the /etc/vfstab file also override directives specified in the samfs.cmd file.
For information about the mount(1M) command, see the mount_samfs(1M) man page. For information about which directives can be entered in the samfs.cmd file, see the samfs.cmd(4) man page.
You can use the Solaris OS umount(1M) command to unmount Sun StorageTek SAM file systems.
In Sun StorageTek SAM environments, you must issue commands to stop the archiver before unmounting the file system. The following procedure shows you how to idle the archiver and unmount the file system.
|
1. Issue a samcmd(1M) aridle fs.file-system command for the file system.
This stops archiving operations for the file system at a logical place before stopping the daemons.
2. Issue a samd(1M) stop command:
This command kills the sam-amld daemon.
At unmounting time, several conditions can be present in a file system that might require you to issue the umount(1M) command a second time. If necessary, use the -f option to the umount(1M) command. The -f option forces a file system to unmount. If the file system still does not unmount, use unshare(1M), fuser(1M), or another command in conjunction with the umount(1M) command. For more information on unmounting procedures, see the Sun StorageTek Storage Archive Manager Installation and Upgrade Guide.
To increase the disk cache for a file system, you add disk partitions or disk drives, and then update the mcf file and use the samgrowfs(1M) command to expand the file system. You do not need to reinitialize or restore the file system.
Note that when adding disks or partitions, the system might update the Equipment Ordinal of the historian. The system automatically generates the Equipment Ordinal of the historian unless you specifically call it out. For more information, see the historian(7) man page.
When making changes to the mcf file, be aware of the following:
|
1. Use the umount(1M) command to unmount the file system you want to expand.
For more information about unmounting a file system, see Unmounting a File System.
2. If you want to rename the file system during this procedure, use the samfsck(1M) command with its -R and -F options to rename the file system.
For more information about this command, see the samfsck(1M) man page.
3. Edit the /etc/opt/SUNWsamfs/mcf file to add the disk cache.
4. Issue the sam-fsd(1M) command to check for errors in the mcf file:
If the output from this command shows errors, correct them before proceeding to the next step.
5. Issue the samd(1M) config command to propagate the mcf file changes to the system:
For more information, see the samd(1M) man page.
6. Issue the samgrowfs(1M) command on the file system that is being expanded.
For example, type the following command to expand file system samfs1:
If you renamed the file system, run the samgrowfs(1M) command using the new name. For more information about this command, see the samgrowfs(1M) man page.
For information about mounting a Sun StorageTek SAM file system, see the mount_samfs(1M) man page.
In order to do any of the following, you must re-create the file system:
This section describes this procedure.
|
1. Back up all site-customized system files and configuration files.
Depending on your software, these files might include mcf, archiver.cmd, defaults.conf, samfs.cmd, or inquiry.conf. Back up these files for all file systems in your Sun StorageTek SAM environment. Also make sure that you have backup copies of files in the /etc/opt/SUNWsamfs directory, files in the /var/opt/SUNWsamfs directory, library catalogs, the historian, and any parameter files for network attached automated libraries.
If you do not know the names and locations of your catalog files, examine the mcf file with vi(1) or another viewing command and find the first rb entry in the mcf file. That entry contains the name of the library catalog file. If no catalog file location is specified, then the system is using the default location (/var/opt/SUNWsamfs/catalog).
2. Ensure that each file system to be modified is backed up.
File systems should be backed up regularly according to your site's policies. If you are comfortable with the backup files that already exist for your file systems, there is no need to back them up again now. If, however, you need to back up your file systems to preserve information created since the last dump file was created, do so now. For information about how to create a dump file using samfsdump, see the Sun StorageTek Storage Archive Manager Installation and Upgrade Guide.
Note that the samfsdump(1M) command issues warnings when creating the dump file if it encounters unarchived files in the file system. If warnings are issued, these files need to be archived before unmounting the file systems.
For instructions, see Unmounting a File System.
4. If you want to rename the file system during this procedure, use the samfsck(1M) command with its -R and -F options.
For more information, see the samfsck(1M) man page.
5. Edit the /etc/opt/SUNWsamfs/mcf file to add, change, or remove partitions.
For more information, see Adding Disk Cache to a File System.
6. Type the sam-fsd(1M) command to check for errors in the mcf file:
If the output from this command indicates that there are errors in the mcf file, correct them before proceeding to the next step.
7. Issue the samd(1M) config command to propagate the mcf file changes to the system:
For more information, see the samd(1M) man page.
8. Issue the sammkfs(1M) command to re-create the file system.
For example, the following command creates samfs10:
9. Issue the mount(1M) command to mount the file system.
For information about mounting a Sun StorageTek SAM file system, see the mount_samfs(1M) man page.
10. Issue the cd(1) command to change to the mount point of the file system.
11. Use thesamfsrestore(1M) command, or use File System Manager, to restore each file.
Restore from the dump file you had or from the dump file created in Step 1.
For more information, see the samfsdump(1M) man page, the File System Manager online help, or the Sun StorageTek Storage Archive Manager Troubleshooting Guide.
12. Use the restore.sh script to stage back all files that had been online:
For log-file, specify the name of the log file that was created by the sammkfs(1M) or the samfsrestore -g(1M) commands.
For mount-point, specify the mount point of the file system being restored.
For information about the restore.sh script, see the restore.sh(1M) man page.
Copyright © 2007, Sun Microsystems, Inc. All Rights Reserved.