Operating System - HP-UX
1833476 Members
3054 Online
110052 Solutions
New Discussion

How to view inode extent map for files

 
SOLVED
Go to solution
Hein van den Heuvel
Honored Contributor

How to view inode extent map for files

While checking out thread 1127474 I wanted to 'see' the extent map for a file.

That is something which is normally transparent to an application but it would be useful information to study fragmentation issues and other more or less subtle performance issues.

What tools are there to report the mapping of a selected files onto the disk blocks?

The closest I seem to get is getext/setext but that was not available on my test system.

On Tru64 AdfFS I would use showfile -h (or -x)
On OpenVMS I would use $DUMP/HEADER/BLOC=COUN=0

On HPUX?

For bonus points... On Linux ?

Thanks!
Hein.

Tru64 showfile man page:
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/MAN/MAN8/0369____.HTM

Link to other thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1127474
4 REPLIES 4
Sandman!
Honored Contributor

Re: How to view inode extent map for files

check out the man page for inode_vxfs(4) below:

http://docs.hp.com/en/B2355-60103/inode_vxfs.4.html

~hope it helps
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How to view inode extent map for files

The closest thing that you are going to find in HP-UX is fsdb. Man fsdb_vxfs for details.
Use extreme care with this command because you can destroy a file system although you intend to only be displaying values.
If it ain't broke, I can fix that.
Hein van den Heuvel
Honored Contributor

Re: How to view inode extent map for files

Sandman, the man page for inode_vsfs did lead me to setext and getext but those do not help. It also leads to fsadm where the -E -f sounds promissing but does not help either.

Clay, thanks! fsdb can do the job.
It's appropriatly nasty though.
One is not worthy of the data it can return if one can not figure out the criptic help.


Sample session for the benefit of future readers (notably myself! :-).

# mount /dev/test/lvol2 /mnt
# mkdir /mnt/test
# bdf /mnt -> used: 26615
# dd bs=1k count=10 oseek=100000 if=/dev/zero of=/mnt/test/sparse
# bdf /mnt -> used: 26639
# cp /mnt/test/sparse /mnt/test/real
# bdf /mnt -> used: 126635
# ls -l /mnt/test
6 real 5 sparse
# [rx2620a{root}:/]>fsdb /dev/test/lvol2
fsdb: /etc/default/fs is used for determining the file system type
> help ...
> 5 i
inode structure at 0x00000129.0100
type IFREG mode 100666 nlink 1 uid 0 gid 3 size 102410240
:
ext0: DATA boff: 0x000186a0 bno: 26904 len: 8
ext1: DATA boff: 0x000186a8 bno: 26944 len: 2
ext2: NULL boff: 0x00000000 bno: 0 len: 0
> mapall
offset device block length
0 - HOLE 100000
102400000 0 26904 8
102408192 0 26944 2
>
> 6 i
inode structure at 0x00000129.0200
type IFREG mode 100666 nlink 1 uid 0 gid 3 size 102410240
:
de: 00384 28672 59392 65536 98304 26946 0 0 0 0
des: 26240 4096 6144 32768 30760 2 0 0 0 0
>
>
> mapall
offset device block length
0 0 384 26240
26869760 0 28672 4096
31064064 0 59392 6144
37355520 0 65536 32768
70909952 0 98304 30760
102408192 0 26946 2
>
> quit

#awk '{t+=$4; print $4,t}' x
26240 26240
4096 30336
6144 36480
32768 69248
30760 100008
2 100010

Regards,
Hein van den heuvel


A. Clay Stephenson
Acclaimed Contributor

Re: How to view inode extent map for files

Sadly, I've been in UNIX long enough to learn way more than I ever wanted to about fsdb. This was what you did before there was fsck.
If it ain't broke, I can fix that.