Re: Unmountable fs - missing generation?

2017-10-19 Thread Satoru Takeuchi
At Thu, 19 Oct 2017 12:03:08 +0900,
satoru takeuchi wrote:
> 
> Resend it since I forgot to CC linux-btrfs ML >Larkin
> 
> On Oct 17, 2017, at 0:16, Larkin Lowrey 
> wrote:
> 
> I am unable to mount one my my filesystems. The superblock thinks
> the latest generation is 2220927 but I can't seem to find a root
> with that number. I can find 2220926 and 2220928 but not 2220927.
> Is there anything that I can do to recover this FS?
> 
> 
> `btrfs-select-super` may help you. Please see the following steps.
> 
> 1. Backup the current unmountable fs image if possible.
> 2. Salvage your files as much as possilbe with reading the following
> document
> if possible.
> 
> https://btrfs.wiki.kernel.org/index.php/Restore
> 
> 3. Execute `btrfs-select-super -s 1 /dev/Cached/Backups`. Please note
> that
> this command changes the contents of /dev/Cached/Backups. So if this
> command fails. Things would get worse.

I forgot to tell one important point. You can only run above mentioned
command iff 1st copy of superblock is valid. It can be confirmed
by `btrfs inspect-internal dump-super (or btrfs-dump-super)` as follows.

* valid case

```
$ sudo btrfs inspect dump-super -a /dev/sdb4
...
superblock: bytenr=67108864, device=/dev/sdb4   # 1st copy of superblock
-
csum0x423bcd19 [match]
bytenr  67108864
flags   0x1
...
```

* invalid case

```
$ sudo btrfs inspect dump-super -a /dev/sdb4
...
superblock: bytenr=67108864, device=/dev/sdb4
-
ERROR: bad magic on superblock on /dev/sdb4 at 67108864
...
```

Thanks,
Satoru

> Thanks,
> Satoru
> 
> 
> # btrfs check /dev/Cached/Backups
> checksum verify failed on 159057884594176 found 15284E33 wanted
> C8C5B54E
> checksum verify failed on 159057884594176 found 15284E33 wanted
> C8C5B54E
> checksum verify failed on 159057884594176 found 472037C9 wanted
> 9ACDCCB4
> checksum verify failed on 159057884594176 found 472037C9 wanted
> 9ACDCCB4
> Csum didn't match
> Couldn't setup extent tree
> Couldn't open file system
> 
> # btrfs-find-root -g 2220927 /dev/Cached/Backups
> Couldn't setup extent tree
> Couldn't setup device tree
> Superblock thinks the generation is 2220927
> Superblock thinks the level is 2
> 
> Found tree root at 159057884577792 gen 2220927 level 2
> Well block 101489031790592(gen: 2220928 level: 2) seems good, but
> generation/level doesn't match, want gen: 2220927 level: 2
> 
> # btrfs check --tree-root 159057884577792 /dev/Cached/Backups
> checksum verify failed on 159057884594176 found 15284E33 wanted
> C8C5B54E
> checksum verify failed on 159057884594176 found 15284E33 wanted
> C8C5B54E
> checksum verify failed on 159057884594176 found 472037C9 wanted
> 9ACDCCB4
> checksum verify failed on 159057884594176 found 472037C9 wanted
> 9ACDCCB4
> Csum didn't match
> Couldn't setup extent tree
> Couldn't open file system
> 
> # btrfs check --tree-root 101489031790592 /dev/Cached/Backups
> parent transid verify failed on 101489031790592 wanted 2220927
> found 2220928
> parent transid verify failed on 101489031790592 wanted 2220927
> found 2220928
> parent transid verify failed on 101489031790592 wanted 2220927
> found 2220928
> parent transid verify failed on 101489031790592 wanted 2220927
> found 2220928
> Ignoring transid failure
> parent transid verify failed on 159057595138048 wanted 2220927
> found 2220920
> parent transid verify failed on 159057595138048 wanted 2220927
> found 2220920
> parent transid verify failed on 159057595138048 wanted 2220927
> found 2220920
> parent transid verify failed on 159057595138048 wanted 2220927
> found 2220920
> Ignoring transid failure
> parent transid verify failed on 158652658122752 wanted 2220927
> found 2220911
> parent transid verify failed on 158652658122752 wanted 2220927
> found 2220911
> parent transid verify failed on 158652658122752 wanted 2220927
> found 2220911
> parent transid verify failed on 158652658122752 wanted 2220927
> found 2220911
> Ignoring transid failure
> Checking filesystem on /dev/Cached/Backups
> UUID: 1b213dfd-6486-47d8-8459-bc5825882023
> checking extents
> parent transid verify failed on 116329711550464 wanted 2220928
> found 2220921
> parent transid verify failed on 116329711550464 wanted 2220928
> found 2220921
> parent transid verify failed on 116329711550464 wanted 2220928
> found 2220921
> parent transid verify failed on 116329711550464 wanted 2220928
> found 2220921
> Ignoring transid failure
> parent transid verify failed on 116325928206336 wanted 2220928
> found 2220921
> 

