Re: dummy scsi read or scsi command periodically for external USB Hard Disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 8 Jul 2014, loody wrote:

> You are correct.
> i can see events_poll_msecs when I change my kernel to 3.8.0
> But the device still disconnect.
> I have some question.
> 1. when I cat  /sys/block/sdX/events, I get the answer as media_change.
>     is there any events type we can choose, such as read capability or inquiry.

The only other event type is eject_request.  But that applies to CD
drives, not disk drives.

> > Probably you don't actually need to do a read.  Simply opening the
> > device file ought to be sufficient.
> 2. the open device you mean is like open(/dev/sda1)?

Yes.  That will send a SCSI TEST UNIT READY command, the same as disk
events polling.  You can use usbmon to verify this.

However, maybe TEST UNIT READY won't work.  Your drive might need to 
see a READ or WRITE command.  If that's the case then neither 
events_poll_msecs nor a simple open() will help.

Have you tried using hdparm with the -B or -S flag?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux