Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora Core 6 on Dell Latitude D620 Laptop
Posts: 22
Rep:
USB Hard Drive disconnects
We have 32 red hat linux 4 servers, each with western digital USB hard drives that have their own power supplies (NOT bus powered). The drives are only used nightly when a script runs to backup some data. Occasionally, on most of these servers, the drives "disconnect" and are missing from the /dev directory. The drives are mounted using the fstab, so a reboot of the server detects them and mounts them promptly. But, obviously a reboot is not a desirable thing.
Is there a command or something similar that will cause the server to re-detect the drive? I have only SSH access to the boxes. My thought is if there is such a command I could add it to my nightly backup script to correct a drive issue before the backup occurs.
Distribution: Fedora Core 6 on Dell Latitude D620 Laptop
Posts: 22
Original Poster
Rep:
That would work if the device was seen by the OS. I get the following:
[root@host ~]# mount -a
mount: special device /dev/sdb1 does not exist
It is like the USB drives are "sleeping" or some such thing causing the OS to not see them any more. I guess I need a way to tell Linux to rescan the USB ports to re-detect the drives. Unplugging and plugging back in the drive or rebooting the server causes the drive to be recognized, so I have to believe there is some kind of command available.
I had similar issue with a USB hard drive recently. (to my understanding) what happens is that hard drive spins down (effectively goes to sleep???). I couldn't find any affective solution to solve that but got around it by writing a cron job that runs every minute and just touches a file in the hard drive. The shell script looks like:
Code:
#!/bin/bash
touch /media/my_book/.keephdactive
and cron job is:
Code:
m h dom mon dow command
* * * * * /usr/bin/name_of_script
Another thing that I found useful was to mount the drive by its UUID. That provides solution of different drive name (sdc/sdd/sde etc).
Distribution: Fedora Core 6 on Dell Latitude D620 Laptop
Posts: 22
Original Poster
Rep:
the drive does not get remounted as any other device. /var/log/messages output below
Nov 30 15:07:23 host kernel: usb 1-6: USB disconnect, address 15
Nov 30 15:07:23 host kernel: scsi13 (0:0): rejecting I/O to dead device
Nov 30 15:07:23 host kernel: Buffer I/O error on device sdb1, logical block 1548
Nov 30 15:07:23 host kernel: lost page write due to I/O error on sdb1
Nov 30 15:07:23 host kernel: scsi13 (0:0): rejecting I/O to dead device
Nov 30 15:07:23 host kernel: Buffer I/O error on device sdb1, logical block 1548
Nov 30 15:07:23 host kernel: lost page write due to I/O error on sdb1
Nov 30 15:07:23 host kernel: scsi13 (0:0): rejecting I/O to dead device
Nov 30 15:07:23 host kernel: Buffer I/O error on device sdb1, logical block 1548
Nov 30 15:07:23 host kernel: lost page write due to I/O error on sdb1
Nov 30 15:07:23 host kernel: scsi13 (0:0): rejecting I/O to dead device
Nov 30 15:07:23 host kernel: Buffer I/O error on device sdb1, logical block 0
Nov 30 15:07:23 host kernel: lost page write due to I/O error on sdb1
Nov 30 15:07:24 host kernel: usb 1-6: new high speed USB device using address 16
Nov 30 15:07:24 host kernel: scsi14 : SCSI emulation for USB Mass Storage devices
Nov 30 15:07:29 host kernel: Vendor: WDC WD25 Model: 00BB-55RDA0 Rev: 20.0
Nov 30 15:07:29 host kernel: Type: Direct-Access ANSI SCSI revision: 02
Nov 30 15:07:29 host kernel: usb 1-6: control timeout on ep0in
Nov 30 15:07:29 host kernel: SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
Nov 30 15:07:29 host kernel: sdb: assuming drive cache: write through
Nov 30 15:07:29 host kernel: sdb: sdb1
Nov 30 15:07:29 host kernel: Attached scsi disk sdb at scsi14, channel 0, id 0, lun 0
Nov 30 15:07:29 host kernel: Attached scsi generic sg2 at scsi14, channel 0, id 0, lun 0, type 0
Nov 30 15:07:30 host scsi.agent[23366]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host14/target14:0:0/1
4:0:0:0
Nov 30 15:07:43 host kernel: usb 1-6: reset high speed USB device using address 16
Nov 30 15:10:06 host kernel: usb 1-6: USB disconnect, address 16
Nov 30 15:10:07 host kernel: usb 1-6: new high speed USB device using address 17
Nov 30 15:10:07 host kernel: scsi15 : SCSI emulation for USB Mass Storage devices
Nov 30 15:10:12 host kernel: usb 1-6: control timeout on ep0in
Nov 30 15:10:12 host kernel: Vendor: WDC WD25 Model: 00BB-55RDA0 Rev: 20.0
Nov 30 15:10:12 host kernel: Type: Direct-Access ANSI SCSI revision: 02
Nov 30 15:10:12 host kernel: SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
Nov 30 15:10:12 host kernel: sdb: assuming drive cache: write through
Nov 30 15:10:12 host kernel: sdb: sdb1
Nov 30 15:10:12 host kernel: Attached scsi disk sdb at scsi15, channel 0, id 0, lun 0
Nov 30 15:10:12 host kernel: Attached scsi generic sg2 at scsi15, channel 0, id 0, lun 0, type 0
Nov 30 15:10:12 host scsi.agent[23716]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host15/target15:0:0/1
5:0:0:0
Nov 30 15:10:26 host kernel: usb 1-6: reset high speed USB device using address 17
Distribution: Fedora Core 6 on Dell Latitude D620 Laptop
Posts: 22
Original Poster
Rep:
Solved!
I found the solution to this (at least for the Red Hat dirsto, 4 and 5). The hdparm command did not work on the disk since it was USB (at least that is my theory).
Instead, I made the following change, and so far no disconnects.
I modified the file /etc/modprobe.conf
I added this line to the end:
options usbcore autosuspend=-1
So far this seems to have worked. It has been implemented for two weeks and no HD disconnects. It does seem to require a reboot however to take effect.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.