All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amin Hassani <ahassani@google.com>
To: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Cc: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>,
	Chris Murphy <lists@colorremedies.com>,
	Adam Borowski <kilobyte@angband.pl>,
	Amin Hassani <ahassani@chromium.org>,
	Andrei Borzenkov <arvidjaar@gmail.com>
Subject: Re: Btrfs disk layout question
Date: Wed, 12 Apr 2017 09:50:06 -0700	[thread overview]
Message-ID: <CACC_xWBakrLnAgJ7i+wJcyJ21X9oNYO4T2Og_yCHWaLHra170A@mail.gmail.com> (raw)
In-Reply-To: <ec5a00c8-5eb8-b7fa-c1e5-5eb72cb3512c@gmail.com>

Hi, Thanks for responses.

I actually need the physical addresses. FIEMAP I believe (and I
tested) gives logical address which as Andrei mentioned is useless.
I'm assuming btfs-debug-tree gives the physical addresses right? I
also need to know the compression method used on each extent and I
don't think I can get that with the fiemap stuff. It seems that fiemap
capability is not implemented in Btrfs as I'm looking at the Btrfs
implementation and based on documentation of fiemap:

"File systems wishing to support fiemap must implement a ->fiemap
callback on their inode_operations structure. The fs ->fiemap call is
responsible for
defining its set of supported fiemap flags, and calling a helper function on
each discovered extent:"

Thanks,
Amin.



On Wed, Apr 12, 2017 at 9:44 AM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
> 12.04.2017 14:20, Austin S. Hemmelgarn пишет:
>> On 2017-04-12 00:18, Chris Murphy wrote:
>>> On Tue, Apr 11, 2017 at 3:00 PM, Adam Borowski <kilobyte@angband.pl>
>>> wrote:
>>>> On Tue, Apr 11, 2017 at 12:15:32PM -0700, Amin Hassani wrote:
>>>>> I am working on a project with Btrfs and I was wondering if there is
>>>>> any way to see the disk layout of the btrfs image. Let's assume I have
>>>>> a read-only btrfs image with compression on and only using one disk
>>>>> (no raid or anything). Is it possible to get a set of offset-lengths
>>>>> for each file
>>>>
>>>> While btrfs-specific ioctls give more information, you might want to
>>>> look at
>>>> FIEMAP (Documentation/filesystems/fiemap.txt) as it works on most
>>>> filesystems, not just btrfs.  One interface to FIEMAP is provided in
>>>> "/usr/sbin/filefrag -v".
>>>
>>> Good idea. Although, on Btrfs I'm pretty sure it reports the Btrfs
>>> (internal) logical addressing; not the actual physical sector address
>>> on the drive. So it depends on what the original poster is trying to
>>> discover.
>>>
>> That said, there is a tool to translate that back, and depending on how
>> detailed you want to get, that may be more efficient than debug tree.
>
> Could you give pointer to this tool? I use filefrag on bootinfoscript to
> display physical disk offset of files of interest to bootloader. I was
> not aware it shows logical offset which makes it kinda pointless.



-- 
Amin Hassani.

  reply	other threads:[~2017-04-12 16:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 19:15 Btrfs disk layout question Amin Hassani
2017-04-11 20:43 ` Chris Murphy
2017-04-11 21:00 ` Adam Borowski
2017-04-12  4:18   ` Chris Murphy
2017-04-12 11:20     ` Austin S. Hemmelgarn
2017-04-12 16:44       ` Andrei Borzenkov
2017-04-12 16:50         ` Amin Hassani [this message]
2017-04-12 16:56         ` Austin S. Hemmelgarn
2017-04-12 17:21           ` Chris Murphy
2017-04-13  3:26             ` Andrei Borzenkov
2017-04-15  6:14             ` Andrei Borzenkov
2017-04-15 17:06               ` Chris Murphy
2017-04-12 17:25 ` Hans van Kranenburg

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=CACC_xWBakrLnAgJ7i+wJcyJ21X9oNYO4T2Og_yCHWaLHra170A@mail.gmail.com \
    --to=ahassani@google.com \
    --cc=ahassani@chromium.org \
    --cc=ahferroin7@gmail.com \
    --cc=arvidjaar@gmail.com \
    --cc=kilobyte@angband.pl \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.