public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Soltys <nozo@drutsystem.com>
To: Carsten Aulbert <carsten.aulbert@aei.mpg.de>
Cc: xfs@oss.sgi.com
Subject: Re: Map a disk LBA to filename?
Date: Mon, 27 Oct 2008 16:56:34 +0100	[thread overview]
Message-ID: <4905E4B2.2010303@drutsystem.com> (raw)
In-Reply-To: <4905C81B.50103@aei.mpg.de>

Carsten Aulbert wrote:
> Michal Soltys wrote:
>> 
>> Wouldn't something like (under xfs_db) :
>> 
>> getblock -b #block -n
>> ncheck -i #inode
>> 
>> where required #inode is reported by getblock
>> 
>> do the thing ?
>> 
> 
> Sounds nice, but my (ancient? 2.8.11) version of xfs_db does not know
> getblock (only blockget) since that also matches the command line and
> the usage looks about to be right, I'm currently trying that one, e.g.
> 

Sorry, I meant blockget.

> smartctl reports a bad LBA at 36922326. fdisk tells me the partition
> starts at 31069773, hence the block under question is 5852553.
> 
> xfs_info tells be a bsize of 4096 which I take as the block size, thus
> the xfs block to look at should be 731569, right?
> 
> xfs_db> blockget -b 731569 -n
> setting block 0/731569 to free1
> setting block 0/731569 to free2
> xfs_db>
> 
> hmm, no inode number. Does that mean this block is not used by any file
> currently - which might be perfectly fine since this partition is only
> 31% full.
> 
> Everything right so far?
> 

Yes, calculations look fine. I'm not sure what exactly is the difference 
between free1 and free2 - someone more knowledgable would have to 
comment (and overally comment about this method).

In my case when I check block allocated by some file, I get results such as:

xfs_db> blockget -b 4584722 -n
setting block 0/4584722 to data
setting inode to 36231069 for block 0/4584722
inode 36231069 block 4584722 at offset 810
sb_fdblocks 1330583, aggregate AGF count 7983498
xfs_db> ncheck -i 36231069
    36231069 stuff/data/arst.dat

and further:

xfs_db> inode 36231069
xfs_db> bmap
data offset 0 startblock 4583912 (0/4583912) count 832 flag 0

Here the file lies in the first extent, taking 832*4096 blocks.

  reply	other threads:[~2008-10-27 16:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 11:20 Map a disk LBA to filename? Carsten Aulbert
2008-10-27 11:49 ` Dave Chinner
2008-10-27 12:31   ` Carsten Aulbert
2008-10-27 13:03     ` Michal Soltys
2008-10-27 13:54       ` Carsten Aulbert
2008-10-27 15:56         ` Michal Soltys [this message]
2008-10-27 23:35       ` Dave Chinner
2008-10-28  7:11         ` Carsten Aulbert
2008-10-28  7:21           ` Dave Chinner
2008-10-28  7:38             ` Carsten Aulbert
2008-10-28  7:52               ` KELEMEN Peter
2008-10-28  9:14               ` Carsten Aulbert
2008-10-28  9:38                 ` KELEMEN Peter
2008-10-28  9:52                   ` Justin Piszcz
2008-10-30  5:23                   ` Dave Chinner
2008-10-28  9:51                 ` Michal Soltys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4905E4B2.2010303@drutsystem.com \
    --to=nozo@drutsystem.com \
    --cc=carsten.aulbert@aei.mpg.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox