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: Tue, 28 Oct 2008 10:51:58 +0100	[thread overview]
Message-ID: <4906E0BE.8050903@drutsystem.com> (raw)
In-Reply-To: <4906D80F.9050500@aei.mpg.de>

Carsten Aulbert wrote:
> 
> Carsten Aulbert wrote:
> 
>> Any idea where my logical error is?
>>
> 
> Related, more logical errors on my side probably:
> 
> Can someone give me a hint what I'm doing wrong here?
> 
> xfs_bmap -l  /local/boinc/time_stats_log
> /local/boinc/time_stats_log:
>         0: [0..127]: 280..407 128 blocks
>         1: [128..159]: 728..759 32 blocks
>         2: [160..167]: 1016..1023 8 blocks
>         3: [168..183]: 54120..54135 16 blocks
>         4: [184..207]: 656..679 24 blocks
>         5: [208..215]: 3451664..3451671 8 blocks
>         6: [216..255]: 3451624..3451663 40 blocks
>         7: [256..287]: 3451672..3451703 32 blocks
> 
>>From that I assume that this file lives in several block strips, when I
> subsequently try to get this back via xfs_db I fail miserably:
> 
> xfs_db -i /dev/sda6
> xfs_db> blockget -b 660 -n
> setting block 0/660 to data
> setting inode to 2787 for block 0/660
> inode 2787 block 660 at offset 346
> xfs_db> ncheck -i 2787
>        2787 CT_oneyear_01/S_noise_wu_84/Fstats_105.25_Snoise__WU84_84_out
> xfs_db> quit
> 
> Is it possible that blocks != bsized_blocks?
> 
> Sorry for these questions, but I'm quite lost and I have not been able
> to find the answer in the man pages.
> 

660 is interpreted (by blockget) using filesystem's block size - so it'd
correspond to 5280 in 512 byte units. That file isn't that long.

Another example:

10:37 > ls -al /music/The\ Flashbulb\ -\ 11\ -\ Remember\ Tomorrow.flac

-rw-r--r-- 1 admin users 21921889 2008-09-08 09:07 /music/The Flashbulb
- 11 - Remember Tomorrow.flac

xfs_bmap -l /music/The\ Flashbulb\ -\ 11\ -\ Remember\ Tomorrow.flac

/music/The Flashbulb - 11 - Remember Tomorrow.flac:
         0: [0..35039]: 12140432..12175471 35040 blocks
         1: [35040..42823]: 12200864..12208647 7784 blocks

Let's check file's sector 36000 - from the perspective of filesystem -
sector 12200864+(36000-35040) = 12201824. Using 4096 block size -
1525228. Now let's check using xfs_db:

10:38 > xfs_db -r /dev/mapper/vg1-music
xfs_db> blockget -b 1525228 -n
setting block 0/1525228 to data
setting inode to 126 for block 0/1525228
inode 126 block 1525228 at offset 4500
sb_fdblocks 1330583, aggregate AGF count 2661166
xfs_db> ncheck -i 126
         126 The Flashbulb - 11 - Remember Tomorrow.flac

      parent reply	other threads:[~2008-10-28  9:52 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
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 [this message]

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=4906E0BE.8050903@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