On Mon, Sep 24, 2012 at 04:28:08PM +0300, Sami Haahtinen wrote:
> Due to certain unfortunate chain of events, I managed to overwrite a
> small portion of my btrfs array which had only single redundancy for
> metadata. The data itself is present and only a small portion (2.5%)
> of the array was overwritten.
> 
> After quite a bit of debugging and tinkering, I realized that my chunk
> root was in the portion that was overwritten. After reading through
> the documentation I was able to pull together it's still unclear to me
> whether chunk root is something that can be rebuilt.

   Chris had some experimental code for doing it in btrfsck which
never saw the light of day (because it was too unreliable). He may
be able to offer you something to help, though.

> A transcript of btrfsck trying to recover with superblock 2 which is
> uncorrupted by itself:
> 
> root@sysresccd /root/btrfs-progs % ./btrfsck --super 2 /dev/patience/home
> using SB copy 2, bytenr 274877906944
> Check tree block failed, want=139264, have=0
> Check tree block failed, want=139264, have=0
> Check tree block failed, want=139264, have=0
> read block failed check_tree_block
> Couldn't read chunk root
> 
> If I'm interpreting the output correctly, it's trying to read bytes
> from address 139264, which would fall into the corrupted area.

   No, I believe the "want=, have=" text is referring to a generation
ID, not a block number. That's not to say that your chunk tree isn't
damaged, though -- I'm just clarifying your interpretation of the
numbers.

   Out of interest, does mounting with -o recovery help at all? (I'm
not expecting it to do much if your chunk tree's gone, but it might do
something).

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
      --- Eighth Army Push Bottles Up Germans -- WWII newspaper ---      
                     headline (possibly apocryphal)                      

Attachment: signature.asc
Description: Digital signature

Reply via email to