dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
10980
share rss forum feed


koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

1 edit
reply to koitsu

Re: Bad Hard Drive(s) / Raid Array

Okay, here's how to do it using mfsBSD (which is standard FreeBSD but very minimal and provides enough utilities to accomplish what we need with a small footprint.

Be aware you should use a USB 2.0 controller for this. USB 3.0 is not decently supported in FreeBSD 9.0, so stick with USB 2.0 please.

Warning: If you are some random Internet user reading this "tutorial", DO NOT perform this on an SSD. This should only be used for mechanical HDDs.

If you want to make sure you don't risk destroying data on any of your other drives, I recommend detaching their SATA cables (you do not need to detach their power cable). I'm not responsible if you mess this up. :-)

1. Download this ISO and burn it to a CD (note that this assumes you have at least a 64-bit capable CPU, i.e. something made in the past 7 years or so).

2. Make sure the USB drive is attached to your system and is AC-powered.

3. Boot the CD.

4. At the main FreeBSD logo text screen, just press Enter and wait. It can take some time for things to start.

5. The kernel should load and eventually present you with a login: prompt. Enter the username root and the password mfsroot. You should now have a mfsbsd# prompt.

6. Issue the command camcontrol devlist, which should show all attached hard disks on your system (including USB ones). Example output:

mfsbsd# camcontrol devlist
<INTEL SSDSA2CW080G3 4PC10302>     at scbus0 target 0 lun 0 (ada0,pass0)
<WDC WD10EFRX-68JCSN0 01.01A01>    at scbus1 target 0 lun 0 (ada1,pass1)
<WDC WD10EFRX-68JCSN0 01.01A01>    at scbus2 target 0 lun 0 (ada2,pass2)
<WDC WD20EFRX-68AX9N0 80.00A80>    at scbus3 target 0 lun 0 (ada3,pass3)
 

In your case, you're looking for the drive labelled something like WDC WD1500ADFD-00NLR4.

What you need specifically is the device name at the end of the output, specifically labelled daX for USB-attached hard disks and adaX for ATA/SATA native (non-USB-attached) hard disks. Using the above example text, WD20EFRX-68AX9N0 is ada3 thus the device path is /dev/ada3. Ignore anything like passX or otherwise.

If the disk does not show up in camcontrol devlist, then the disk is almost certainly not showing up on the USB bus. There are ways to figure this out (using usbconfig dump_device_desc), but is outside the scope of this writing.

7. Check to make sure you can communicate with the disk reliably using dd to read from the drive starting at LBA 0, using the device path as described above for the if= parameter. Example:

mfsbsd# dd if=/dev/ada3 of=/dev/null bs=64k
 

There will be no output shown; it will appear as if the command is doing nothing. At this phase, check the LED on the USB enclosure; if it's lit or blinking, you're communicating with the right device.

BTW, the parameters in question:

* if stands for input file -- in this case, the disk
* of stands for output file -- in this case, a null device (i.e. all the data read from the disk gets thrown out)
* bs stands for block size -- in this case, 64KBytes (65536 bytes)

You can check the status of dd as well -- on FreeBSD press Ctrl-T to get the status of a currently-running process. You'd see something like:

load: 0.00  cmd: dd 31846 [physrd] 3.36r 0.00u 0.14s 0% 1676k
7928+0 records in
7928+0 records out
519569408 bytes transferred in 3.360398 secs (154615435 bytes/sec)
 

The 1st line is the system load, what kernel state the dd process is in, what the PID is, CPU usage for that process. The 2nd and 3rd lines indicate the number of blocks read/written to/from the relevant input/output files/devices, where 1 block correlates with the bs parameter. The 4th line indicates the number of bytes written to the output file/device, as well as general speed.

Assuming the USB LED is blinking or lit, press Ctrl-C to end the process; the LED should cease.

Technical note: FreeBSD's dd interacts with disks directly (what Linux users would call O_DIRECT); unlike Linux, there is no caching involved here.

