JavaScript is required to for searching.
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
search filter icon
search icon

Document Information

Preface

1.  File System Overview

2.  About the Master Configuration File

3.  mcf File Examples

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

Daemons and Processes

Trace Files

Trace File Content

Trace File Rotation

Determining Which Processes Are Being Traced

Using the setfa Command to Set File Attributes

Selecting File Attributes for Files and Directories

Preallocating File Space

Selecting a File Allocation Method and Stripe Width

Selecting a Striped Group Device

Accommodating Large Files

Configuring a Multireader File System

About I/O Types

Paged I/O

Direct I/O

I/O Switching

8.  SMB Service in SAM-QFS

9.  Configuring WORM-FS File Systems

10.  Tunable Parameters

11.  Using QFS File Systems with SANergy (SAN-QFS)

12.  Mount Options in a Shared File System

13.  Using the samu Operator Utility

Using the setfa Command to Set File Attributes

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:

For more information about implementing these features, see setfa(1) in Sun QFS and Sun Storage Archive Manager 5.3 Reference Manual.

Selecting File Attributes for Files and Directories

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.

Preallocating File Space

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.

Selecting a File Allocation Method and Stripe Width

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

-s Option
Allocation Method
Stripe Width
Explanation
0
Round-robin
Not applicable
The file is allocated on one device until that device has no space.
1–255
Striped
1–255 DAUs
The file is striped across all disk devices with this number of DAUs per disk.

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

Selecting a Striped Group Device

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.