recovering data from old HDD

I’ve just got a STA/IDE to USB 2.0 gadgetas a quick and dirty way to get data off a HDD

Plugged everything in hoping with no particualr reason that it would work like a USB stick.

Device notifier spotted drive but wouldn’t mount it


dmesg | tail
[20197.639369] sd 8:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[20197.639373] sd 8:0:0:0: [sdb]  Sense Key : Medium Error [current] 
[20197.639378] sd 8:0:0:0: [sdb]  Add. Sense: Peripheral device write fault
[20197.639383] sd 8:0:0:0: [sdb] CDB: Write(10): 2a 00 00 60 7c cf 00 00 08 00
[20197.639391] end_request: I/O error, dev sdb, sector 6323407
[20197.639397] Buffer I/O error on device sdb6, logical block 8210
[20197.639399] lost page write due to I/O error on sdb6
[20197.639429] REISERFS warning (device sdb6): journal-837 _update_journal_header_block: IO error during journal replay
[20197.639434] REISERFS warning (device sdb6): reiserfs-2006 journal_init: Replay Failure, unable to mount
[20197.639603] REISERFS warning (device sdb6): sh-2022 reiserfs_fill_super: unable to initialize journal space

I don’t think the drive is bad.
I can’t find much on what to do next
May I ask for help and suggestions please?

Further info



fdisk -l

Disk /dev/sda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders, total 240121728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e14af

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     4192964     2096451   82  Linux swap / Solaris
/dev/sda2   *     4192965    46122614    20964825   83  Linux
/dev/sda3        46122615   240107489    96992437+  83  Linux

Disk /dev/sdb: 82.0 GB, 81964302336 bytes
16 heads, 63 sectors/track, 158816 cylinders, total 160086528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *     4193280   160086527    77946624    f  W95 Ext'd (LBA)
/dev/sdb5         4193343     6257663     1032160+  82  Linux swap / Solaris
/dev/sdb6         6257727   160086527    76914400+  83  Linux

Well it looks to me as though the ReiserFS file system is corrupted on the sdb6 partition. There are three basic tests you could perform in a root console:

  1. Check the file system logic with:

fsck /dev/sdb6

This may find that you have to rebuild the filesystem tree and that may result in loss of data.

  1. Check the disk hardware itself with a simple read test:

badblocks -sv /dev/sdb

  1. Check the disk hardware with a much longer but more rigorous non destructive read write test:

badblocks -svnt random /dev/sdb

Good luck.

On 2011-03-28 00:36, gerrygavigan wrote:

> Code:
> --------------------
>
> dmesg | tail
> [20197.639369] sd 8:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
> [20197.639373] sd 8:0:0:0: [sdb] Sense Key : Medium Error [current]
> [20197.639378] sd 8:0:0:0: [sdb] Add. Sense: Peripheral device write fault
> [20197.639383] sd 8:0:0:0: [sdb] CDB: Write(10): 2a 00 00 60 7c cf 00 00 08 00
> [20197.639391] end_request: I/O error, dev sdb, sector 6323407
> [20197.639397] Buffer I/O error on device sdb6, logical block 8210
> [20197.639399] lost page write due to I/O error on sdb6

You can not continue with that type of error. I don’t know if the problem
is the disk or the gadget. Try to connect to real hardware port, run smart
tests.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Thank you both for replying.

I didn’t really understand what a smart test was so I went with the first set of advice, which seems to indicate the drive is at least accessible



fsck /dev/sdb6

