[mythtv-users] Hard drive failure -- recovery method suggestions

Mike Holden mikeholden99+mythtv at gmail.com
Sun Apr 19 21:32:29 UTC 2015


On 20 April 2015 at 07:26, Jerry <mythtv at hambone.e4ward.com> wrote:

>
> On Apr 17, 2015 6:51 AM, "Stephen Worthington" <stephen_agent at jsw.gen.nz>
> wrote:
> >
> >
> > few bad sectors.  For recording partitions, I recommend using a script
> > that runs ddrescue on each file individually in turn, something like
> > this:
> >
> > #!/bin/bash
> >
> > source=/mnt/bad/recordings
> > dest=/mnt/new/recordings
> > cd $source
> > for a in * ; do
> >     #echo $a
> >     ddrescue -v "$source/$a" "$dest/$a" "$dest/$a.log"
> > done
>
> Would the following script work?  I would like to grab all of the
> recoverable files at once.  Or should "-name *" be "-type f" to skip the
> directories?  I may have mangled the paths.
>
> #!/bin/bash
>
> source=/mnt/bad
> dest=/mnt/new
> cd $source
> find . -name * | while read a; do
>    echo $a
>    ddrescue -v "$source/$a" "$dest/$a" "$dest/$a.log"
> done
>
>
> You may well get wildcard issues using a "raw" * in a find command.

better to use:

    find . -name '*'

Even better, ditch the -name part entirely, since find will return all
entries anyway by default!

You may want to include
    -type f

to only match files (skipping directories etc.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150420/f1a812c0/attachment.html>


More information about the mythtv-users mailing list