Re: Drive won't mount, please help

Chris Murphy
2020-09-27T05:44:03Z

On Sat, Sep 26, 2020 at 11:27 AM J J <j333111@icloud.com> wrote:
>
> I ran btrfs-restore and recovered some data, but not most, and not the most critical. Believe it or not, my other backup drive failed within the same week (different file system, different location), so I’m worried I lost a lot of data.
>
> I'm Following this page https://btrfs.wiki.kernel.org/index.php/Restore, is this the best source for information?

One thing missing is -l|--list-roots doesn't show the
subvolume/snapshot names. That might make recovery harder because if
there's tree damage and the data you're after is in an older snapshot
- decent chance that tree is not damaged and you can get data out that
way.

Something like this:

btrfs insp dump-t -t 1 /dev/whatever | grep -A1 'ROOT_REF'

For each item, first line contains the root ID number you need, and
the second line contains the name you're familiar with.

item 4 key (FS_TREE ROOT_REF 258) itemoff 31311 itemsize 22
root ref key dirid 256 sequence 3 name home

If I want to work on just home, I need to use

btrfs restore --ignore-errors --verbose --root 258

Also, you probably want newer btrfs-progs than 4.7. I don't know if
there have been improvements to restore since then, but why not give
it a shot and see. Most people give up because the restore tool is
sort of a choose your own adventure book.

In particular, the part about filtering with regex is a hurdle of its
own but if the subvolume/snapshot you're restoring as a lot of files
in it that you don't want to restore, then it can be useful time
savings wise. If you'd rather filter through things later, then you
can skip --path-regex option.

--
Chris Murphy