8. Finally, it's time to zero the drive -- This is non-recoverable, so do not make any typos!

mfsbsd# dd if=/dev/zero of=/dev/ada3 bs=64k
 

The parameters:

* if should be the /dev/zero device, which just spits out raw zeros (byte 0x00)
* of should be the disk (i.e. you're writing to it)
* bs is block size (same as above)

Like earlier, there will be no output. This will zero the entire drive (assuming you let it finish) from LBA 0 to the end. And like earlier, you can press Ctrl-T to get a general status of things.

9. After quite some time (remember, USB 2.0 can do up to something like 35MBytes/second, which is much slower than if you were using SATA natively), the dd command should finish.

However, you will almost certainly see some errors at the very end. The message shown will be something like this:

dd: /dev/daX: end of device
XXXX+X records in
XXXX+X records in
XXX bytes transferred in X seconds (X bytes/sec)
 

This is okay -- the reason is that actual capacity of the drive does not end on an even 64KByte boundary, so it wrote as much as it could, and one of those writes was a partial write (which is fine). Trust me, the entire drive got zeroed. :-)

In the case dd exits with a message like "I/O error" or some other text on-screen (if it's bold/white its from the kernel; if it's grey-ish it's from dd), then writes at some point failed. I'd need a photo of the monitor to know what the condition/issue was. FreeBSD CAM will output quite a lot of useful information (for me anyway) about the error, but I'm not used to using disks across USB so CAM might not be able to get the actual ATA level status. I would suggest re-doing the entire procedure but with the disk attached natively via SATA (preferably AHCI enabled too if possible).

10. In the case things exited smoothly, I recommend ejecting the CD, then cleanly rebooting the system:

mfsbsd# shutdown -r now
 

11. Now go back into Windows and pull SMART statistics using smartmontools (smartctl -x ...). Attribute 197 should no longer have 1 pending LBA for analysis. I'd like to see the output regardless, as it will give some general information about the overall status of the disk after having every LBA written to.

Footnote: if you'd prefer to use a USB flash drive instead of a CD, use this instead and follow this procedure. The CD method should work regardless though, and IMO is probably easiest.

--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.

rockisland
Premium
join:2008-12-15
Friday Harbor, WA

1 edit

Long story short - this didn't work either.

I was able to identify the correct disk - it was da2

[The prompt I had was mfsbsd# not mfsroot#]

Issued the command mfsbsd# dd if=/dev/da2 of=/dev/null bs=64k
There was a brief flash of the led light and then error messages were spit out.

I wrote down what I could but it might not be exact.

da2 :umass - siml:1:0:0: Read (10). CDB:28 0 0 00 fc 80 00 80 0
CAM status - SCSI status error
SCSI status: Check condition
SCSI sense: Medium error
asc: 11,0 Unrecovered Read Error input/output error

There was more but the bottom line is that it kicked the disk out. I ran the camcontrol devlist command again and the disk was no longer listed.

Tried the zeroing command but since the disk wasn't listed anymore, not too surprisingly, that didn't work either.

I think we should give up on this. I've wasted far too much of your time wrestling with this recalcitrant drive.



berserken

join:2011-03-27
Oakland, CA
kudos:1
Reviews:
·Comcast
reply to koitsu

You can check the status of dd as well -- unlike Linux ( :-) ),

Linux does have dd progress capability. With pid, using bash history and up arrow:
[rolf@localhost 2012.desktop]$ dd if=/dev/zero of=/dev/null& pid=$!
[1] 20136
[rolf@localhost 2012.desktop]$ kill -USR1 20136
75105421+0 records in
75105420+0 records out
38453975040 bytes (38 GB) copied, 13.2714 s, 2.9 GB/s
[rolf@localhost 2012.desktop]$ kill -USR1 20136
99037284+0 records in
99037283+0 records out
50707088896 bytes (51 GB) copied, 17.5035 s, 2.9 GB/s
[rolf@localhost 2012.desktop]$ kill -USR1 20136
122459324+0 records in
122459324+0 records out
62699173888 bytes (63 GB) copied, 21.6475 s, 2.9 GB/s
[rolf@localhost 2012.desktop]$ kill -USR1 20136
140498135+0 records in
140498134+0 records out
71935044608 bytes (72 GB) copied, 24.8396 s, 2.9 GB/s
[rolf@localhost 2012.desktop]$ kill -9 20136
[1]+  Killed                  dd if=/dev/zero of=/dev/null
[rolf@localhost 2012.desktop]$
 


koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

I'm aware of SIGUSR1 on Linux dd, but it's not quite the same:

1. Process itself has to support SIGUSR1 or SIGINFO handler; Ctrl-T on FreeBSD gets data from the kernel (first line) and sends SIGINFO to the underlying fg process (remaining lines),

2. Ctrl-T will always provide that first line for any process -- quite useful when you think something is deadlocked. Can't even begin to describe how many times this has been used in the past 3-4 years on FreeBSD to diagnose ZFS problems or thread deadlock problems,

3. Probably the most important part: the explanation given is how to accomplish disk zeroing, not "let's teach you all the semantics of how to use a UNIX system" (backgrounding a process, repeatedly sending SIGUSR1, etc.).

Details of FreeBSD's Ctrl-T is documented in termios(4), specifically the POSIX.1 extension section (see STATUS).

BTW, since we're nitpicking, please do not get in the habit of using kill -9 (SIGKILL). That's a very, very bad habit people get into that should not be used unless absolutely necessary. Start with SIGTERM (default) and if after a few seconds the processes' SIGTERM handler doesn't end things, you can resort to ruder means. There are many processes out there which have shutdown routines mapped to SIGTERM (close sockets cleanly, close local fds, do some clean-up) -- while SIGKILL is handled by the kernel, which means the process may leaves pid files and tmp files around and not do proper clean-up. Bad habit.
--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

2 edits
reply to rockisland

I see what's going on here, and the responsible party is probably the USB-SATA bridge. (I tried to warn you... )

First and foremost: the disk has an unreadable LBA. We know this, because it's almost certainly the one which is in pending ("suspect") state. So, there's going to be an I/O error when trying to read from that LBA. If it's very close to the start of the disk, then the dd command that reads from the disk is going to bail out fairly quick once that LBA is hit. I would know if this is the case if the output from dd was shown (specifically record counts in vs. out, then doing basic math to work out the LBA region and see if the LBA reported in the SMART error log (LBA 10447767) falls in that range).

LBA 10447767 is fairly close to the start of the disk -- that is to say, this LBA can be read only moments after issuing the dd command. Each LBA on that drive is 512 bytes, and we're reading 64KBytes at a time. The byte offset on the disk is quite easy to calculate: 10447767*512 = 5,349,256,704, so around the 5GB mark from the start of the disk.

Now consider how fast a disk can read, even under USB 2.0. Let's just say you were getting 35MBytes/second. Simple math: 5349256704 / (1024*1024*35) = 145 seconds or thereabouts you'd see the I/O error when reading linearly from the start of the disk (at 35MBytes/second).

Make sense so far? Onwards we go:

The I/O error travels back up from the ATA layer to the USB-SATA bridge, which can quite literally choose to do whatever it wants with that ATA status code. And from what I can tell based on the CAM output, it appears that the USB-SATA bridge chooses to pass the ATA message along to the underlying host (OS), and then wedges itself and/or drops itself off the bus.

An alternate situation (for the latter part) is that the OS itself actually forced detach on the USB device as a result of repeated I/O errors or reads which reached an internal timeout. CAM da device timeouts are 60 seconds. I have no idea what the USB driver bus timeout value is on FreeBSD.

Anyway, my recommendation at this point is to continue with step 8 anyway. If you see I/O errors happen as a result of that, then that's a very different situation. Reads != writes. ATA/SATA drives do different things with sectors when read vs. written.

After you zero the drive (assuming you get no I/O errors), you can re-issue the command for reading (step 7) and you shouldn't get I/O errors any more. That's the entire purpose behind what we're doing.

EDIT: Thanks for the mfsroot# vs. mfsbsd# prompt typo. I've fixed that. mfsroot is the password, mfsbsd is the prompt, and mfsroot is (believe it or not) something completely different from FreeBSD 8.x and earlier. I should tell Martin to change the password to mfsbsd just to keep things consistent.
--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.



berserken

join:2011-03-27
Oakland, CA
kudos:1
reply to koitsu

I'm not the one nitpicking; just pointing out one specific incorrect claim, as cited. The most important part: the source of all the extraneous verbiage is not this point of view.



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

said by berserken:

I'm not the one nitpicking; just pointing out one specific incorrect claim, as cited. The most important part: the source of all the extraneous verbiage is not this point of view.

Fair enough. I'll edit the post and remove the comment; I knew about SIGUSR1 prior, but in this case we have an end-user who isn't familiar with *IX greatly, so explaining fg/bg processes and kill and so on, just to get the status of what a command is doing = annoying compared to "just press Ctrl-T".

I don't understand the latter part of your sentence, sorry to say.
--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.

rockisland
Premium
join:2008-12-15
Friday Harbor, WA
reply to koitsu

Got it - will update tomorrow. Done beating my head against this brick wall for today.

Thank you.


rockisland
Premium
join:2008-12-15
Friday Harbor, WA
reply to koitsu

Didn't get a chance to pursue this yesterday but went back to it this morning and still no dice.

I did the camcontrol devlist command to make sure nothing had changed and the drive I was after was still da2

Here is the entire list:

cd0, pass0
cd1, pass1
pass2, da0 (flash card reader)
pass3, da1 (ditto)
pass4, da2 (target drive)

didn't bother with the communication check this time since that resulted in the unmounting of the drive last time

went straight to the zero command:

mfsbsd# dd if=/dev/zero of=/dev/da2 bs=64

And got this: dd: /dev/da2: invalid argument

1+0 records in
0+0 records out
0 bytes transferred
etc



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

The bs argument should be bs=64k, not bs=64. Is that a typo here on the forum or actually on the system?

Quite often smaller blocksizes don't work when interfacing with a device that mandates a minimum blocksize (in this case, that minimum would be 512 bytes), which would explain the error.


rockisland
Premium
join:2008-12-15
Friday Harbor, WA

Drat - I bet I forgot the k.

Back in a few.


rockisland
Premium
join:2008-12-15
Friday Harbor, WA
reply to koitsu

Message this time with everything typed in correctly...

ugen8.5: at usbus8 (disconnected)
umass1: at uhub10, port4 addr 5 (disconnected)
(da2:umass - sim1:1:0:0): lost device - outstanding
(da2:umass - sim1:1:0:0) oustanding 0 [not my misspelling]
dd:/dev/da2: Device not configured
506 + 0 records in
505 + 0 records out
33095680 bytes transferred in 14.141429 sec
(da2: umass - sim1:1:0:0): removing device entry

some spaces and colons might not be right but that's the gist of the error message.



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

1 edit

That looks to me like one of your USB ports/hubs/whatever just completely fell off the USB bus. You actually lost ugen8.5 (some other device, not the hard disk) as well as umass1 (the USB hard disk). So you lost two devices at the same time, not just the hard disk.

Are you using a hub? If so, please cease and hook the USB drive directly up to the back of the computer (not the front). If not, please try another USB port (on the back of the computer).

The other output indicates that I/O to the disk works fine. Meaning: you have other problems pertaining to your USB setup, and this would also explain Windows (HD Tune Pro, etc.) acting why it did. Windows just enjoys hiding all of the underlying details from people (people often insist the Event Log will tell you things -- yeah, only if the underlying code issues an Event Log message! If nobody wrote the code, duh!) which is why it's almost impossible to troubleshoot things.

Edit: By the way, if the system mfsBSD/FreeBSD is being run on is the same one which has the RAID array, then there's no need for the disk to be installed in a USB enclosure. FreeBSD will see all of your disks individually (they'll be named adaX), as well as the RAID array (I forget if graid(8) was implemented in FreeBSD 9.0 so I could be wrong on this part), and you can access all those disks individually at the same time. :-)
--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.