Unmountable fs - missing generation?

2017-10-16 Thread Larkin Lowrey
I am unable to mount one my my filesystems.  The superblock thinks the 
latest generation is 2220927 but I can't seem to find a root with that 
number. I can find 2220926 and 2220928 but not 2220927. Is there 
anything that I can do to recover this FS?


# btrfs check /dev/Cached/Backups
checksum verify failed on 159057884594176 found 15284E33 wanted C8C5B54E
checksum verify failed on 159057884594176 found 15284E33 wanted C8C5B54E
checksum verify failed on 159057884594176 found 472037C9 wanted 9ACDCCB4
checksum verify failed on 159057884594176 found 472037C9 wanted 9ACDCCB4
Csum didn't match
Couldn't setup extent tree
Couldn't open file system

# btrfs-find-root -g 2220927 /dev/Cached/Backups
Couldn't setup extent tree
Couldn't setup device tree
Superblock thinks the generation is 2220927
Superblock thinks the level is 2

Found tree root at 159057884577792 gen 2220927 level 2
Well block 101489031790592(gen: 2220928 level: 2) seems good, but 
generation/level doesn't match, want gen: 2220927 level: 2


# btrfs check --tree-root 159057884577792  /dev/Cached/Backups
checksum verify failed on 159057884594176 found 15284E33 wanted C8C5B54E
checksum verify failed on 159057884594176 found 15284E33 wanted C8C5B54E
checksum verify failed on 159057884594176 found 472037C9 wanted 9ACDCCB4
checksum verify failed on 159057884594176 found 472037C9 wanted 9ACDCCB4
Csum didn't match
Couldn't setup extent tree
Couldn't open file system

# btrfs check --tree-root 101489031790592 /dev/Cached/Backups
parent transid verify failed on 101489031790592 wanted 2220927 found 2220928
parent transid verify failed on 101489031790592 wanted 2220927 found 2220928
parent transid verify failed on 101489031790592 wanted 2220927 found 2220928
parent transid verify failed on 101489031790592 wanted 2220927 found 2220928
Ignoring transid failure
parent transid verify failed on 159057595138048 wanted 2220927 found 2220920
parent transid verify failed on 159057595138048 wanted 2220927 found 2220920
parent transid verify failed on 159057595138048 wanted 2220927 found 2220920
parent transid verify failed on 159057595138048 wanted 2220927 found 2220920
Ignoring transid failure
parent transid verify failed on 158652658122752 wanted 2220927 found 2220911
parent transid verify failed on 158652658122752 wanted 2220927 found 2220911
parent transid verify failed on 158652658122752 wanted 2220927 found 2220911
parent transid verify failed on 158652658122752 wanted 2220927 found 2220911
Ignoring transid failure
Checking filesystem on /dev/Cached/Backups
UUID: 1b213dfd-6486-47d8-8459-bc5825882023
checking extents
parent transid verify failed on 116329711550464 wanted 2220928 found 2220921
parent transid verify failed on 116329711550464 wanted 2220928 found 2220921
parent transid verify failed on 116329711550464 wanted 2220928 found 2220921
parent transid verify failed on 116329711550464 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116325928206336 wanted 2220928 found 2220921
parent transid verify failed on 116325928206336 wanted 2220928 found 2220921
parent transid verify failed on 116325928206336 wanted 2220928 found 2220921
parent transid verify failed on 116325928206336 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116329892970496 wanted 2220928 found 2220921
parent transid verify failed on 116329892970496 wanted 2220928 found 2220921
parent transid verify failed on 116329892970496 wanted 2220928 found 2220921
parent transid verify failed on 116329892970496 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116325929943040 wanted 2220928 found 2220921
parent transid verify failed on 116325929943040 wanted 2220928 found 2220921
parent transid verify failed on 116325929943040 wanted 2220928 found 2220921
parent transid verify failed on 116325929943040 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116325932679168 wanted 2220928 found 2220921
parent transid verify failed on 116325932679168 wanted 2220928 found 2220921
parent transid verify failed on 116325932679168 wanted 2220928 found 2220921
parent transid verify failed on 116325932679168 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116010673373184 wanted 2220928 found 2220921
parent transid verify failed on 116010673373184 wanted 2220928 found 2220921
parent transid verify failed on 116010673373184 wanted 2220928 found 2220921
parent transid verify failed on 116010673373184 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116329479405568 wanted 2220928 found 2220921
parent transid verify failed on 116329479405568 wanted 2220928 found 2220921
parent transid verify failed on 116329479405568 wanted 2220928 found 2220921
parent transid verify failed on 116329479405568 wanted 2220928 found 2220921
Ignoring transid failure
parent transid verify failed on 116480660914176 wanted