how to copy a faulty hard drive

Hello. What follows is probably more a GNU/Linux question than a specific OpenSUSE issue. However, I post my question here since I am using OpenSUSE 12.1.
First things first. My system: PC with AMD 64 bit Athlon 2x Dual Core microprocessor with 3 GB DDR2 RAM on an ASUS M2N-MX SE plus motherboard (on board NVidia nForce 430/ GeForce 6150 SE graphics card and 2 SATA connections: one for the DVD W/R and the other one for the hard disk. The hard disk: used to be Maxtor Diamond Max 22, 320 GB. And this takes me to the problem.
The disk failed. It began making clicks. Now it’s in ICU (intensive care unit). By this I mean I took the disk out and replaced it by a Western Digital Caviar Blue Sata 3, 500 GB (16 GB cache). Installation of OpenSUSE 12.1 went ok (I posted a failure to install KDE desktop due to Akonadi in the 64 bit forum, so I run under GNOME).
The thing is that, before replacing the hard disk I could see my data in my /home partition (I partitioned so as to have /, /usr, /var, /tmp and /home in differente partitions) when I used a Live disc (ok, from another distro). So, fortunately, the data are there. However, I don’t know how to proceed to copy those data to my brand new disk. I imagine I have disconnect the DVD W/R and connect the old hard disk. But how will it be mounted given that mount options aren’t set in fstab? What mount options should I add to fstab to see the old hard disk? Can I mv fstab to fstab.bak and create a new fstab with options to mount the “second” failing drive? After that I would replace fstab.bak for fstab again. Nothing else comes to my mind to solve this. I would appreciate any help, since I am a rookie regarding sys configuration.
Thank you in advance for your reply. Regards,
Gerardo

Attach the dud hard drive on the second sata and don’t bother about fstab.
Boot up and run the command: su -c “fdisk -l”
That should show the partitions on the dud drive. Suppose the /home partition shows up as e,g, sdb3. Make a root-owned directory called oldhome at the location /mnt/oldhome (e.g. su -c “mkdir /mnt/oldhome”).

Mount the old home partition with: su -c “mount /dev/sdb3 /mnt/oldhome”

Now you have two options

  1. browse to the mount and pick out the files that you want, using Dolphin
  2. copy everything with the “cp” command

I would copy the whole lot with option 2 quickly ASAP because the drive could fail at any moment. I would make a directory “storage” owned by root somewhere e.g. /path_to/storage and copy with this command which would preserve ownership, permissions and timestamps:

 su -c "cp -a -u -v /mnt/oldhome/. /path_to/storage"

[That’s a deliberate full stop after the /]

You should be able to just connect it and copy the data

On 2012-02-17 20:36, swerdna wrote:
> - browse to the mount and pick out the files that you want, using
> Dolphin
> - copy everything with the “cp” command

I personally use “mc” for that.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I personally use “mc” for that.

To be of greater value to the OP, further clarification is needed. Is there some useful information missing, or maybe you simply didn’t understand the OP’s questions?

On 2012-02-18 00:16, deano ferrari wrote:
>
>> I personally use “mc” for that.
>>
> To be of greater value to the OP, further clarification is needed. Is
> there some useful information missing, or maybe you simply didn’t
> understand the OP’s questions?

What else is needed? My answer is clear enough in the context.
Or do you think I have to explain how to use mc, when there was no
explanation on how to use cp or dolphin?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

> What else is needed? My answer is clear enough in the context.
> Or do you think I have to explain how to use mc, when there was no
> explanation on how to use cp or dolphin?

More Info. No It was Not.
Yes! What is mc?
Might be more helpful.

See a pattern here?

Thank You,

Thank you swerdna and everybody else for your answers. I will stick to your comments (not difficult to follow) and see what happens… after the pc comes back from the technician. Something else happened that precludes the PC to turn. Unfortunately it’s not the power source I expected to be the problem. I changed it and still does not turn on :frowning:
I will let you know about my success copying my files after I get it back (hopefully) fixed.
By the way… I know what mc is: it’s a simple file manager. Unlike dolphin that needs X, it works under shell like yast2 showing a simple window interface (of course there are pretty nice X windows for yast2 too).
Regards,
Gerardo

You posted a cryptic, throw-away line that only a very experienced Linuxer would understand, and so it would be of no use to new users who are conversant with only the contemporary tools like Dolphin.

In cases where more obscure tools e.g. mc or cp are recommended, there needs to be some amplification e.g. see my post, post #2 in this thread, for an example of amplification.

Throw-away lines can sometimes be mistaken for self-advertisements rather than real attempts to help. Real attempts to help are usually marked by explanations containing clarity and substance.

Good luck…

On 2012-02-18 03:06, jdmcdaniel3 wrote:
>
>> What else is needed? My answer is clear enough in the context.
>> Or do you think I have to explain how to use mc, when there was no
>> explanation on how to use cp or dolphin?
>
> More Info. No It was Not.
> Yes! What is mc?
> Might be more helpful.
>
> See a pattern here?

No, sorry, I don’t.

I see no explanation in the post of what is dolphin, or how to use cp, so I
see no need at the moment to explain how to use mc, it has self help.

And no, I do not know what is dolphin.

If the OP doesn’t understand it, let him ask. And he doesn’t need it, he
already knows mc pretty well :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2012-02-18 03:46, swerdna wrote:

> You posted a cryptic, throw-away line that only a very experienced
> Linuxer would understand, and so it would be of no use to new users who
> are conversant with only the contemporary tools like Dolphin.

I’m sorry, but I do not agree.

There were cryptic advices to use dolphin or cp, with no instructions, and
actually ‘cp’ is quite difficult to use for a replication unless you don’t
feed extra parameters. I really do not see why I have to explain ‘mc’ and
you don’t have to explain ‘cp’.

And the fact is, Gerardo understood me very well.

If he did not, he would have asked and I would gladly have expanded
information - but I do not write a long post unless requested or absolutely
necessary.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

after the pc comes back from the technician
That could be you biggest mistake.

I’ve come across very few that actually know what they are doing.

Gerardo,
Please ignore the pointless argumentation taking place here and focus on the useful methods

FYI: Where a HD is faulty/failing…etc… - It is wisdom to limit the times you mess with it. So have a plan and execute it all in one.

Am 18.02.2012 05:56, schrieb caf4926:
> FYI: Where a HD is faulty/failing…etc… - It is wisdom to limit the
> times you mess with it. So have a plan and execute it all in one.
>
May I throw in another possibility which limits the time to access the
disk by using it exactly once.
One can make a clone copy of the full drive with the dd or dd_rescue
(http://www.garloff.de/kurt/linux/ddrescue/) command , then mount the
partitions from that clone and copy from there

http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux

I did that not so long ago with a hard disk from a notebook. Of course
one need enough free space somewhere for the full disk image.


PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
nVidia ION | 3GB Ram

On 02/18/2012 05:56 AM, caf4926 wrote:
> Please ignore the pointless argumentation

+1


DD

On 2012-02-18 12:12, DenverD wrote:
> On 02/18/2012 05:56 AM, caf4926 wrote:
>> Please ignore the pointless argumentation
>
> +1

Agreed, I do not see the point.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Thank you swerdna, caf and Martin for all your advice.
At the end I decided to follow swerdna’s guide and could copy all the contents to a directory named “storage” as he suggested. I didn’t need to use dd because I didn’t want a disk image, since I had changed from OpenSUSE 11.3 to OpenSUSE 12.1. Now I have the following question:
During installation of OpenSUSE 12.1 I created a user “gerardo”, the same I used during installation of OpenSUSE 11.3 in the faulty HDD. Now, how should I proceed so that all the settings (user preferences, simlinks, etc) and files (documents, photos, music, etc.) from the old user in directory copied to /home/gerardo/storage/gerardo are set in /home/gerardo, so that I can get rid of the path /home/gerardo/storage/gerardo. Just cp to the new user’s directory? What are the options for the cp command in that case. Thank you again for your reply.
Regards,
Gerardo

Thank you swerdna, caf and Martin for all your advice.
At the end I decided to follow swerdna’s guide and could copy all the contents to a directory named “storage” as he suggested. I didn’t need to use dd because I didn’t want a disk image, since I had changed from OpenSUSE 11.3 to OpenSUSE 12.1. Now I have the following question:
During installation of OpenSUSE 12.1 I created a user “gerardo”, the same I used during installation of OpenSUSE 11.3 in the faulty HDD. Now, how should I proceed so that all the settings (user preferences, simlinks, etc) and files (documents, photos, music, etc.) from the old user in directory copied to /home/gerardo/storage/gerardo are set in /home/gerardo, so that I can get rid of the path /home/gerardo/storage/gerardo. Just cp to the new user’s directory? What are the options for the cp command in that case. Thank you again for your reply.
Regards,
Gerardo

Don’t delete that backup until you are Sure everything is OK!

Personally I would just copy over your user files/directory contents and forget the settings/prefs. You just use your file browser for that.

caf,
Thank you for your fast reply. I wouldn’t delete anything before checking, for sure. I will do as suggested. Problem solved. Thanks again to all of you.
Regards.
Gerardo