Testing hard drives

From Free Geek Seattle

Related to:Quality AssuranceCategory:Procedures

This page explain in general how to test a (loose) hard drive

Step 1: Hook up the drive to the testing computer running Linux This entails attaching the power and data interface cables, we have a least one kit in the Lab. SATA drive: hook up the Red (data) cable and the Black (power) cable to the drive IDE drive: plug in the 80-pin (data) connecter and the RGBY (power) cable to drive

Then, plug the other end into any available USB Slot on the testing computer

Step 2: Verify the drive is seen by the operating system (Linux)

Typically just use the dmesg command

Here's an example of what you *SHOULD* see upon connecting the drive

[596751.044063] usb 2-3: new high-speed USB device number 2 using ehci-pci
[596751.177002] usb 2-3: New USB device found, idVendor=152d, idProduct=2338
[596751.177010] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[596751.177016] usb 2-3: Product: USB to ATA/ATAPI bridge
[596751.177020] usb 2-3: Manufacturer: JMicron
[596751.177025] usb 2-3: SerialNumber: 6120A66A0750
[596751.533753] usb-storage 2-3:1.0: USB Mass Storage device detected
[596751.534015] scsi8 : usb-storage 2-3:1.0
[596751.534110] usbcore: registered new interface driver usb-storage
[596752.532655] scsi 8:0:0:0: Direct-Access     IC35L120 AVVA07-0              PQ: 0 ANSI: 2 CCS
[596752.533453] sd 8:0:0:0: Attached scsi generic sg2 type 0
[596752.534749] sd 8:0:0:0: [sdb] 241254720 512-byte logical blocks: (123 GB/115 GiB)
[596752.535759] sd 8:0:0:0: [sdb] Write Protect is off
[596752.535765] sd 8:0:0:0: [sdb] Mode Sense: 28 00 00 00
[596752.538964] sd 8:0:0:0: [sdb] No Caching mode page found
[596752.538971] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[596752.544019] sd 8:0:0:0: [sdb] No Caching mode page found
[596752.544026] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[596752.556393]  sdb: unknown partition table
[596752.559767] sd 8:0:0:0: [sdb] No Caching mode page found
[596752.559772] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[596752.559776] sd 8:0:0:0: [sdb] Attached SCSI disk

Step 3: test the drive

A surefire way to do this is to us the dd command to slurp every sector from the drive.

freegeek@freegeek-OptiPlex-755:~$ sudo -s
[sudo] password for freegeek: 
root@freegeek-OptiPlex-755:~# dd if=/dev/sdb of=/dev/null bs=1M

If it encounters any errors, go to Step 4. Otherwise, WIPE IT & place it in the bin labeled Hard Drives GOOD

Step 4: repair the drive Some manufacturers provide a disk test utility, like Seagate's SeaTools software.

It may be possible to repair the drive by running the utility and if it provides the option to to a Long test / remap the bad sectors found. If you find any success in doing so please record your notes/findings here!

Mfoster (talk) 17:49, 25 October 2014 (PDT)