We do a WIN_STANDBYNOW1 to spin a drive down, and a WIN_IDLENOW1 to spin it back up. We do this so that we have complete control over the disks; if we leave it to the drive then the app blocks during spinup if it needs something desparately from disk to continue.

eg:
const unsigned char spindown[4]={ WIN_STANDBYNOW1, 0, 0, 0 };
ioctl(harddisk_fd,HDIO_DRIVE_CMD,spindown);

IDLENOW1 is 0xE1 if you can't find it in the header files.

Hugo