rockisland
Premium
join:2008-12-15
Friday Harbor, WA

Click for full size
Click for full size
Click for full size
OK - gave up altogether on the USB connection - the results were no better when hooked to a USB port on the motherboard.

Dug out the eSATA cable and attached the enclosure that way and got what looks to me like similar results. Perhaps the images will tell you something useful.


koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

Cute. That indicates to me the underlying drive is going completely catatonic during I/O operations (with a 30 second timeout), resulting in AHCI (SATA) controller timeouts. The AHCI driver tries to reset the AHCI port -- which works, except the underlying device attached to the port never responds ("device not ready"). The drive then later falls off the bus completely, which causes dd to fail.

I believe there were some AHCI-related bugs in FreeBSD 9.0 with certain models of controllers, but I don't think these are responsible for this problem (in fact I'm about 98% certain they're not).

Something is just downright buggered with the drive -- it's significantly worse than a single sector. My initial guesses is that the drive firmware itself is wedging/locking up dealing with something internally and not responding to ATA requests.

At this phase, you got one choice (nice and easy): RMA the drive.
--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.


rockisland
Premium
join:2008-12-15
Friday Harbor, WA

Well, thank you for making the effort to solve the issue - I appreciate it.

Drive is out of warranty so I guess I'll be looking for another one.



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

