fileplace Command
Purpose
Displays the placement of file blocks within logical or physical volumes.
Syntax
fileplace [{ -l | -p [-o FragOffset] [ -n FragNumber] }[ -i ] [ -v ][ -a ]] File | [-m LogicalVolumeName]
Description
The fileplace command displays the placement of a specified file within the logical or physical volumes containing the file.
By default, the fileplace command lists to standard output the ranges of logical volume fragments allocated to the specified file. The order in which the logical volume fragments are listed corresponds directly to their order in the file. A short header indicates the file size (in bytes), the name of the logical volume in which the file lies, the block size (in bytes) for that volume, the fragment size in bytes, and the compression, indicating if the file system is compressed or not.
Occasionally, portions of a file may not be mapped to any fragments in the volume. These areas, whose size is an integral number of fragments, are implicitly zero-filled by the file system. The fileplace command indicates which areas in a file have no allocated fragments.
Optionally, the fileplace command also displays:
- Statistics indicating the degree to which the file is spread within the volume.
- The indirect block addresses for the file.
- The file's placement on physical (as opposed to logical) volume, for each of the physical copies of the file.
- The fileplace command is not able to display the placement of remote Network File System (NFS) files. If a remote file is specified, the fileplace command returns an error message. However, the placement of the remote file can be displayed if the fileplace command is run directly on the file server.
- The fileplace command reads the file's list of blocks directly from the logical volume on disk. If the file is newly created, extended, or truncated, the file system information may not yet be on the disk when the fileplace command is run. Use the sync command to flush the file information to the logical volume.
- There is no Indirect/Double Indirect blocks concept
in JFS2 filesystem.
The file is represented in terms of extents. Therefore the size of
the maximum extent depends on the aggregate block size. With a 512
byte aggregate block size (the smallest allowable), the maximum extent
is 512*(2^ 24-1) bytes long (slightly under 8G). With a 4096 byte
aggregate block size (the largest allowable), the maximum extent is
4096*(2^ 24-1) bytes long (slightly under 64G).
These limits apply only to a single extent; in no way do they have any limiting effects on overall file sizes.
Flags
Item | Description |
---|---|
-i | Displays the indirect blocks for the file, if any. The indirect blocks are displayed in terms of either their logical or physical volume block addresses, depending on whether the -l or -p flag is specified. |
-l | Displays file placement in terms of logical
volume fragments,
for the logical volume containing the file. The -l and -p flags are mutually exclusive. Note: If neither the -l flag nor the-p flag is specified, the -l flag is implied by default. If both flags are specified, the -p flag is used. |
-m LogicalVolumeName | Displays the logical to physical map for a logical volume. |
-n FragNumber | Displays the logical or physical file blocks ranging from the first block to the block corresponding to FragNumber. |
-o FragOffset | Displays the logical or physical file blocks ranging from the block corresponding to fragoffset + 1 to the last block. The fileplace command displays the address of the specific fragment when both the -n flag and the -o flag is specified. |
-p | Displays file placement in terms of underlying physical volume, for the physical volumes that contain the file. If the logical volume containing the file is mirrored, the physical placement is displayed for each mirror copy. The -l and -p flags are mutually exclusive. |
-v | Displays more information about the file and its placement,
including statistics on how widely the file is spread across the volume
and the degree of fragmentation in the volume. The statistics are
expressed in terms of either the logical or physical volume fragment
numbers, depending on whether the -l or -p flag is specified.
File space efficiency is calculated as the number of nonnull fragments (N) divided by the range of fragments (R) assigned to the file and multiplied by 100, or (N /R) x 100. Range is calculated as the highest assigned address minus the lowest assigned address plus 1, or MaxBlk-MinBlk+1. For example, the logical blocks written for the file are 01550 through 01557, so N equals 8. The range, R, (01557 - 01550 +1) also equals 8. Space efficiency for this file is 100% or 8/8 x 100. The -v flag message prints the results of the (N/R)+100 equation. According to this method of calculating efficiency, files greater than 32KB are never 100% efficient because of their use of the indirect block. Sequential efficiency is defined as 1 minus the number of gaps (nG) divided by number of possible gaps (nPG) or 1 - (nG/nPG). The number of possible gaps equals N minus 1 ( nPG=N - 1). If the file is written to 9 blocks (greater than 32KB), and the logical fragment column shows:
The file is stored in 2 fragments out of a possible 9 fragments. The sequential efficiency calculation for this file is:
|
-a | Marks Allocated But Not Recorded (ABNR) blocks with an asterisk (*) at the beginning of the line. ABNR is a feature provided by the J2 filesystem. |
Examples
- To
display the placement of a file in its logical volume, enter:
This example displays the list of fragments and the logical volume that contains the file data1.fileplace data1
- To display the indirect blocks for a file,
enter:
In addition to the default list of logical volume fragments, the indirect blocks (if any) used to store the file block addresses in the file system are enumerated.fileplace -i data1
- To display more placement information for a file, enter:
In addition to the default list of logical volume fragments, statistics about the placement efficiency are displayed.fileplace -v data1
- To display all information about the placement
of a file on its
physical volumes, enter:
This example displays the list of file and indirect blocks in terms of the underlying physical volumes, and includes statistics about the efficiency of the placement.fileplace -piv data1
- To display the locations
of the underlying physical volume for
the first 18 blocks in the /usr/lib/boot/unix_mp file, enter:
fileplace -n 18 -p /usr/lib/boot/unix_mp
- To display the locations of the underlying physical volume
from
the 18th block to the last block in the /usr/lib/boot/unix_mp file, enter:
fileplace -p -o 17 /usr/lib/boot/unix_mp
- To display the location of the underlying physical volume
of the
18th block in the /usr/lib/boot/unix_mp file, enter:
fileplace -o 17 -n 1 -p /usr/lib/boot/unix_mp
Files
Item | Description |
---|---|
/dev/hd0, /dev/hd1, .../dev/hdn | Specifies the logical volume. |