Will read-only check consistency of the filesystem on /dev/sdb6
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Mon Mar 28 15:55:16 2011
###########
Replaying journal: Done.
Reiserfs journal '/dev/sdb6' in blocks [18..8211]: 0 transactions replayed
Checking internal tree.. \/  1 (of   4|/ 42 (of 122\bad_internal: vpf-10320: block 7372921, items 142 and 143: The wrong order of items: [3475 337075 0x0 SD (0)], [3475 336913 0x401 DRCT (2)]
 the problem in the internal node occured (7372921), whole subtree is skipped
/  2 (of   4|/ 67 (of 152|/ 28 (of 148|block 16154825: The number of items (18) is incorrect, should be (9)
 the problem in the internal node occured (16154825), whole subtree is skipped
/112 (of 152//110 (of 116\
The problem has occurred looks like a hardware problem. If you have
bad blocks, we advise you to get a new hard drive, because once you
get one bad block  that the disk  drive internals  cannot hide from
your sight,the chances of getting more are generally said to become
much higher  (precise statistics are unknown to us), and  this disk
drive is probably not expensive enough  for you to you to risk your
time and  data on it.  If you don't want to follow that follow that
advice then  if you have just a few bad blocks,  try writing to the
bad blocks  and see if the drive remaps  the bad blocks (that means
it takes a block  it has  in reserve  and allocates  it for use for
of that block number).  If it cannot remap the block,  use badblock
option (-B) with  reiserfs utils to handle this block correctly.

bread: Cannot read the block (18514580): (Input/output error).

Warning... fsck.reiserfs for device /dev/sdb6 exited with signal 6.

badblocks -sv /dev/sdb chunters on to over 30,000,000 blocks (well past the data content of the drive) until I cntl-c’ed it

more research suggests I need reiserfsprogs but the only source I could find

reiserfsprogs Downloads - Linux Packages Search

doesn’t have openSUSE packages

May I ask if anyone knows where to find them?

Further research

https://reiser4.wiki.kernel.org/index.php/Reiserfsprogs

I’ve compiled reiserfsprogs and based on

http://www.cyberciti.biz/tips/repairing-reiserfs-file-system-with-reiserfsck.html

this is where I got to


reiserfsck --scan-whole-partition --rebuild-tree /dev/sdb6
reiserfsck 3.6.21 (2009 www.namesys.com)

Will rebuild the filesystem (/dev/sdb6) tree
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
Replaying journal: Done.
Reiserfs journal '/dev/sdb6' in blocks [18..8211]: 0 transactions replayed
###########
reiserfsck --rebuild-tree started at Mon Mar 28 16:43:18 2011
###########

Pass 0:
####### Pass 0 #######
The whole partition (19228592 blocks) is to be scanned
Skipping 8797 blocks (super block, journal, bitmaps) 19219795 blocks will be read
0%block 369320: The number of items (1) is incorrect, should be (0) - corrected
block 369320: The free space (0) is incorrect, should be (4072) - corrected
                                                     left 18716292, 5244 /sec
The problem has occurred looks like a hardware problem. If you have
bad blocks, we advise you to get a new hard drive, because once you
get one bad block  that the disk  drive internals  cannot hide from
your sight,the chances of getting more are generally said to become
much higher  (precise statistics are unknown to us), and  this disk
drive is probably not expensive enough  for you to you to risk your
time and  data on it.  If you don't want to follow that follow that
advice then  if you have just a few bad blocks,  try writing to the
bad blocks  and see if the drive remaps  the bad blocks (that means
it takes a block  it has  in reserve  and allocates  it for use for
of that block number).  If it cannot remap the block,  use badblock
option (-B) with  reiserfs utils to handle this block correctly.

bread: Cannot read the block (512047): (Input/output error).

Aborted

I would be grateful for a few more words of advice

On 2011-03-28 17:36, gerrygavigan wrote:
>
> Thank you both for replying.
>
> I didn’t really understand what a smart test was so I went with the
> first set of advice, which seems to indicate the drive is at least
> accessible
>

No, it is not.

Insist on running smart tests, or manufacturer HD tests.

smart → S.M.A.R.T. → wikipedia.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

OK, I’ve read Wikpedia, thank you, but I still cannot work out the next stage.

Ultimately

I’d like to do a one-time read of what used to be a /home directory
then extract such files as might still be there

I’m not sure I understand how the SMART test takes me closer to that.
I don’t really want or need to integrate the disc into my file system.

On 2011-03-28 18:06, gerrygavigan wrote:
>
> I’ve compiled reiserfsprogs and based on

> reiserfsck --scan-whole-partition --rebuild-tree /dev/sdb6

reiserfsck is part of the distro.

> The problem has occurred looks like a hardware problem. If you have

> Aborted
>
> I would be grateful for a few more words of advice

You should give thanks that the process aborted, it would have destroyed
your data. You have hardware problems, perhaps in the gadget or in the HD.

You must connect that disk to a real [s|p]ATA port and do a hardware check,
either with smartctl or with the HD manufacturer test disk.

This is unavoidable, want it or not.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On 03/28/2011 06:06 PM, gerrygavigan wrote:

>
> If you have bad blocks, we advise you to get a new hard drive

that is pretty clear to me!

if you have data on that drive which is valuable to you then STOP
accessing it NOW…unplug it, don’t spin it up again until you are
prepared to pull data off!

get a new drive, install it, and install an operating system on it
(note: i do not advise using reiser…i also threw away a drive
(about three years ago) after bad blocks showed up on a reiser fs
drive…YMMV!

after you have your new system built, then before you connect the bad
drive again do LOTS of research on the best way to NOT destroy the
data which still might be recoverable…and, good luck–i had zero
luck in getting any data off mine, but you may be luckier…

however, if the data is very valuable, there are professionals who
will pull all the data off that can be had…but, it is VERY VERY
expensive…

lots of adverts on the net for such services…

> I would be grateful for a few more words of advice

protect your data prior to disaster…
yes, i know that backup is a pain…
until you compare it to data loss…


CAVEAT: http://is.gd/bpoMD
Tried LibreOffice? Do that and help at http://is.gd/dZ9j2W
[NNTP via openSUSE 11.3 + KDE4.5.5 + Thunderbird3.1.8]

On 2011-03-29 00:18, DenverD wrote:
> On 03/28/2011 06:06 PM, gerrygavigan wrote:
>
>>
>> If you have bad blocks, we advise you to get a new hard drive
>
> that is pretty clear to me!

There is a doubt, because he is using a new gadget, for lack of its proper
name, that converts pata or sata (I don’t know which he has) to USB, and
this thing could be faulty. Either the gadget or the disk. Thus, I said to
connect without the gadget - which is also necessary (usually) for run
hardware tests like S.M.A.R.T. does.

Hopefully, it is the new gadget which is faulty, not the disk.

About reiserfs… I have disks and partitions with that filesystem, I
“love” it. However, when it crashes, it crashes royally. Trying an
reiserfsck on a disk with bad or corrupted data can be maddening. I would
never try it on the original disk, but on a copy made with ddrescue.

(My nntp local store is on a reiserfsck partition. It is ideal, thousands
of very small files. It is also ideal for maildir storage)


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Carlos E. R. wrote:

> I would
> never try it on the original disk, but on a copy made with ddrescue.

Best advice I’ve seen in the thread - ddrescue to the new drive, then
recover data from the clone. You may have some (hopefully just a few) bad
blocks but the ddrescue copy will at least put the garbaged sectors to good
sectors on the new drive so that you can read the garbage and not block any
further reads. Also, you can try multiple passes with ddrescue and likely
recover a few more of the bad blocks with each pass. Tedious and time
consuming but that’s the best way to get data off a disk with hard errors
short of professional help.


Will Honea

Carlos E. R. wrote:
> On 2011-03-29 00:18, DenverD wrote:
>> On 03/28/2011 06:06 PM, gerrygavigan wrote:
>>
>>> If you have bad blocks, we advise you to get a new hard drive
>> that is pretty clear to me!
>
> There is a doubt, because he is using a new gadget, for lack of its proper
> name, that converts pata or sata (I don’t know which he has) to USB, and
> this thing could be faulty. Either the gadget or the disk. Thus, I said to
> connect without the gadget - which is also necessary (usually) for run
> hardware tests like S.M.A.R.T. does.
>
> Hopefully, it is the new gadget which is faulty, not the disk.

@gerrygavigan, PLEASE listen to what Carlos is saying.

Stop running software (especially the amusing effort of downloading and
building something that was already installed on your system! :slight_smile:

Carlos knows what he is talking about. You have a HARDWARE failure* and
at the moment nobody knows whether it is you USB adapter or your hard
disk. You MUST try the hard disk with a real disk adapter. It may
completely solve your problem.

Cheers, Dave

  • PS There is one other possibility, I think, which is that there is a
    kernel incompatibility with the USB adapter. But again, connecting the
    disk to a real disk port will solve that.

Grateful for everyone’s patience

On the first point: if it were there I couldn’t find it. And my addition will only last as long as 11.4 Luckily it’s not a critical matter. :slight_smile:

On the second, pardon my stupidity, but if I attach the disc to a SATA connector then reboot, is GRUB/Linux whatever clever enough to deal with it or do I need to do something else.

Generally, are these gadgets (in this case an IOMAX S-ATA&IDE -> USB 2.0) a bit useless?

IOMAX USB 2.0 to SATA/IDE Adapter Kit with Power: Amazon.co.uk: Computers & Accessories

gerrygavigan wrote:
> On the second, pardon my stupidity, but if I attach the disc to a SATA
> connector then reboot, is GRUB/Linux whatever clever enough to deal with
> it or do I need to do something else.

It should cope automatically. It won’t mount anything that’s visible on
your desktop, but it will create the device and it will make log entries
that you can look at with the command ‘dmesg’, which will tell us
whether the disk is being read correctly. If so, we can then tell you
how to mount it.

So try it, then run the command ‘dmesg’ from a terminal and post the
result here (or in a pastebin because it tends to be long)

> Generally, are these gadgets (in this case an IOMAX S-ATA&IDE -> USB
> 2.0) a bit useless?

I don’t know about the particular model, but as a general species,
they’re a bit variable. And when you’re trying to diagnose a fault, the
less variables there are, the better.

On 2011-03-29 16:06, gerrygavigan wrote:

> On the first point: if it were there I couldn’t find it.

It is there, believe me.

> And my
> addition will only last as long as 11.4 Luckily it’s not a critical
> matter. :slight_smile:

It might.

> On the second, pardon my stupidity, but if I attach the disc to a SATA
> connector then reboot, is GRUB/Linux whatever clever enough to deal with
> it or do I need to do something else.

Just make sure it is not the first disk, grub doesn’t need to know about
it. Plus, notice that SATA drives can usually be attached HOT, without
rebooting.

> Generally, are these gadgets (in this case an IOMAX S-ATA&IDE -> USB
> 2.0) a bit useless?

Things should work, but sometimes they don’t. This time you have to find out.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)