From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f170.google.com ([209.85.161.170]:33912 "EHLO mail-yw0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252AbdDORGZ (ORCPT ); Sat, 15 Apr 2017 13:06:25 -0400 Received: by mail-yw0-f170.google.com with SMTP id k13so44214584ywk.1 for ; Sat, 15 Apr 2017 10:06:25 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <552552ec-6366-04f2-482f-d93d166081e1@gmail.com> References: <20170411210023.vfqck3h6nepdow3z@angband.pl> <8bc0e7b3-8df9-0def-de34-1a774d361f35@gmail.com> <552552ec-6366-04f2-482f-d93d166081e1@gmail.com> From: Chris Murphy Date: Sat, 15 Apr 2017 11:06:24 -0600 Message-ID: Subject: Re: Btrfs disk layout question To: Andrei Borzenkov Cc: Chris Murphy , "Austin S. Hemmelgarn" , Adam Borowski , Amin Hassani , Btrfs BTRFS Content-Type: text/plain; charset=UTF-8 Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Sat, Apr 15, 2017 at 12:14 AM, Andrei Borzenkov wrote: > 12.04.2017 20:21, Chris Murphy пишет: >> btrfs-map-logical is the tool that will convert logical to physical >> and also give what device it's on; but the device notation is copy 1 >> and copy 2, so you have to infer what device that is, it's not >> explicit. >> > > Actually I just checked with btrfsprogs 4.5.3 on RAID5 and it does print > OS device name for each data chunk. It does not show checksum chunk for > RAID56 though. There is no checksum chunk. The data csums are in their own tree, and only data is csum'd. The parity strip is contained within a raid56 chunk but is itself not csum'd. Another thing that I just thought of might be useful is btrfs-debugfs which is a python script in btrfs-progs, but typically not packaged. The -f option pointed at a file will show extents with Btrfs logical bytenr. So that'd be a way to get all the extents, their addresses and lengths, to then dump into btrfs-map-logical. For what it's worth, btrfs-map-logical's physical address it reports is not device LBA. It's a byte offset on the selected device. So if the device is a partition, the value is the number of bytes from the start of that partition. -- Chris Murphy