Re: External hard drives x 2

Reece Arnott <[email protected]>
Newsgroups gmane.org.user-groups.linux.dunedin.general
Message-ID <[email protected]>
On 07/01/14 14:29, Worik Stanton wrote:
> I have a 1 TB drive that has had a meta data suafu and I want to copy
> the data away using dd to work on recovering it.
>
>
In the past I've used safecopy to do a best-effort copy of files rather 
than a straight data stream (assuming the filesystem isn't totally 
kaput), see below.

To answer if you are going to use dd double check that you are using the 
right addressing for both source and destination, probably if=/dev/sdb1 
of=/dev/sdc1 and not /dev/sdc. This assumes that the destination is 
partitioned and formatted properly of course. You may run into problems 
if the destination partition is mounted at the time as well.

> I connecte a 2TB drive to recieve the data but it does not apear.
Thats a bit vague but I think there are only two possible readings:

Assuming the 'it' refers to the data you're trying to copy, see above 
but if 'it' is the destination drive then it is probably not partitioned 
or formatted. (if you mixed up /dev/sdc with /dev/sdc1 in your attempts 
you will have overwritten the partition table and need to recreate it). 
You can use gparted or the equivalent to partition and format the drive. 
Just make doubly sure you are working with the new drive. I'm paranoid 
so I'd not have the other drive plugged in at the time. Both drives have 
probably only got one partition that takes up the entire drive and are 
formatted NTFS.


Below is the script I got together a couple of years ago to try and copy 
DVDs that had been sun-bleached around the outside edge. It recursively 
copies the all the files as best as it can. If you can mount both 
drives, just change the source and destination to the mount points (not 
/dev/sdb1 etc) and go for it.

--- safecopy script starts---
#!/bin/bash

# Note that due to the recursive calls that use a relative path to this 
file i.e. the current folder, this should be run from the terminal by 
first navigating to the correct folder rather than just double clicking 
the file to run it.


# Currently doesn't handle these source or destination folders with 
spaces in them.
sourcefolder=/media/cdrom0/
destfolder=~/diskcopy


# This whole thing is only useful if the disk can be read enough to get 
the file TOC. If not, need to run safecopy /dev/dvd diskimage and then 
mount diskimage by right clicking and selecting to open with archive 
mounter. This would potentially first have to create the whole 4.4GB 
file before the file(s) you want can be extracted from them.

# Note that the find command will do recursive calls to this script so 
be careful if you change it
# Needs to be in the correct folder to start with so best to run from 
terminal and cd into correct folder and run using "./filename.sh"
if [ "$1" == "" ]; then find $sourcefolder -type f -exec "./$0" {} \;
else
     source=$1
     start=$((`expr length "$sourcefolder"`))
     filename=${source:$start}
     dest=$destfolder/$filename
     path=`dirname "$dest"`
     mkdir -p "$path"
     safecopy --stage1 "$source" "$dest" # lots of options, this just 
gets back most data fast
fi

--- safecopy script ends---

-- 
"Believing men would act in their own interest was not cynicism, it turned out, but sheerest optimism; in reality men do not meet so high a standard."
-- Harry Potter and the Methods of Rationality (Chapter 84)
http://hpmor.com/

Reece Arnott
Dunedin
New Zealand


_______________________________________________
DunLUG mailing list
[email protected]
http://lists.ethernal.org/listinfo/dunlug
DunLUG Wiki - http://dunlug.kallisti.net.nz/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.