public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* how to locate the file through blktrace with xfs
@ 2014-06-13  8:21 xinxin shu
  2014-06-13 11:08 ` Brian Foster
  0 siblings, 1 reply; 2+ messages in thread
From: xinxin shu @ 2014-06-13  8:21 UTC (permalink / raw)
  To: xfs


[-- Attachment #1.1: Type: text/plain, Size: 187 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 293 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to locate the file through blktrace with xfs
  2014-06-13  8:21 how to locate the file through blktrace with xfs xinxin shu
@ 2014-06-13 11:08 ` Brian Foster
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Foster @ 2014-06-13 11:08 UTC (permalink / raw)
  To: xinxin shu; +Cc: xfs

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@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-13 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13  8:21 how to locate the file through blktrace with xfs xinxin shu
2014-06-13 11:08 ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox