Professional Documents
Culture Documents
PTStudy Guide
PTStudy Guide
If the environment is complex and has too many variables, then you are not able to
perform effective benchmarks.
Using the vxbench program, you can test environments that incorporate the
following features:
write
rand_read
rand_write
rand_mixed
mmap_read
mmap_write
Option
-h
Use
-P
-p
-t
-m
-s
-v
-k
2. From this, the file system identifies the sequence of file system blocks that
contain the relevant portion of the file.
3. The file system checks the buffer cache to verify whether or not the required
blocks are already in memory.
o If the blocks are in memory, the requested data is copied from those
blocks into the defined buffer.
o If the blocks are not in memory, the blocks must first be retrieved
from the underlying storage device.
4. Using a mapping function (index tables), the file system converts the logical
block address to the corresponding physical disk block address of the data.
Metadata must be processed before any data is retrieved.
5. After the physical block address is determined, the request is sent to the
underlying storage hardware device driver.
6. The file system request passes from the device driver to the storage device
where all data is physically stored. The data then passes back up through the
file system layers and returns to the calling application.
Common disk allocation methods are:
Contiguous IBM VX
Linked MS DOS
Indexed VxFS UFS
UFS allocates space for files one block at a time. When allocating space to a file.
Block-based allocation requires extra disk I/O to write file system block structure
information, or metadata. Over time, block-based allocation produces a fragmented
file system with random file access.
VERITAS File System selects a contiguous range of file system blocks, called an
extent, for inclusion in a file. The number of blocks in an extent varies and is based
on either the I/O pattern of the application, or explicit requests by the user or
programmer. Extent-based allocation enables larger I/O operations to be passed to
the underlying drivers.
Each file is associated with an index block, called an inode. In an inode, an extent is
represented as an address-length pair, which identifies the starting block address
and the length of the extent in logical blocks.
VxFS automatically selects an extent size that is based on the size of I/O write
requests.
A VxFS inode contains:
Information about a file, such as access times, file type, size, and permissions
Address blocks that identify the location of each extent allocated to the file
To display information about inodes and file system structure, you can use the ff
and ncheck commands. The ff command provides a quick view of files in a file
system, and the ncheck command provides a more detailed, structural view of the
file system.
VxFS selects a logical block size of 1K, 2K, 4K, or 8K, depending on the file system
size:
File System Size
x < 8 GB
8 GB < x < 16 GB
16 GB < x < 32 GB
x > 32 GB
The extent attributes of a file define the extent allocation policy for the file. Without
extent attributes, space is allocated to a file on the basis of extents of increasing
size.
setext [-e extent_size ] [-f flags ] [-r reservation ] file
Use the -e option to specify a fixed extent size.
Use the -r option to preallocate, or reserve, space for a file.
Use the -f option to set allocation flags. You specify multiple flags by entering
multiple instances of -f on the command line. Available allocation flags are:
Flag
align
Description
chgsize
contig
noextend
noreserve
trim
Using the setext command, reserve 36 file system blocks for the file file1, specify
a fixed extent size of 3 blocks, and align extents to 3-block boundaries. The file may
not be extended after the preallocated space is used.
# setext -r 36 -e 3 -f align -f noextend file1
You can view the extent attribute information associated with a file or set of files by
using the getext command:
getext [-f] [-s] file . . .
In the syntax, you specify the command, options, and the name of the file or files for
which you want to display information.
You add the -f option if you do not want to print the file name.
You add the -s option if you do not want to print output for files without fixed
extent sizes or reservations.
Description
-e force
-e ignore
Version 2
Version 3
Version 4
Allocation units
Structural files
With VxFS layout Version 4, the entire file system space is divided into fixed-size
allocation units. The first allocation unit starts at block zero, and all allocation units
are a fixed length of 32K blocks.
All structural information about the file system is contained in files within a structural
fileset. With the exception of the superblock, which has a known location, structural
files are not stored in a fixed location.
To take advantage of VxFS structural components that are designed to help minimize
fragmentation, you can convert existing UFS file systems to VERITAS file systems by
using the vxfsconvert utility.
Free space required by vxfsconvert is approximately 12 to 15 percent of the total
file system
Running vxfsconvert takes approximately two to three times longer than running
file system-specific fsck on UFS.
Conversion options include:
Option
-e
Description
This option estimates the amount of space required to
-n|N|y|Y
-s size
-v
Directory fragmentation
As files are created and removed, gaps are left in directory inodes. This is
known as directory fragmentation. Directory fragmentation causes directory
lookups to become slower.
Extent fragmentation
As files are created and removed, the free extent map for an allocation unit
changes from having one large free area to having many smaller free areas.
Extent fragmentation occurs when files cannot be allocated in contiguous
chunks and more extents must be referenced to access a file.
You use the fsadm command to run reports on both directory and extent
fragmentation.
Unfragmented
Badly
Fragmented
< 5%
> 50%
< 1%
> 5%
> 5%
< 5%
Percentage
Option Description
-d
The -d option reorganizes directories. Directory entries
are reordered to place subdirectory entries first, then all
other entries in decreasing order of time of last access.
-e
-D, -E
-v
-l
-t
-p
-s
-r
If you use the -D and -E with the -d and -e options, the fragmentation reports are
produced both before and after the reorganization.
Defragmenting extents, called extent reorganization, can improve performance.
During extent reorganization:
Small files (less than 64K) are made into one contiguous extent.
Large files are built from large extents.
Small and recently used (less than 14 days) files are moved near the inode
area.
Large or old files (more than 14 days since last access) are moved to the end
of the allocation unit.
Free space is clustered in the center of the data area.
VERITAS File System provides fast file system recovery after a system failure by
using a tracking feature called intent logging, or journaling.
The intent log records pending changes to the file system structure and writes the
log records to disk in advance of the changes to the file system.
The VxFS version of the fsck utility performs an intent log replay to recover a file
system without completing a full structural check of the entire file system. The time
required for log replay is proportional to the log size, not the file system size.
The intent log is a circular activity log with a default size of 1024 blocks.
The syntax for the fsck command is:
fsck [-F vxfs] [ generic_options ] [-y|Y] [-n|N]
[-o full,nolog] [-o p] special
To check file system consistency by using the intent log for the VERITAS file system
on the volume datavol, you type:
# fsck -F vxfs /dev/vx/rdsk/datadg/datavol
To perform a full file system check without using the intent log for the VERITAS file
system on the volume datavol, you type:
# fsck -F vxfs -o full,nolog /dev/vx/rdsk/datadg/datavol
To check two file systems in parallel using the intent log:
# fsck -F vxfs -o p /dev/rdsk/c1t2d0s4 /dev/rdsk/c1t0d0s5
Applications invoke I/O operations in two general ways:
Synchronously
Asynchronously