The Veritas File System (VxFS) commands for manipulating extent attributes are setext and getext; they allow the user to set up files with a given set of extent attributes or view any attributes that are already associated with a file.
See the setext
(1) and getext
(1) manual pages.
The VxFS-specific commands vxdump and vxrestore preserve extent attributes when backing up, restoring, moving, or copying files.
Most of these commands include a command-line option (-e) for maintaining extent attributes on files. You use this option with a VxFS file that has extent attribute information including reserved space, a fixed extent size, and extent alignment. The extent attribute information may be lost if the destination file system does not support extent attributes, has a different block size than the source file system, or lacks free extents appropriate to satisfy the extent attribute requirements.
The -e option takes any of the following keywords as an argument:
The following example creates a file named file1
and preallocates 2 GB of disk space for the file.
Example of setting an extent attribute
file1
:# touch file1
file1
:# setext -t vxfs -r 2g -f chgsize file1
Since the example specifies the -f chgsize option, VxFS immediately incorporates the reservation into the file and updates the file's inode with size and block count information that is increased to include the reserved space. Only users with root privileges can use the -f chgsize option.
The following example gets the extent atribute information of a file named file1
.
Example of getting an extent attribute's information
file1
:# getext -t vxfs file1 file1: Bsize 1024 Reserve 2097152 Extent Size 0
The file file1
has a block size of 1024 bytes, 36 blocks reserved, a fixed extent size of 3 blocks, and all extents aligned to 3 block boundaries. The file size cannot be increased after the current reservation is exhausted. Reservations and fixed extent sizes are allocated in units of the file system block size.