IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > AIX > ... > Performance Monitoring Tips and Techniques > AIXV53fileplace
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
AIXV53fileplace
Added by OneSkyWalker, last edited by OneSkyWalker on Dec 14, 2008  (view change)
Labels: 
(None)

How to use AIX V5.3 fileplace to determine the location on disk of a given file block

This web page is meant to supplement, not replace, other documentation which has been published:

The fileplace command displays the location of blocks within a file on the logical volume or physical volume(s) which underlie the filesystem in which the file resides. The fileplace command can be used, among many other things, to determine if a file is laid out sequentially on the underlying logical volume or physical volumes.

The fileplace command has two flags which are (as of 12/10/2008) documented neither in the fileplace man page nor in the fileplace article in the System p and AIX Information Center. There is documentation in the usage message produced by fileplace:

# fileplace -?
fileplace: illegal option -- ?
Usage: fileplace [-l] [-p [-o fragoffset] [-n fragnumber]] [-i] [-v] <filename>
   or: fileplace [-o blockoffset] [-n blocknumber] -m <lvName>
        -l:  display logical  blocks
        -p:  display physical blocks
        -o:  display placement from offset (in frag for file or in block for lv)
        -n:  specify frag or block number to display
        -i:  display indirect blocks
        -v:  verbose mode
        -m:  display logical to physical map for a logical volume
#

A more complete explanation is:

-o specifies the offset of the first block to be displayed (1st block is at offset 0, 2nd block is at offset 1, 3rd block is at offset 2, etc)
-n specifies the number of blocks to be displayed

So, for example, to display the location on the underlying physical volume of the 18th block in file /usr/lib/boot/unix_mp, use:

# fileplace -o 17 -n 1 -p /usr/lib/boot/unix_mp

File: /usr/lib/boot/unix_mp  Size: 12101874 bytes  Vol: /dev/hd2
Blk Size: 4096  Frag Size: 4096  Nfrags: 2238   Compress: no

  Physical Addresses (mirror copy 1)                                   Logical Fragment
  ----------------------------------                                   ----------------
  1850993          hdisk0            1 frags     4096 Bytes,   0.0%    0023633
#

In the example above, the 18th block of the file (at block offset 17 within the file) resides in the block at offset 1850993 on hdisk0 and at offset 23633 on logical volume hd2.

Alternatively, use:

# fileplace -n 18 -p /usr/lib/boot/unix_mp

File: /usr/lib/boot/unix_mp  Size: 12101874 bytes  Vol: /dev/hd2
Blk Size: 4096  Frag Size: 4096  Nfrags: 2238   Compress: no

  Physical Addresses (mirror copy 1)                                   Logical Fragment
  ----------------------------------                                   ----------------
  1850983-1850988  hdisk0            6 frags    24576 Bytes,   0.3%    0023623-0023628
  unallocated                        2 frags     8192 Bytes,   0.0%    unallocated
  1850990          hdisk0            1 frags     4096 Bytes,   0.0%    0023630
  unallocated                        1 frags     4096 Bytes,   0.0%    unallocated
  1850991          hdisk0            1 frags     4096 Bytes,   0.0%    0023631
  unallocated                        5 frags    20480 Bytes,   0.0%    unallocated
  1850992-1850993  hdisk0            2 frags     8192 Bytes,   0.1%    0023632-0023633
#

and examine the last block displayed.

The dd command can be used to confirm that the file block, the logical volume block, and the disk block all contain the same data:

# dd if=/usr/lib/boot/unix_mp bs=4k skip=17 count=1 | od -Ad -tx | head
1+0 records in.
1+0 records out.
0000000  00000000 00000000 00000000 00000000
*
0000112  00000000 00000000 7d7042a6 818b0790
0000128  3c8041c6 38644e6d 7c6c19d6 38033039
0000144  900b0790 60030000 4e800020 00000000
0000160  000c0400 00000000 00000000 00000000
0000176  00000000 00000000 00000000 00000000
0000192  38207f47 00000000 00000000 00000000
0000208  00000000 00000000 00000000 00000000
*
# dd if=/dev/hdisk0 bs=4k skip=1850993 count=1 | od -Ad -tx | head
1+0 records in.
1+0 records out.
0000000  00000000 00000000 00000000 00000000
*
0000112  00000000 00000000 7d7042a6 818b0790
0000128  3c8041c6 38644e6d 7c6c19d6 38033039
0000144  900b0790 60030000 4e800020 00000000
0000160  000c0400 00000000 00000000 00000000
0000176  00000000 00000000 00000000 00000000
0000192  38207f47 00000000 00000000 00000000
0000208  00000000 00000000 00000000 00000000
*
# dd if=/dev/hd2 bs=4k skip=23633 count=1 | od -Ad -tx | head
1+0 records in.
1+0 records out.
0000000  00000000 00000000 00000000 00000000
*
0000112  00000000 00000000 7d7042a6 818b0790
0000128  3c8041c6 38644e6d 7c6c19d6 38033039
0000144  900b0790 60030000 4e800020 00000000
0000160  000c0400 00000000 00000000 00000000
0000176  00000000 00000000 00000000 00000000
0000192  38207f47 00000000 00000000 00000000
0000208  00000000 00000000 00000000 00000000
*
#

The dd command might perform better if raw devices are used rather than block devices:

# dd if=/dev/rhdisk0 bs=4k skip=1850993 count=1 | od -Ad -tx | head
1+0 records in.
1+0 records out.
0000000  00000000 00000000 00000000 00000000
*
0000112  00000000 00000000 7d7042a6 818b0790
0000128  3c8041c6 38644e6d 7c6c19d6 38033039
0000144  900b0790 60030000 4e800020 00000000
0000160  000c0400 00000000 00000000 00000000
0000176  00000000 00000000 00000000 00000000
0000192  38207f47 00000000 00000000 00000000
0000208  00000000 00000000 00000000 00000000
*
# dd if=/dev/rhd2 bs=4k skip=23633 count=1 | od -Ad -tx | head
1+0 records in.
1+0 records out.
0000000  00000000 00000000 00000000 00000000
*
0000112  00000000 00000000 7d7042a6 818b0790
0000128  3c8041c6 38644e6d 7c6c19d6 38033039
0000144  900b0790 60030000 4e800020 00000000
0000160  000c0400 00000000 00000000 00000000
0000176  00000000 00000000 00000000 00000000
0000192  38207f47 00000000 00000000 00000000
0000208  00000000 00000000 00000000 00000000
*
#

The contents of this web page solely reflect the personal views of the authors and do not necessarily represent the views, positions, strategies or opinions of IBM or IBM management. Please use the Add Comment link at the bottom of the page to provide feedback. Note: Until you sign in (using the link in the upper right corner of this web page), you will not see the Add Comment link and you can not add a comment. If you do not already have an IBM ID, use the Register Now link on the sign in page to obtain one. Registration is quick and easy.


 
    About IBM Privacy Contact