If I had a 1.5TB to send you, I'd offer to swap it, just so I could get my hands on that sucker. I always like getting my hands on bad drives, they make interesting test cases + educational material.

Sorry I couldn't be of more help -- had this been a simple single LBA which needed reanalysing, everything would have gone as planned.
--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.



koitsu
Premium,MVM
join:2002-07-16
Mountain View, CA
kudos:23

2 recommendations

downloadwd-wmap41573589.mp3 203,651 bytes
So this is an old thread, but I wanted to follow up on the matter.

rockisland See Profile sent me the drive in question and I received it today. It didn't take me long to encounter issues.

SMART shows the drive in the state shown here:

smartctl 6.0 2012-10-10 r3643 [FreeBSD 9.1-STABLE amd64] (local build)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Raptor
Device Model:     WDC WD1500ADFD-00NLR4
Serial Number:    WD-WMAP41573589
Firmware Version: 21.07QR4
User Capacity:    150,039,945,216 bytes [150 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA/ATAPI-7 published, ANSI INCITS 397-2005
Local Time is:    Fri Jan 18 18:52:48 2013 PST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
 
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
 
General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                                        was suspended by an interrupting command from host.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                ( 4783) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  72) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x103f) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.
 
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0007   163   160   021    Pre-fail  Always       -       4875
  4 Start_Stop_Count        0x0032   100   100   040    Old_age   Always       -       861
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000a   200   200   051    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   078   078   000    Old_age   Always       -       16287
 10 Spin_Retry_Count        0x0012   100   100   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0012   100   100   051    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       697
