You are not logged in.

#1 2012-05-06 20:34:46

battlepanic
Member
Registered: 2009-08-22
Posts: 76

USB hard drive is periodically disappearing from /dev

I have a USB hard drive which always remains attached to my machine.  The kernel typically sees this device as /dev/sdb.  It contains a few partitions which I always keep mounted on my filesystem.  However, I have noticed that after an extended period the USB drive will disappear from /dev/ only to reappear under a different name, such as /dev/sdc.

The drive was never physically unplugged from my machine.  Any ideas as to why it's disappearing and then reappearing on /dev under a different name?

Offline

#2 2012-05-06 21:34:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,700

Re: USB hard drive is periodically disappearing from /dev

Take a look through the output of dmesg for clues.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2012-05-07 14:06:51

battlepanic
Member
Registered: 2009-08-22
Posts: 76

Re: USB hard drive is periodically disappearing from /dev

As far as I can tell, it seems that the problem appears sometimes when I change to directory at which the drive is mounted and then list the directory contents.  This sometimes works on the first invocation of 'ls' but issuing subseqent 'ls' commands fail.  To date, I've only noticed this happening if I'm returning to the drive after letting it idle for a long period, like overnight.

Looking at the output of dmesg I see the following:

[1456149.891859] usb 1-4: USB disconnect, device number 11
[1456149.895849] sd 11:0:0:0: [sdb] Unhandled error code
[1456149.895856] sd 11:0:0:0: [sdb]  Result: hostbyte=0x07 driverbyte=0x00
[1456149.895863] sd 11:0:0:0: [sdb] CDB: cdb[0]=0x28: 28 00 13 85 1f e7 00 00 01 00
[1456149.895881] end_request: I/O error, dev sdb, sector 327491559
[1456149.897471] sd 11:0:0:0: [sdb] Unhandled error code
[1456149.897477] sd 11:0:0:0: [sdb]  Result: hostbyte=0x01 driverbyte=0x00
[1456149.897483] sd 11:0:0:0: [sdb] CDB: cdb[0]=0x28: 28 00 13 85 1f e8 00 00 01 00
[1456149.897500] end_request: I/O error, dev sdb, sector 327491560
[1456149.899219] FAT-fs (sdb5): Directory bread(block 177330151) failed
[1456149.899827] FAT-fs (sdb5): Directory bread(block 177330152) failed
[1456149.900396] FAT-fs (sdb5): Directory bread(block 177330153) failed
[1456149.900951] FAT-fs (sdb5): Directory bread(block 177330154) failed
[1456149.901526] FAT-fs (sdb5): Directory bread(block 177330155) failed
[1456149.902513] FAT-fs (sdb5): Directory bread(block 177330156) failed
[1456149.903025] FAT-fs (sdb5): Directory bread(block 177330157) failed
[1456149.903519] FAT-fs (sdb5): Directory bread(block 177330158) failed
[1456149.903986] FAT-fs (sdb5): Directory bread(block 177330159) failed
[1456149.904518] FAT-fs (sdb5): Directory bread(block 177330160) failed
[1456149.905636] FAT-fs (sdb5): Directory bread(block 177330161) failed
[1456149.906872] FAT-fs (sdb5): Directory bread(block 177330162) failed
[1456149.908129] FAT-fs (sdb5): Directory bread(block 177330163) failed

And so on.  Then a few seconds later, I see the drive showing up again:

[1456156.897744] usb 1-4: new high-speed USB device number 12 using ehci_hcd
[1456157.022734] usb-storage 1-4:1.0: Quirks match for vid 1058 pid 0704: 8000
[1456157.022782] scsi12 : usb-storage 1-4:1.0
[1456158.025000] scsi 12:0:0:0: Direct-Access     WD       3200BEV External 1.05
 PQ: 0 ANSI: 4
[1456158.026831] sd 12:0:0:0: [sdc] 625142448 512-byte logical blocks: (320 GB/2
98 GiB)
[1456158.028058] sd 12:0:0:0: [sdc] Write Protect is off
[1456158.028065] sd 12:0:0:0: [sdc] Mode Sense: 21 00 00 00
[1456158.028861] sd 12:0:0:0: [sdc] No Caching mode page present
[1456158.029336] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[1456158.032238] sd 12:0:0:0: [sdc] No Caching mode page present
[1456158.032613] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[1456158.105243]  sdc: sdc1 sdc2 sdc4 < sdc5 sdc6 sdc7 >
[1456158.112873] sd 12:0:0:0: [sdc] No Caching mode page present
[1456158.113299] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[1456158.113706] sd 12:0:0:0: [sdc] Attached SCSI disk

It is as though the drive USB drive is being disconnected and then immediately reconnected but this disconnection is only induced by actually looking at the contents of the drive.  In other words, the disconnection is not random, I have to actually use the drive before the disconnection is reported by dmesg.  Has anyone run into this problem?

Offline

Board footer

Powered by FluxBB