Thread (18 messages) 18 messages, 4 authors, 2021-03-17

Re: All files are damaged after btrfs restore

From: Chris Murphy <hidden>
Date: 2021-02-25 05:53:31

On Wed, Feb 24, 2021 at 10:40 PM Chris Murphy [off-list ref] wrote:
I think you best chance is to start out trying to restore from a
recent snapshot. As long as the failed controller wasn't writing
totally spurious data in random locations, that snapshot should be
intact.
i.e. the strategy for this is btrfs restore -r option

That only takes subvolid. You can get a subvolid listing with -l
option but this doesn't show the subvolume names yet (patch is
pending)
https://github.com/kdave/btrfs-progs/issues/289

As an alternative to applying that and building yourself, you can
approximate it with:

sudo btrfs insp dump-t -t 1 /dev/sda6 | grep -A 1 ROOT_REF

e.g.
    item 9 key (FS_TREE ROOT_REF 631) itemoff 14799 itemsize 26
        root ref key dirid 256 sequence 54 name varlog34

The subvolume varlog34 is subvolid 631. It's the same for snapshots.
So the restore command will use -r 631 to restore only from that
subvolume.


-- 
Chris Murphy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help