Skip Navigation Links | |
Exit Print View | |
![]() |
Sun QFS File System 5.3 Configuration and Administration Guide Sun QFS and Sun Storage Archive Manager 5.3 Information Library |
2. About the Master Configuration File
4. Configuring the File System
5. Configuring a Shared File System
6. Administering File System Quotas
7. Advanced File System Topics
Using Daemons, Processes, and Tracing
Determining Which Processes Are Being Traced
Using the setfa Command to Set File Attributes
Selecting File Attributes for Files and Directories
Configuring a Multireader File System
9. Configuring WORM-FS File Systems
11. Using QFS File Systems with SANergy (SAN-QFS)
Sun QFS file systems enable end users to set performance attributes for files and directories. Applications can enable these performance features on a per-file or per-directory basis. You can use these features as follows:
To select file attributes for files and directories
To specify the allocation method for the file
To preallocate file space
To specify the disk stripe width
For more information about implementing these features, see setfa(1) in Sun QFS and Sun Storage Archive Manager 5.3 Reference Manual.
The setfa command sets attributes on a new or existing file. The file is created if it does not already exist.
You can set attributes on a directory as well as a file. When using the setfa command with a directory, files and directories created within that directory inherit the attributes set in the original directory. To reset attributes on a file or directory to the default, use the-d (default) option. When the-d option is used, attributes are first reset to the default and then other attributes are processed.
An end user can preallocate space for a file. This space is associated with a file so that no other files in the file system can use the disk addresses allocated to this file. Preallocation ensures that space is available for a given file, which avoids a file-system-full condition. Preallocation is assigned at the time of the request rather than when the data is actually written to disk.
Note that space can be wasted by preallocation of files. If the file size is less than the allocation amount, the kernel allocates space to the file from the current file size up to the allocation amount. When the file is closed, space below the allocation amount is not freed.
You can preallocate space for a file by using the setfa command with either the -L or the-l (lowercase letter L) option. Both options accept a file length as their argument. Use the -L option for an existing file, which can be empty or contain data. Use the -l option for a file that has no data yet. If you use the -l option, the file cannot grow beyond its preallocated limit.
For example, to preallocate a 1-gigabyte file named /qfs/file_alloc, type the following:
# setfa -l 1g /qfs/file_alloc
After space for a file has been preallocated, truncating a file to 0 length or removing the file returns all space allocated for a file. There is no way to return only part of a file's preallocated space to the file system. In addition, if a file is preallocated with the -l option, there is no way to extend the file beyond its preallocated size in future operations.
By default, a file uses the allocation method and stripe width specified at mount time. See mount_samfs(1M) in Sun QFS and Sun Storage Archive Manager 5.3 Reference Manual. However, an end user might want to use a different allocation scheme for a file or directory. The user could do this by using the setfa command with the -s (stripe) option.
The allocation method can be either round-robin or striped. The -s option specifies the allocation method and the stripe width, as shown in the following table.
Table 7-2 File Allocations and Stripe Widths
|
The following example shows how to create a file explicitly by specifying a round-robin allocation method:
# setfa -s 0 /qfs/100MB.rrobin
The following example shows how to create a file explicitly by specifying a striped allocation method with a stripe width of 64 DAUs (preallocation is not used):
# setfa -s 64 /qfs/file.stripe
A user can specify that a file begin allocation on a particular striped group. If the file allocation method is round-robin, the file is allocated on the designated stripe group.
The following example shows setfa commands specifying that file1 and file2 be independently spread across two different striped groups.
Example 7-2 setfa Commands to Spread Files Across Striped Groups
# setfa -g0 -s0 file1 # setfa -g1 -s0 file2
This capability is particularly important for applications that must achieve levels of performance that approach raw device speeds. For more information, see setfa(1) in Sun QFS and Sun Storage Archive Manager 5.3 Reference Manual.