linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Steven Haigh <netwiz@crc.id.au>, linux-btrfs@vger.kernel.org
Subject: Re: Trying to rescue my data :(
Date: Fri, 24 Jun 2016 13:50:53 -0400	[thread overview]
Message-ID: <f0fb8364-de4b-e85f-a8ff-87892c1e3a79@gmail.com> (raw)
In-Reply-To: <47f587fd-b553-5ed7-ac38-202bf7297350@crc.id.au>

On 2016-06-24 13:43, Steven Haigh wrote:
> On 25/06/16 03:40, Austin S. Hemmelgarn wrote:
>> On 2016-06-24 13:05, Steven Haigh wrote:
>>> On 25/06/16 02:59, ronnie sahlberg wrote:
>>> What I have in mind here is that a file seems to get CREATED when I copy
>>> the file that crashes the system in the target directory. I'm thinking
>>> if I 'cp -an source/ target/' that it will make this somewhat easier (it
>>> won't overwrite the zero byte file).
>> You may want to try with rsync (rsync -vahogSHAXOP should get just about
>> everything possible out of the filesystem except for some security
>> attributes (stuff like SELinux context), and will give you nice
>> information about progress as well).  It will keep running in the face
>> of individual read errors, and will only try each file once.  It also
>> has the advantage of showing you the transfer rate and exactly where in
>> the directory structure you are, and handles partial copies sanely too
>> (it's more reliable restarting an rsync transfer than a cp one that got
>> interrupted part way through).
>
> I may try that - I came up with this:
> #!/bin/bash
>
> mount -o ro,nossd,degraded /dev/xvdc /mnt/fileshare/
>
> find /mnt/fileshare/data/Photos/ -type f -print0 |
>     while IFS= read -r -d $'\0' line; do
>         echo "Processing $line"
>         DIR=`dirname "$line"`
>         mkdir -p "/mnt/recover/$DIR"
>         if [ ! -e "/mnt/recover/$line" ]; then
>                 echo "Copying $line to /mnt/recover/$line"
>                 touch "/mnt/recover/$line"
>                 sync
>                 cp -f "$line" "/mnt/recover/$line"
>                 sync
>         fi
>     done
>
> umount /mnt/fileshare
>
> I'm slowly picking through the data - and it has crashed a few times...
> It seems that there are some checksum failures that don't crash the
> entire system - so that's a good thing to know - not sure if that means
> that it is correcting the data with parity - or something else.
>
> I'll see how much data I can extract with this and go from there - as it
> may be good enough to call it a success.
>
AH, if you're having issues with crashes when you hit errors, you may 
want to avoid rsync then, it will try to reread any files that don't 
match in size and mtime, so it would likely just keep crashing on the 
same file over and over again.

Also, looking at the script you've got, that will probably run faster 
too because it shouldn't need to call stat() on everything like rsync 
does (because of the size and mtime comparison).

  reply	other threads:[~2016-06-24 17:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 14:52 Trying to rescue my data :( Steven Haigh
2016-06-24 16:26 ` Steven Haigh
2016-06-24 16:59   ` ronnie sahlberg
2016-06-24 17:05     ` Steven Haigh
2016-06-24 17:40       ` Austin S. Hemmelgarn
2016-06-24 17:43         ` Steven Haigh
2016-06-24 17:50           ` Austin S. Hemmelgarn [this message]
2016-06-25  4:19             ` Steven Haigh
2016-06-25 16:25               ` Chris Murphy
2016-06-25 16:39                 ` Steven Haigh
2016-06-25 17:14                   ` Chris Murphy
2016-06-26  2:30                   ` Duncan
2016-06-26  3:13                     ` Steven Haigh
2016-09-11 19:48                       ` compress=lzo safe to use? (was: Re: Trying to rescue my data :() Martin Steigerwald
2016-09-11 20:06                         ` Adam Borowski
2016-09-11 20:27                           ` Chris Murphy
2016-09-11 20:49                         ` compress=lzo safe to use? Hans van Kranenburg
2016-09-12  4:36                           ` Duncan
2016-09-17  9:30                             ` Kai Krakow
2016-09-12  1:00                         ` Steven Haigh

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=f0fb8364-de4b-e85f-a8ff-87892c1e3a79@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=netwiz@crc.id.au \
    /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).