dslreports logo
 
    All Forums Hot Topics Gallery
spc
uniqs
35

koitsu
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

koitsu to rolfp

MVM

to rolfp

Re: Bad Hard Drive(s) / Raid Array

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.

rolfp
no-shill zone
Premium Member
join:2011-03-27
Oakland, CA

rolfp

Premium Member

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
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

koitsu

MVM

said by rolfp:

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.
rockisland
Premium Member
join:2008-12-15
Friday Harbor, WA

rockisland

Premium Member

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
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

koitsu

MVM

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 Member
join:2008-12-15
Friday Harbor, WA

rockisland

Premium Member

Drat - I bet I forgot the k.

Back in a few.
rockisland

rockisland to koitsu

Premium Member

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
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

1 edit

koitsu

MVM

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. :-)
rockisland
Premium Member
join:2008-12-15
Friday Harbor, WA

rockisland

Premium Member

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
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

koitsu

MVM

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.
rockisland
Premium Member
join:2008-12-15
Friday Harbor, WA

rockisland

Premium Member

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
MVM
join:2002-07-16
Mountain View, CA
Humax BGW320-500

koitsu

MVM

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.
koitsu

2 recommendations

koitsu

MVM

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.

norwegian
Premium Member
join:2005-02-15
Outback

norwegian

Premium Member

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.