194 Temperature_Celsius     0x0022   124   102   000    Old_age   Always       -       23
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       1
198 Offline_Uncorrectable   0x0012   200   200   000    Old_age   Always       -       1
199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   051    Old_age   Offline      -       0
 
SMART Error Log Version: 1
ATA Error Count: 2
        CR = Command Register [HEX]
        FR = Features Register [HEX]
        SC = Sector Count Register [HEX]
        SN = Sector Number Register [HEX]
        CL = Cylinder Low Register [HEX]
        CH = Cylinder High Register [HEX]
        DH = Device/Head Register [HEX]
        DC = Device Command Register [HEX]
        ER = Error register [HEX]
        ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
 
Error 2 occurred at disk power-on lifetime: 16287 hours (678 days + 15 hours)
  When the command that caused the error occurred, the device was doing SMART Offline or Self-test.
 
  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 80 e0 fc 00 e0  Error: UNC 128 sectors at LBA = 0x0000fce0 = 64736
 
  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 80 80 fc 00 40 00      00:11:24.700  READ DMA EXT
  25 00 80 00 fc 00 40 00      00:11:24.700  READ DMA EXT
  25 00 80 80 fb 00 40 00      00:11:24.700  READ DMA EXT
  25 00 80 00 fb 00 40 00      00:11:24.700  READ DMA EXT
  25 00 80 80 fa 00 40 00      00:11:24.700  READ DMA EXT
 
