![]() |
![]() |
![]() |
![]() |
![]() |
fsapadm - VxFS allocation policy administration utility
fsapadm assignckpt mount_point ckpt_name data_policy_name metadata_policy_name
fsapadm assignfile [ -f flags ] filename data_policy_name metadata_policy_name
fsapadm assignfs mount_point data_policy_name metadata_policy_name
fsapadm assignfilepat [ -f flags ] dir_name [ { pattern-entry } ... ]
fsapadm assignfilepat [ -f flags ] -F patternfile dir_name
fsapadm assignfspat mount_point [ { pattern-entry } ... ]
fsapadm assignfspat -F patternfile mount_point
fsapadm define [ -f flags ] [ -o order [ -c chunk_size ] ] [ -l complist ] mount_point policy_name component_name...
fsapadm delete mount_point policy_name
fsapadm enforcefile [ -f strict ] filename
fsapadm query mount_point policy_name
fsapadm queryckpt mount_point ckpt_name
fsapadm queryfspat mount_point
The fsapadm utility performs administrative tasks, such as assigning, defining, deleting, and enforcing allocation policies in a specified Veritas File System. policy_name specifies the name of an allocation policy. The maximum length of an allocation policy name is 64 characters. mount_point specifies the directory on which the file system is mounted.
Defining a policy does not automatically assign the policy.
Assigning or defining an allocation policy can fail because of a conflict with volume flags. For example, a policy that references volumes with the dataonly flag cannot be assigned as a metadata policy to any object. The conflict detection attempts to detect all conflicts, but there is no guarantee that all conflicts will be detected.
No cluster issues; command operates the same on cluster file systems.
Assigns allocation policies to a Storage Checkpoint.
Assigns allocation policies to an individual file. Possible values for flags are:
When assigned to a directory, allows files created in the directory to inherit the allocation policies.
Assigns the default allocation policies for an entire file system.
Assigns the pattern table to the directory specified by dir_name. Possible values for flags are:
Allows subdirectories to inherit the pattern table.
If the directory has an existing pattern table, the table is replaced. After successfully assigning the table, when a file is created in the dir_name directory, the file's name and creating process' UID and GID are matched to the patterns defined in the table in the given order. The first successful match is used to set the allocation policies of the file, taking precedence over inheriting per-file allocation policies. The flags in the matching pattern entry are applied to the allocation policy of the file being created. When a subdirectory is created, the subdirectory can inherit the pattern table of its parent directory if the table was assigned with the inherit flag.
A pattern-entry is a string with the following format:
filename/UID/GID/datapolicy/metapolicy/flags
The slash (/) is used as a delimiter. All fields are optional, and a particular field may be omitted by specifying a null string. Fields in the pattern-entry that are null (zero-length) are not used in the matching process. The policy names cannot contain "\n" or "/".
The pattern entry fields are defined as follows:
Specifies the filename component to match. Must be a non-null string to perform a match.
Specifies the user ID to match.
Specifies the group ID to match.
Specifies the data policy name string. The name cannot contain "\n" or "/".
Specifies the metadata policy name string. The name cannot contain "\n" or "/".
Specifies the pattern entry flags. Possible values for flags are:
Sets the flags of newly created files' allocation policies to inherit.
If no pattern is specified, any existing pattern table is deleted.
The pattern data can have a maximum of 8064 bytes. The number of patterns that can be stored depends on the number of pattern entries, the size of each entry, and the overhead required to store each entry.
Patterns can be checked only at runtime.
Assigns a pattern table to the file system specified by mount_point.
If the file system has an existing pattern-based table, the table is replaced. After successfully assigning the table, the file system's pattern table takes effect when a file is created in a directory that does not have a pattern table or an inheritable allocation policy. The file's name and creating process' UID and GID are matched to the patterns defined in the table in the given order. The first successful match is used to set the allocation policies of the file.
When no pattern is specified, the fsapadm command deletes any existing file system pattern tables.
See the assignfilepat keyword for the format of the pattern-entry and definitions of the pattern-entry fields.
Defines a new allocation policy or changes an existing allocation policy named policy_name at the specified mount point. In the latter case, the previously-specified components (volumes or subpolicies) are replaced by the newly-specified components. Possible values for flags are:
Allows non-privileged users to be able to assign the policy using the assign keyword. By default, only privileged users can assign policies.
Specifies that the components are subpolicies. By default, the components are volumes. You cannot mix volume and subpolicy components in the same policy.
Possible values for order are:
Allocations are done from the components in the order in which they are given in the allocation policy.
Allocations are done from the volume specified in the allocation policy that has the most free blocks. The least-full order cannot be used with the subpolicy flag.
Allocations are done from a component that is selected in a round-robin fashion from those specified in the allocation policy.
Allocations are done from a volume that is selected in a random fashion from those specified in the allocation policy. Each allocation on the selected volume is limited to a maximum chunk size specified in the policy. The balance order cannot be used with the subpolicy flag.
The default order is as-given.
Deletes an allocation policy. An allocation policy assigned to a file system, Storage Checkpoint, or file can be deleted.
Enforces the allocation policies assigned to an individual file by moving any data and metadata that does not fulfill its assigned allocation policy into new blocks that do fulfill its assigned allocation policy.
By specifying the -f strict flag, additional data and metadata may be moved to improve the allocation properties of the file with respect to the policy.
Displays the definitions of all allocation policies defined in a file system.
Displays the definition of an allocation policy.
Displays the allocation policies assigned to an entire file system.
Displays the allocation policies assigned to a Storage Checkpoint.
Displays the allocation policies assigned to an individual file.
Displays the entries of the pattern table assigned to the directory specified by dir_name.
Displays the entries of the pattern table assigned to the file system specified by mount_point.
Specifies the chunk size in the number of file system blocks or in bytes. A numeric value specifies file system blocks, while a numeric value with a suffix specifies the size in blocks or bytes: b for 512-byte blocks, k for kilobytes, m for megabytes, g for gigabytes, or t for terabytes.
The -c option can only be specified for definitions with the balance allocation order, and is mandatory for those definitions.
Specifies the name of the pattern file that contains a table of patterns. Each table entry is specified in the form of a pattern-entry with a terminating newline.
Specifies the name of the component list file that contains a list of component names, which are separated by lines or spaces. You must specify component names only once, either with the -l complist option or by command line arguments.
fsapadm returns 0 on success, 1 on failure.
The following command defines an allocation policy named raid5 using volumes vol1 and vol2, with order as-given in the file system mounted at /mnt0:
# fsapadm define -o as-given /mnt0 raid5 vol1 vol2
Component names can be specified in a file instead of on the command line. The following command can also be used to define an allocation policy named raid5 using volumes vol1 and vol2, with the order as-given in the file system mounted at /mnt0:
# fsapadm define -o as-given -l mycomplist /mnt0 raid5
The following command deletes the allocation policy named raid5 from the file system mounted at /mnt0:
The following command displays the definition of the allocation policy named raid5 in the file system mounted at /mnt0:
The following command assigns the allocation policies named raid5 and mirror as the default policies for data and metadata, respectively, for all files in the file system mounted at /mnt0:
# fsapadm assignfs /mnt0 raid5 mirror
The following command assigns the allocation policy named backup-storage as the default policy for data and metadata for the Storage Checkpoint monday_7pm in the file system mounted at /mnt0:
# fsapadm assignckpt /mnt0 monday_7pm backup-storage backup-storage
The following commands define two round-robin allocation policies, tier1 and tier2, then define a policy named mpeg, which uses the tier1 and tier2 policies. The last command assigns the mpeg policy to the file movie.mpg. Data and metadata allocations for movie.mpg will be made from tier1 in the round-robin order from vol1 and vol2, unless those volumes are full, in which case allocations will be made from tier2 in the round-robin order from vol3 and vol4:
# fsapadm define -o round-robin /mnt0 tier1 vol1 vol2
# fsapadm define -o round-robin /mnt0 tier2 vol3 vol4
# fsapadm define -f subpolicy -o as-given /mnt0 mpeg tier1 tier2
# fsapadm assignfile /mnt0/movie.mpg mpeg mpeg
The following command defines an allocation policy MyPolicy in the file system mounted at /mnt0 for the volumes vol1 and vol2, and specifies a chunk size of 2 megabytes:
# fsapadm define -o balance -c 2m /mnt1 MyPolicy vol1 vol2
The following command displays the allocation policies assigned as the defaults for all files in the file system mounted at /mnt0:
The following command displays the allocation policies assigned to the Storage Checkpoint monday_7pm in the file system mounted at /mnt0:
# fsapadm queryckpt /mnt0 monday_7pm
The following command displays the allocation policies assigned to the file movie.mpg in the file system mounted at \mnt0:
# fsapadm queryfile /mnt0/movie.mpg
The following command enforces the allocation policies assigned to the file movie.mpg in the file system mounted at /mnt0 (that is, the existing allocations are moved to match the policies, if required):
# fsapadm enforcefile /mnt0/movie.mpg
The following pattern entry matches sql.100.dat, sql.101.dat, etc.:
sq1*dat/root/root/sqldata/sqlmeta/
The following pattern entry matches ora1, ora2, orafile, etc.:
ora*/dba/oracle/oradata/orameta/
The following pattern entry matches the exact file name foo.mp3:
foo.mp3/fsuser/fcf/mp3data/mp3meta/
The following pattern entry matches song1.mp3, song2.mp3, etc., for any user or group:
The following pattern entry assigns an inheritable policy on a file or directory named TRASH when it is created:
TRASH///garbage/garbage/inherit
The following command displays the pattern table of the directory, MyDir:
sq1*dat/root/root/sqldata/sqlmeta/
ora*/dba/oracle/oradata/orameta/
foo.mp3/fsuser/fcf/mp3data/mp3meta/
TRASH///garbage/garbage/inherit
The following command defines an allocation policy named raid5 using volumes vol1 and vol2, with the order as-given in the file system mounted at /mnt0:
# fsapadm define -o as-given /mnt0 raid5 vol1 vol2
Component names can also be specified in a file instead of on the command line. The following command can also be used to define an allocation policy named raid5 using volumes vol1 and vol2, with the order as-given in the file system mounted at /mnt0:
# fsapadm define -o as-given -l mycomplist /mnt0 raid5
fsadm_vxfs(1M), fsckptadm(1M), fsvoladm(1M)
Veritas File System Administrator's Guide