This computer is about ten years old and the first problem I had with it was a disk failure about six months ago, now the replacement-disk has failed too:

I was using the disk when it became read-only.

If I leave the drive mentioned in fstab

/dev/sdb1 /home/progman3k reiserfs noatime 0 1

Then the computer will either boot and stay in text-mode asking for the root password for maintenance
or it will begin to fsck the drives and eventually the screen switches off and even if I wait for hours, nothing will happen.

Removing the disk from fstab and restarting, I can log in as root and try to mount the drive with the disk-utility:

Install smartmontools and see what the drive thinks of itself.
If the smart data is OK, it may be a HDD data cable.

Code:

[32106.257503] ata4.00: failed command: READ DMA

means a read failed.
It may be that the drive left it too late to relocate a failing sector and now can't read it.

Post the smart data if you need a hand to interpret it.

Its a little early to think about data recovery but making an image with ddrescue is a good place to start.
Be sure to make the ddrescue log as ddresuce will use it to resume and do retries._________________Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Thats bad news. The drive would like to reallocate 21 sectors but can't read them. You may or may not get lucky and get one more read.
Keep an eye on this data.

Run ddrescue to make an image of the drive, that means you need another

Code:

User Capacity: 1,000,204,886,016 bytes [1.00 TB]

of space plus the ddrescue log file.

If the long test completes, the Current_Pending_Sector count should be zero and the 5 Reallocated_Sector_Ct should have increased by at least 21.
Its unlikely the test will complete, as it will abort at the first error._________________Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

I had some problems a few years back where the disks would go offline (drop sata connection)
and gave disk errors. In two cases the disks had bad spots, and I exchanged them.
In the other cases the culprit was the power supply, it just wasn't putting out enough current
to satisfy all the disks. I swapped it out, ran a complete disk check (using hd manf's utility on another machine)
and then reloaded all the filesystem data that I had backups for.

In your case, I would try and recover all the data that you can, keeping in mind some of it may be bad.
If you have another machine you might try running disk software on that drive in the other machine.
If it shows as clean, then it might be the power supply (as they're not really designed to last for much longer than 4-5 years)

Anyway, good luck

Edit to add:

Quote:

So is it possible to recover some of the data? I understand some might be lost, but I'd settle for some data.

It depends on what is in those unreadable sectors, if boot data, partition data, or directory data then whatever is in that spot would more than likely be lost._________________Asus m5a99fx, FX 8320 - amd64-multilib, 4.4.6-zen, glibc-2.21, gcc-4.9.3, eudev
xorg-server-1.18.0 w/mesa-13.0, openbox, nouveau and radeon, oss4(2011)

What you cang get back depends on the type of data that cannot be read.
If its a directory, all of that directory and all of its children will be threatened. If its a video, the video will be lost.

The next step is to make an image of the drive or partition with ddrescue. You must not compress the image as you will use it like a real drive/partition later.
ddrescue tries very hard to read your data. It starts at the beginning, much like dd but when it finds a problem, jumps to the middle of the unrecovered space. This way it gets all the easy to read data first.
Eventually, it attempts to step the head into problem areas from both sides.

You must generate the log file. ddrescue will read it to know what still needs to be done, so you don't have to run ddrescue in one sitting.
You will read it to know what is lost.

Recovery of files in place is no longer possible, nor would you want to as you have no idea when the 21 unreadable blocks will get worse.
Those are the ones the drive knows about. ddrescue may well find some more.

Check your warranty it looks like it expires on 16 May 2016.
WD will send you a replacement before you return the dud. I've had to do it with 2 WD Greens. They want a credit card number, which they will bill if the return is not received.
I had 30 days, so you get a few weeks with both drives at no cost._________________Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

You can copy to an output drive that is the same size or bigger.
The copy need only be temporary, to allow data recovery to take place.

If you will do a drive to drive copy, tell ddrescue to work with whole drives, not partitions, that way you get the partition table too.
Partition to partition works too, as does drive/partition to file.

The output space must be >= the input space.
ddrescue, is a block level tool. It neither knows nor cares what the data in the blocks it works with represent.

The size of the log depends on how many separate faulty areas you have on your drive. If it got to 1Mb I would be surprised.
Here is one I made earlier.

Here I was just trying to force bad sectors to be read and relocated, hence /dev/null is the output device.
I was trying to breath some life into a raid5 that had two drives fail within 15 minutes.

The -b tells not to try to use blocks smaller than 4k. You need that as your drive has a 4k physical block size. Thats the smallest chunk of data that it can read or write.
-r 8 says to move on after 8 retries. Big numbers here make ddrescue have more tries but it takes longer.
-f always seems to be needed
/dev/sde3 /dev/null are the input and output devices. /dev/null is a really bad choice for output but as my raid set was not readable (at all) I had nothing to loose. Don't you do this.
/root/rescue_log.txt is the full path to the logfile.

The usual way to use ddrescue is with a fairly low number of retries, say, -r 3 then read the log and see what happened.
Then run it again with a more aggressive retry setting and everything else unchanged.
ddrescue will only work on the areas that have not been recovered and will fill in the 'holes' in the copy.

-M is useful on second and subsequent runs. Read man ddrescue.

You can also help the probability of recovery. More on that after you post your first log.
Using ddrescue to copy to/from the same drive is not useful. The drive is suspect - all of it. Get the data off.

Do not use fsck on the recovered data - it often makes a bad situation worse. Its a last ditch thing to try._________________Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.