[3392] in linux-scsi channel archive
Re: Spin down HDD's
daemon@ATHENA.MIT.EDU (Eric Lammerts)
Mon Feb 23 23:18:12 1998
Date: Mon, 23 Feb 1998 23:16:32 +0100 (CET)
From: Eric Lammerts <eric@scintilla.utwente.nl>
To: Robert Siemer <siemer@heh.uni-osnabrueck.de>
cc: linux-scsi@vger.rutgers.edu
In-Reply-To: <Pine.LNX.3.96.980221140538.17542A-100000@cactus.heh.uni-osnabrueck.de>
On Sat, 21 Feb 1998, Robert Siemer wrote:
> How can I spin down my other unmounted IDE-Drives? hdparm doesn't work,
> because my drive hasn't any timer. This drive understands only
> "spin-down-now"...
This works for my drives (and it is a standard IDE command):
It would be nice to put this into hdparm.
#include<stdio.h>
#include<fcntl.h>
#include<unistd.h>
#include<sys/ioctl.h>
#include<linux/hdreg.h>
int main(int argc, char **argv)
{
int f;
unsigned char ide_cmd[3] = { 0xe0, 0, 0 };
if((f = open(argv[1], O_RDONLY)) == -1) {
perror(argv[1]);
return 1;
}
if(ioctl(f, HDIO_DRIVE_CMD, (long)ide_cmd)) {
perror("ioctl");
return 1;
}
return 0;
}
--
Eric Lammerts <eric@scintilla.utwente.nl>
Microsoft is not the answer.
Microsoft is the question.
The answer is NO.