Subject: Re: Stopping SCSI disks
To: Anders Dinsen <dinsen@danbbs.dk>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: tech-kern
Date: 01/25/1999 11:52:02
>> The way IDE works is that you tell the drive, "Spin down after N seconds
>> of no accesses".  The operating system doesn't know that the drive has
>> been spun down.
>
>Ah. Thanks for clearing this! I assume there's no such SCSI2 command?

AFAIK, no.

>> There should be enough accounting in the kernel to have NetBSD do it
>> (which would also work for SCSI drives), but no one has yet written
>> it.
>
>I imagined that a solution would be to extend the sd driver with an
>ioctl command that tells it to spin the drive down and set a flag that the
>disk has been stopped. On the next access, the driver would know (from the
>flag) that a start unit command should be sent first (and the flag should
>be cleared). 

I'd wonder why you would need the userland daemon at all.  The kernel
really knows everything you need to know; is there anything to gain
by putting it in userland?

>I saw scsi-idle-2.0.36 announced on comp.os.linux.announce as a package
>and kernel patch to do this under Linux, but according to the README it is
>quite unstable (!). Anyway, I cannot see why we should suffer from that! 

It should be relatively straightforward; just a Simple Matter of
Programming :-)

--Ken