Error 1 occurred at disk power-on lifetime: 16270 hours (677 days + 22 hours)
  When the command that caused the error occurred, the device was active or idle.
 
  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 97 6b 9f 40  Error: UNC 8 sectors at LBA = 0x009f6b97 = 10447767
 
  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 01 08 97 6b 9f 41 00      00:00:32.250  READ DMA EXT
  25 01 08 87 dc 9e 41 00      00:00:32.250  READ DMA EXT
  25 01 01 4e ea a7 46 00      00:00:32.250  READ DMA EXT
  25 01 01 4e ea a7 46 00      00:00:32.250  READ DMA EXT
  61 01 00 ee 89 77 41 00      00:00:32.250  WRITE FPDMA QUEUED
 
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     15315         -
# 2  Short offline       Completed without error       00%     13596         -
# 3  Short offline       Completed without error       00%     12376         -
# 4  Short offline       Completed without error       00%     12329         -
# 5  Conveyance offline  Completed without error       00%      1332         -
 
SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
 

The first thing I did was attempt to zero the drive, which is the same thing rockisland See Profile attempted to do earlier.

Within a few moments of the zeroing beginning, I started hearing repetitive clicking coming from the drive itself. The clicking sounds like a head that's stuck repeatedly trying to re-read a sector, and not the actuator arms resetting back to track 0. I doubt rockisland See Profile could hear this if the drive was mounted in a chassis or enclosure, but I do all of my testing with bare drives externally attached to a system (literally SATA power and SATA data cable hanging out of the case).

I Ctrl-C'd dd, which of course was blocked for quie some time by the kernel CAM and underlying AHCI layer since it was waiting for an I/O transaction, and the CAM timeout is 30 full seconds. During this time, I started seeing this on the console (which is to be expected):

ahcich5: Timeout on slot 0 port 0
ahcich5: is 00000000 cs 00000000 ss 00000001 rs 00000001 tfd 40 serr 00000000 cmd 0004c017
(ada5:ahcich5:0:0:0): WRITE_FPDMA_QUEUED. ACB: 61 80 80 77 01 40 00 00 00 00 00 00
(ada5:ahcich5:0:0:0): CAM status: Command timeout
(ada5:ahcich5:0:0:0): Retrying command
ahcich5: AHCI reset: device not ready after 31000ms (tfd = 00000080)
ahcich5: Timeout on slot 0 port 0
ahcich5: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 00000000 cmd 0004c017
(aprobe0:ahcich5:0:0:0): ATA_IDENTIFY. ACB: ec 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ahcich5:0:0:0): CAM status: Command timeout
(aprobe0:ahcich5:0:0:0): Error 5, Retry was blocked
ahcich5: AHCI reset: device not ready after 31000ms (tfd = 00000080)
ahcich5: Timeout on slot 0 port 0
ahcich5: is 00000000 cs 00000001 ss 00000000 rs 00000001 tfd 80 serr 00000000 cmd 0004c017
(aprobe0:ahcich5:0:0:0): ATA_IDENTIFY. ACB: ec 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ahcich5:0:0:0): CAM status: Command timeout
(aprobe0:ahcich5:0:0:0): Error 5, Retry was blocked
(ada5:(pass5:ahcich5:0:ahcich5:0:0:0:0): lost device
0): passdevgonecb: devfs entry is gone
ahcich5: AHCI reset: device not ready after 31000ms (tfd = 00000080)
ahcich5: Timeout on slot 0 port 0
ahcich5: is 00000000 cs 00000001 ss 00000001 rs 00000001 tfd 80 serr 00000000 cmd 0004c017
(ada5:ahcich5:0:0:0): WRITE_FPDMA_QUEUED. ACB: 61 80 80 77 01 40 00 00 00 00 00 00
(ada5:ahcich5:0:0:0): CAM status: Command timeout
(ada5:ahcich5:0:0:0): Error 5, Periph was invalidated
(ada5:ahcich5:0:0:0): removing device entry
ahcich5: AHCI reset: device not ready after 31000ms (tfd = 00000080)
 

