Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recovering a failing hard drive
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
qdii
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2009
Posts: 106
Location: Madrid

PostPosted: Sat Jul 02, 2011 5:01 pm    Post subject: Recovering a failing hard drive Reply with quote

Hey guys,
A friend of mine gave me her laptop to fix, and as far as I can see, its fucked up beyond repair. When I turn it on, the bios displays pops, followed by a black screen and that's about it. The keyboard doesn't respond, the hard drive is severly damaged, and parts of the screen won't display anything. But good news, what she actually wants is her documents back.
So I unsheathed my Gentoo cd, slipped it in and turned the computer in. Luckily, it boots nicely and a shell appears.

Unfortunately

Fdisk informs me that the computer only has one hard drive, which contains two partitions : sda1 is /boot , sda2 is a LVM partition.
As I know the hard drive is failing, I plug an external drive in, and copy the second partition to it
Code:

dd if=/dev/sda2 of=/mnt/key/aina.img

Some errors appear during the process but a good share of the disk seems to be copied (140GB when the capacity is 160GB makes me optimistic).
Back to my computer, I create a loop device to use the image I just created, and turn the logical volumes on.
Code:

losetup /dev/loop0 /mnt/key/aina.img
vgchange -aly

lvscan tells me that there are 3 logical volumes lv_root, lv_swap and lv_home. When I try and create their nodes, however, I come across something suspicious:

Code:

localhost qdii # vgscan --mknodes
  Reading all physical volumes.  This may take a while...
  The link /dev/vg_hera/lv_home should had been created by udev but it was not found. Falling back to direct link creation.
  The link /dev/vg_hera/lv_swap should had been created by udev but it was not found. Falling back to direct link creation.

localhost qdii # ls -l /dev/vg_hera/
total 0
lrwxrwxrwx 1 root root 27 jul  2 19:39 lv_home -> /dev/mapper/vg_hera-lv_home
lrwxrwxrwx 1 root root  7 jul  2 19:31 lv_root -> ../dm-7
lrwxrwxrwx 1 root root 27 jul  2 19:39 lv_swap -> /dev/mapper/vg_hera-lv_swap

localhost qdii # cat /dev/mapper/vg_hera-lv_home
localhost qdii #


lv_root seems to be doing okay: I can mount it, access the directories and files but as they don't hold my friend's documents, I just can't be bothered. Neither can I be by lv_swap.

So is there anybody that has an idea?
Any idea welcome ^^
Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54808
Location: 56N 3W

PostPosted: Sat Jul 02, 2011 6:36 pm    Post subject: Reply with quote

qdii,

Make a drive image with ddrescue. Do not overwrite what you have already recovered, these things usually only get worse.
Your dd command stops at the first error.

ddrescue works very hard to recover data and will not terminate unless it succeeds.
It does a binary search between errors to get all the easy to recover data quickly then goes back to the 'holes' and tries stepping the head in from both sides to have the best chance of getting a successful read.

Such drive failures are often caused by worn spin motor bearings. You can help ddrescue by trying the drive in positions that it does not normally operate in, like on edge or on its side. This enables gravity to help align the bearings for one last read.

ddrescue is slow - keep an eye on its log for progress.
It must have a log file as it uses it to know what data is still to be recovered.

Code:
emerge ddrescue

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
qdii
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2009
Posts: 106
Location: Madrid

PostPosted: Sat Jul 02, 2011 9:04 pm    Post subject: Reply with quote

Hey :)
thank you so much, ddrescue DID the job, so I consider my problem totally solved !
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54808
Location: 56N 3W

PostPosted: Sat Jul 02, 2011 9:15 pm    Post subject: Reply with quote

qdii,

You may only have a 'soft error' on the drive. It may be just one block that the drive cannot read to reallocate. Check it with smartmontools.
If thats the case, a write will force reallocation and the drive might be good for further use.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum