Thanks Qu. I followed the wiki and your advice and finally got it working. BTW I created a program printing the disk block addresses of a file. URL here if anyone else finds it a useful feature: https://github.com/oldcap/btrfs-progs/blob/master/btrfs-file-blocks.c On Fri, Jul 11, 2014 at 1:23 AM, Qu Wenruo <quwenruo@xxxxxxxxxxxxxx> wrote: > > -------- Original Message -------- > Subject: [Question] disk_bytenr with multiple devices > From: Zhe Zhang <zhe.zhang.research@xxxxxxxxx> > To: linux-btrfs@xxxxxxxxxxxxxxx > Date: 2014年07月11日 02:21 >> >> When a btrfs has multiple devices (e.g. /dev/sdb, /dev/sdc), how >> should I interpret disk_bytenr in btrfs_file_extent_item? >> >> Does it depend on the striping config? Say I used raid0, then >> disk_bytenr 0~64K will be on /dev/sdb, and 64K~128K on /dev/sdc? >> >> Thanks, >> Zhe >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in >> the body of a message to majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > https://btrfs.wiki.kernel.org/index.php/Data_Structures#btrfs_file_extent_item > As you can see in the btrfs wiki, > disk_bytenr is *logical* address in btrfs linear space. Not really on disk > address. > > If you really want the address on device, you need to find the chunk > containing the address, > then the stripe in chunk item will show the raid profile and device address > on each device. > > Thanks, > Qu -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
