Filestat
From Siwiki
Description The [filestat] utility is an additional file system specific command that displays the device block allocation information for a file.
The problem this utility is addressing to provide customers with a simple way of finding out how contiguous a file is on a storage device. This is required in situations where sequential file access performance is not as expected and file system clustering does not appear to be reading block sizes from the storage device as expected.
The filestat utility can be used to determine if a file has become fragemented enough to warrant reallocation of the file or rebuilding of the file system itself.
The filestat utility is also used to confirm that the file system allocation parameters chosen with mkfs(1M) are doing what the user expected.
The file system dependant front end is used to provide a similar interface for other file system implementations, should other file system vendors choose to implement the same functionallity. /usr/sbin/filestat is a hard link to /usr/sbin/clri in the same way as ff, fsck, mount etc and calls the /usr/lib/fs//filestat executable.
The output of the ufs specific filestat command is:
# filestat /home/rmc/bigfile
Inodes per cyl group: 64
Inodes per block: 64
Cylinder Group no: 0
Cylinder Group blk: 64
File System Block Size: 8192
Device block size: 512
Number of device blocks: 204928
Start Block End Block Length (Device Blocks)
----------- ----------- ----------------------
66272 -> 66463 192
66480 -> 99247 32768
1155904 -> 1188671 32768
1277392 -> 1310159 32768
1387552 -> 1420319 32768
1497712 -> 1530479 32768
1607872 -> 1640639 32768
1718016 -> 1725999 7984
1155872 -> 1155887 16
Number of extents: 9
Average extent size: 22769 Blocks
Maintenance Commands filestat(1M)
NAME
filestat - print inode block allocation
SYNOPSIS
filestat filename
DESCRIPTION
filestat prints the file system device block allocation
for the specified file.
Read and write permission is required on the specified file
system device on which the file resides.
The fileblocks utility is useful to determine the physical
layout of a file on the storage device, and for determining
if the file has become fragmented over time.
fileblocks is a symbolic link to clri .
OPTIONS
-F FSType Specify the FSType on which to operate. The
FSType should either be specified here or be
determinable from /etc/vfstab by matching spe-
cial with an entry in the table, or by consulting
/etc/default/fs.
-V Echo the complete command line, but do not execute
the command. The command line is generated by
using the options and arguments provided by the
user and adding to them information derived from
/etc/vfstab. This option should be used to verify
and validate the command line.
FILES
/etc/default/fs
default local file system type
/etc/vfstab
list of default parameters for each file system
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcsu |
|_____________________________|_____________________________|
SEE ALSO
filestat_ufs(1M), vfstab(4), attributes(5)
NOTES
This command may not be supported for all FSTypes.
Maintenance Commands filestat_ufs(1M)
NAME
filestat_ufs - print inode block allocation
SYNOPSIS
filestat filename(s)
DESCRIPTION
The ufs-specific module of fileblocks dumps the ufs device
block allocation for the specified file residing on a ufs
file system.
The special device is looked up from the mount table
/etc/mnttab and opened. Read permission is required on the
special file for the file system holding the file.
All block addresses are printed in device block numbers,
which default to 512 bytes unless otherwise printed.
A summary of the files inode location information is
printed, including the device block number of the cylinder
group number which the inode resides in and the device block
number for the cylinder group.
The device block address range for each sequential extent
for the file is printed, followed by a summary of the
number of extents for the file and the average number of
device blocks per extent.
filestat is a symbolic link to clri .
FILES
/etc/default/fs
default local file system type
/etc/mnttab
mount table
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcsu |
|_____________________________|_____________________________|
SEE ALSO
fsck(1M), vfstab(4), attributes(5)