A general end-user probably can't decode any of this, but it reads quite clearly to me. The drive began experiencing a physical problem of some sort (and is stil experiencing it) causing the entire SATA bus (well, this port) to lock up hard. The reason is that the underlying firmware on the drive, on this model, is apparently designed very poorly -- it does not handle error conditions correctly.

The end result is a drive firmware itself which is stuck in an infinite loop trying to deal with the underlying physical problem (whatever that may be); the SATA controller on the drive appears to be entirely driven by the firmware as well (this explains the deadlock, followed by the drive falling off the bus entirely -- AHCI/SATA protocol should still work despite the underlying drive going catatonic).

As I type this, the drive is still clicking away, and refuses to reappear on the bus because the firmware is downright wedged. It's been literally a full 10 minutes now, which is longer than the total amount of CAM retries and timeouts (5 retries, 30 seconds each).

I tried the god-awful trick of smacking the drive against a flat surface while operational -- this is not something I normally do, but when I hear a drive clicking like this, it's sometimes worth it to see if you can jostle the arm enough that it might unwedge or trip some other condition in the underlying firmware code. Sadly no avail -- I even heard the drive (mechanically) re-set the actuator arm but it went right back to trying to clicking. It's hell bent on trying to read that naughty LBA.

So bottom line is that there's no way to reset this drive without power-cycling it. It flat out refuses to respond to any ATA CDBs once it gets into this indefinite loop, and as such, also stops responding at the SATA protocol level. Pretty awesome; nicely designed firmware! *cough* :P

There isn't much I can do with the drive other than use it as a real-world example of how technology since the days of this drive (circa 2006) have evolved and improved. What's extra amusing is that the WD1500ADFD is a 10,000rpm Raptor drive, which is what WD toted as "reliable and fast and awesome" -- it just goes to show no matter how much money you pay, no matter what "classification" of drive you buy, what ultimately matters is whether or not the programmers of the underlying device firmware actually designed their code sanely and never to get stuck in deadlock/infinite loop situations like this one.

Attached is an .mp3 file recorded from my digital camera of the clicking in question, amplified by 8dB. :-) I do plan on opening this drive while it's in operation to see if there's some visual defect or reason I can detect for its issue.

--
Making life hard for others since 1977.
I speak for myself and not my employer/affiliates of my employer.


norwegian
Premium
join:2005-02-15
Outback

Quite interesting, I have 2 x raptors here of the same ilk (WD1500ADFD). 1 in particular that sounds so close to that problem - used to have them in raid too.

Lovely, at the time I didn't chase up warranty enough, wish I had now, at $300 a pop Aus$ they weren't cheap either.

These were reportedly the best Raptors on the market at the time before the 'Velo' came about.
--
The only thing necessary for the triumph of evil is for good men to do nothing - Edmund Burke