linux - External HD error when running processing script
2014-07
I do computational work, and part of that is post processing ascii data from a text file. I do this through a matlab script I wrote which simply reads in the text file line by line, parses it, then turns around and saves it in matlab's internal data format, so I can read it in more quickly in the future. I always run this script in the background. All my data and the output is on an external 2TB drive. Recently, while running this script, the drive throws an error, unmounts, then remounts read only. Here is the portion of the dmesg that I believe is relevant:
sd 9:0:0:0: Device offlined - not ready after error recovery
sd 9:0:0:0: [sdd] Unhandled error code
sd 9:0:0:0: [sdd] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
sd 9:0:0:0: [sdd] CDB: Write(10): 2a 00 74 46 2e e8 00 00 08 00
Aborting journal on device sdd1-8.
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: [sdd] killing request
sd 9:0:0:0: [sdd] Unhandled error code
sd 9:0:0:0: [sdd] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
sd 9:0:0:0: [sdd] CDB: Read(10): 28 00 42 40 08 08 00 00 08 00
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
JBD2: I/O error detected when updating journal superblock for sdd1-8.
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
sd 9:0:0:0: rejecting I/O to offline device
EXT4-fs (sdd1): delayed block allocation failed for inode 34734785 at logical offset 0 with max blocks 1 with error -30
This should not happen!! Data will be lost
EXT4-fs error (device sdd1) in ext4_da_writepages: Journal has aborted
sd 9:0:0:0: rejecting I/O to offline device
JBD2: Detected IO errors while flushing file data on sdd1-8
EXT4-fs error (device sdd1): ext4_journal_start_sb: Detected aborted journal
EXT4-fs (sdd1): Remounting filesystem read-only
EXT4-fs (sdd1): ext4_da_writepages: jbd2_start: 1023 pages, ino 34734785; err -30
usb 2-1.5: USB disconnect, device number 6
EXT4-fs error (device sdd1): ext4_find_entry: reading directory #2 offset 0
EXT4-fs error (device sdd1): ext4_find_entry: reading directory #2 offset 0
usb 2-1.5: new high speed USB device number 10 using ehci_hcd
usb 2-1.5: New USB device found, idVendor=0bc2, idProduct=3320
usb 2-1.5: New USB device strings: Mfr=2, Product=3, SerialNumber=1
usb 2-1.5: Product: Expansion Desk
usb 2-1.5: Manufacturer: Seagate
usb 2-1.5: SerialNumber: NA4JHZVB
usb 2-1.5: configuration #1 chosen from 1 choice
scsi13 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 10
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 13:0:0:0: Direct-Access Seagate Expansion Desk 070B PQ: 0 ANSI: 6
sd 13:0:0:0: Attached scsi generic sg4 type 0
sd 13:0:0:0: [sde] 3907029167 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 13:0:0:0: [sde] Write Protect is off
sd 13:0:0:0: [sde] Mode Sense: 43 00 00 00
sd 13:0:0:0: [sde] Assuming drive cache: write through
sd 13:0:0:0: [sde] Assuming drive cache: write through
sde: sde1
sd 13:0:0:0: [sde] Assuming drive cache: write through
sd 13:0:0:0: [sde] Attached SCSI disk
sd 13:0:0:0: [sde] Sense Key : Recovered Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
72 01 04 1d 00 00 00 0e 09 0c 00 00 00 00 00 00
00 4f 00 c2 40 50
sd 13:0:0:0: [sde] ASC=0x4 ASCQ=0x1d
EXT4-fs (sde1): recovery complete
EXT4-fs (sde1): mounted filesystem with ordered data mode. Opts:
SELinux: initialized (dev sde1, type ext4), uses xattr
EXT4-fs (sde1): mounted filesystem with ordered data mode. Opts:
SELinux: initialized (dev sde1, type ext4), uses xattr
EXT4-fs (sde1): mounted filesystem with ordered data mode. Opts:
SELinux: initialized (dev sde1, type ext4), uses xattr
I am running a slightly modified RHEL 6.5. Note the drive started as sdd and was remounted as sde for some reason. I unmounted it and ran a fsck through the disk utility, and it came back clean. The SMART data all looks good except for a past failure of the airflow temperature. I am just wondering what could be the cause of this and how to avoid it in the future.
The external hard drive which contains all my photos and where I backed-up all my important documents is no longer recognized. It is a three month old 500GB Iomage Prestige Desktop Hard Drive.
When I plug it in, it is recognised as a USB device, because it shows up when I type lsusb
, but dmesg
gives this error message.
[19712.013250] usb 2-2: new high speed USB device using ehci_hcd and address 21
[19712.145347] usb 2-2: configuration #1 chosen from 1 choice
[19712.147214] scsi25 : SCSI emulation for USB Mass Storage devices
[19712.147514] usb-storage: device found at 21
[19712.147519] usb-storage: waiting for device to settle before scanning
[19717.148978] usb-storage: device scan complete
[19717.149527] scsi 25:0:0:0: Direct-Access ST350082 0AS PQ: 0 ANSI: 2 CCS
[19717.151020] sd 25:0:0:0: Attached scsi generic sg2 type 0
[19717.151685] sd 25:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[19717.160402] sd 25:0:0:0: [sdb] Write Protect is off
[19717.160412] sd 25:0:0:0: [sdb] Mode Sense: 34 00 00 00
[19717.160418] sd 25:0:0:0: [sdb] Assuming drive cache: write through
[19717.165685] sd 25:0:0:0: [sdb] Assuming drive cache: write through
[19717.165691] sdb: sdb1
[19719.171808] sd 25:0:0:0: [sdb] Assuming drive cache: write through
[19719.171818] sd 25:0:0:0: [sdb] Attached SCSI disk
[19737.430998] sd 25:0:0:0: [sdb] Unhandled sense code
[19737.431007] sd 25:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[19737.431016] sd 25:0:0:0: [sdb] Sense Key : Medium Error [current]
[19737.431027] sd 25:0:0:0: [sdb] Add. Sense: Unrecovered read error
[19737.431038] end_request: I/O error, dev sdb, sector 6160463
[19737.431050] Buffer I/O error on device sdb1, logical block 6160400
[19737.431060] Buffer I/O error on device sdb1, logical block 6160401
[19737.431067] Buffer I/O error on device sdb1, logical block 6160402
[19737.431075] Buffer I/O error on device sdb1, logical block 6160403
[19737.431082] Buffer I/O error on device sdb1, logical block 6160404
[19737.431088] Buffer I/O error on device sdb1, logical block 6160405
[19737.431096] Buffer I/O error on device sdb1, logical block 6160406
[19737.431102] Buffer I/O error on device sdb1, logical block 6160407
[19737.431114] Buffer I/O error on device sdb1, logical block 6160408
[19737.431121] Buffer I/O error on device sdb1, logical block 6160409
[19737.712183] sd 6:0:0:0: [sdb] Unhandled sense code
[19737.712191] sd 6:0:0:0: [sdb] Result: hostbyte=DID_ERROR driverbyte=DRIVER_SENSE
[19737.712200] sd 6:0:0:0: [sdb] Sense Key : Hardware Error [current]
[19737.712210] sd 6:0:0:0: [sdb] Add. Sense: No additional sense information
[19737.712222] end_request: I/O error, dev sdb, sector 0
[19737.712232] Buffer I/O error on device sdb, logical block 0
Neither does the external drive show when I use fdisk
:
jeroen@phalacrocorax:~$ sudo fdisk -l
[sudo] password for jeroen:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000341ad
Device Boot Start End Blocks Id System
/dev/sda1 * 1 18714 150320173+ 83 Linux
/dev/sda2 18715 19457 5968147+ 5 Extended
/dev/sda5 18715 19457 5968116 82 Linux swap / Solaris`
I popped the disk out of the casing put it on a SATA connect internally and then tried the file recovery programs testdisk/photorec and SpinRite, but both failed because they couldn't recognize the external harddisk.
Do I have any other options?
That dmesg error means that the kernel is failing to access the device. If the kernel can't get at the disk, fdisk won't find it either, fdisk uses the Linux drivers in order to access the hard drive.
This is not likely to be a software problem.
An external drive has a regular hard-disk inside it. Your best bet at this point is to figure out whether it is the enclosure that is broken, or the drive. If you are lucky it is only the enclosure that is damaged, and the hard disk can be attached directly to your computer or put in an alternate enclosure to recover the data. Otherwise you could opt for paying for data recovery, if you think it is worth the money.
I had a problem where my disk was not accessible from my iMac, even with low level tools such as testdisk, fdisk and even dd. I just booted on a Linux Live CD and was able to restore everything.
You may want to check a similar way: try to connect your disk on another OS.
Does not look like a software problem. You could : - connect the drive to another USB port , that port could be defective - connect the drive to another system and check if it gets recognized - check/change the USB cable