Skip to contentSkip to conversation

btrfs repair and zero-log doesn't seem to do anything

DISCUSSION Calle Kabo 2 participants 3 messages Dec 5, 2016 Btrfs file system

lore
Share & tools
lore

Calle Kabo

author
#0 lore raw
Quoted 7 lines

IMHO there will be 2 alternative method to recover:

1) Btrfs restore
The safest method to recover files.
Although it may need a lot of space to restore recovered data.

Quoted 5 lines

2) Btrfs check --init-extent-tree
This will use fs tree to try to rebuild the extent tree. I don't believe it's only extent tree corrupted, so this may make things even *worse*, but at least it won't take several TBs to recover data which you may already have backup.

Thanks! I tested restoring a small directory and it worked beautifully. Is there any way to list the files/directories? I don't think I can remember all of the paths that were on there...

/Calle

#1 lore raw
Quoted 13 lines · Calle Kabo
Quoted 7 lines

IMHO there will be 2 alternative method to recover:

1) Btrfs restore
The safest method to recover files.
Although it may need a lot of space to restore recovered data.

Quoted 5 lines

2) Btrfs check --init-extent-tree
This will use fs tree to try to rebuild the extent tree. I don't believe it's only extent tree corrupted, so this may make things even *worse*, but at least it won't take several TBs to recover data which you may already have backup.

Quoted 5 lines

Thanks! I tested restoring a small directory and it worked beautifully. Is there any way to list the files/directories? I don't think I can remember all of the paths that were on there...

/Calle

I'm not familiar with btrfs-restore tool.
But a quick glance at the man page shows there is some options like -r <rooid>
--path-regex <path>
-d
--list-roots
-D

Those options would help.
Maybe -D would list all the file structures?

And if btrfs restore works perfectly fine without even a problem, then it seems to indicate that only extent tree is corrupted.
In that case, --init-extent-tree may have a little chance to recover the fs. (But under most case, maybe over 50%?, it may make things worse)

Thanks,
Qu

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw
Quoted 2 lines

Maybe -D would list all the file structures?

I tried that first but didn't see anything, but when combined with -v it shows the files that would have been restored.

e.g.

# btrfs restore -v -D --path-regex '^/(|Documents(|/.*))$'
/dev/mapper/data-0 /tmp

Awesome, big thanks for your help!

/Calle