linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantinos Skarlatos <k.skarlatos@gmail.com>
To: Jean-Denis Girard <jd.girard@sysnux.pf>, linux-btrfs@vger.kernel.org
Subject: Re: Undelete files / directory
Date: Fri, 29 Aug 2014 10:40:22 +0300	[thread overview]
Message-ID: <54002E66.703@gmail.com> (raw)
In-Reply-To: <ltnnfo$a57$1@ger.gmane.org>

On 28/8/2014 8:04 μμ, Jean-Denis Girard wrote:
> Hi Chris,
>
> Thanks for your detailed answer.
>
> Le 28/08/2014 06:25, Chris Murphy a écrit :
>> 9. btrfs-find-root /dev/sdc
>> Super think's the tree root is at 29917184, chunk root 20987904
>> Well block 4194304 seems great, but generation doesn't match, have=2, want=9 level 0
>> Well block 4243456 seems great, but generation doesn't match, have=3, want=9 level 0
>> Well block 29376512 seems great, but generation doesn't match, have=4, want=9 level 0
>> Well block 29474816 seems great, but generation doesn't match, have=5, want=9 level 0
>> Well block 29556736 seems great, but generation doesn't match, have=6, want=9 level 0
>> Well block 29736960 seems great, but generation doesn't match, have=7, want=9 level 0
>> Well block 29900800 seems great, but generation doesn't match, have=8, want=9 level 0
Hi all,

I did a successful btrfs restore a few months ago, saving all of my 
deleted files except 2 (So i lost about 1GB on a 4TB filesystem)
Here is what i did (this is from memory and from my .zsh_history file, 
so i may be missing something)

btrfs-find-root  /dev/sdd -o 5 > b1.txt
I think the -o 5 option is quite important here.
After that, i ran this

for i in `awk '{print $3}' b1.txt`; do echo "------------------------  
$i --------------------" && btrfs restore /dev/sdd /storage/A3/ -Dv -f 
$i  ; done

I think i did that in order to brute force a correct offset

I also have done this, in order to find the offset that gave the largest 
number of files
for i in `awk '{print $3}' b1.txt`; do echo "------------------------  
$i --------------------" && btrfs restore /dev/sdd /storage/A3/ -Dv -f 
$i |wc -l ; done


Then i did some test restores using various addresses
btrfs restore /dev/sdd /storage/A3/B1/  -vD -f 2149617336320
btrfs restore /dev/sdd /storage/A3/B1/  -vD -f 1607682736128
btrfs restore /dev/sdd /storage/A3/B1/  -vD -f 2688721551360

and then i finally did the restore using the offset that looked best

btrfs restore /dev/sdd /storage/A3/B1/  -v -f 2688721551360

I hope this helps, good luck!


> Here is what the command returns :
>
> [root@x220 ~]# btrfs-find-root /dev/mapper/home
> Super think's the tree root is at 115230801920, chunk root 131072
> Went past the fs size, exiting[root@x220 ~]#
>
> I just tried with latest btrfs-progs (from git), it returns exactly the
> same.
>
> The btrfs partition is on top of dm-crypt, could it be a problem?
>
>
> Thanks,
> Jean-Denis Girard
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Konstantinos Skarlatos


  parent reply	other threads:[~2014-08-29  7:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 18:04 Undelete files / directory Jean-Denis Girard
2014-08-28 10:04 ` Duncan
2014-08-28 16:25   ` Chris Murphy
2014-08-28 17:04     ` Jean-Denis Girard
2014-08-28 20:21       ` Chris Murphy
2014-08-28 21:23         ` Jean-Denis Girard
2014-08-28 21:39           ` Chris Murphy
2014-08-28 21:30       ` Chris Murphy
2014-08-29  7:40       ` Konstantinos Skarlatos [this message]
2014-08-30 20:12         ` Jean-Denis Girard
2014-08-30 21:26           ` Jean-Denis Girard
2014-09-01 16:27             ` Marc MERLIN
2014-09-01 17:00               ` Konstantinos Skarlatos
2014-09-02  4:08                 ` Jean-Denis Girard
2014-09-02  4:12                   ` Marc MERLIN
2014-09-02  9:00                 ` David Sterba
2014-08-28 21:51 ` Chris Murphy
2014-08-28 22:49   ` Jean-Denis Girard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54002E66.703@gmail.com \
    --to=k.skarlatos@gmail.com \
    --cc=jd.girard@sysnux.pf \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).