Re: how to locate the file through blktrace with xfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 13, 2014 at 04:21:09PM +0800, xinxin shu wrote:
> Hi all,
> 
> 
> 
> Recently , I collect blktrace data for xfs ,  I want to find the
> corresponding file/directory through the offset ,  is there any way to do
> this ? any tips will appreciate. thx

There isn't any easy way that I'm aware of to take a raw block number
and map it back to the owner. The global space trees account for free
space only and all allocated space is tracked in the block maps of
individual inodes.

You can obtain the extent mappings for a file via xfs_bmap, but that
alone isn't useful if you don't know what file you're looking for. You
could run a find/xfs_bmap through the entire fs and sift through the
output. If that's a lot of data and this is something you need to do
repeatedly, a supporting script might be a good idea. For example, you
could probably create a program that creates a sorted index of every
allocated extent mapped to inode number. Alternatively, a script that
takes a block number parameter and searches through the extents for a
range that includes it might be more simple.

You'll also want to be cognizant of various metadata blocks (i.e., inode
xattr blocks, btree blocks, internal md for ag's, log blocks if
internal, etc.).

Brian

> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux