# Serial ATA hard disks and hdparm?

## jsosic

Well I've searched out this forum from the dusk till dawn....and zero...

So I'm opening a new topic. IS THERE ANY WAY to spindown sata hard disk? I have sil3112 and kernel still suports ATA drivers for this chip, bit it says OBSOLETE, and because I'm removing ATA disk from my computer and migrating to sata hard drive, I would like to know how to spin it down (put it in standby mode)? hdparm -y won't do it, it says it does not support SCSI drives and I just can't believe that linux community hasn't offered a solution for this problem yet? I mean, SCSI is here for a while, and I just can't believe that people can't turn off their drives  :Sad:  Windows does it outofthebox.

So, what's the hdparm alternative, and ideas?!

----------

## dsd

try blktool

----------

## jsosic

It's not in the portage as far as I can see?

[EDIT]

Also, I've got this compiling output...

```
make  all-am

make[1]: Entering directory `/data/blktool-4'

if gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -Wall -g -O2 -MT blktool.o -MD -MP -MF ".deps/blktool.Tpo" -c -oblktool.o blktool.c; \

then mv -f ".deps/blktool.Tpo" ".deps/blktool.Po"; else rm -f ".deps/blktool.Tpo"; exit 1; fi

blktool.c: In function `detect_dev_class':

blktool.c:304: error: `SCSI_DISK8_MAJOR' undeclared (first use in this function)

blktool.c:304: error: (Each undeclared identifier is reported only once

blktool.c:304: error: for each function it appears in.)

blktool.c:304: error: `SCSI_DISK15_MAJOR' undeclared (first use in this function)

make[1]: *** [blktool.o] Error 1

make[1]: Leaving directory `/data/blktool-4'

make: *** [all] Error 2
```

Any help?  :Sad: 

----------

## daad

You probably have sys-kernel/linux-headers but you need sys-kernel/linux26-headers.

Try this:

```

emerge unmerge sys-kernel/linux-headers

emerge linux26-headers

```

After that you should be able to build blktool cleanly (don't forget to run configure again).

It may be advisable to reemerge your glibc because of new linux-headers.

Good luck.

----------

## radagast

does anyone want to recommend that i try blktool with software raid?

i can't see any reason why it wouldn't work, if you put both drives on the command line.  they should wake up straight away if something wants to write to them anyway.

but i've got the fear...

i found this one year old thread... https://forums.gentoo.org/viewtopic-t-119083-highlight-sata+sleep.html

which pointed to this conversation between people with larger brains than me:

http://www.webservertalk.com/showthread.php?s=66b8ebe8199c951d27ce7a92ec40434b&threadid=351323&perpage=10&pagenumber=1

and i found this, but i've never compiled anything in c before, especially not anything that could lose all my data...

http://sourceforge.net/mailarchive/forum.php?thread_id=6367328&forum_id=12495

Or am i on the wrong track, and i should just get my ACPI power management sorted out properly?

----------

## Meeuw

blktool is in portage now, but it doesn't seem to get my sata harddisk in standby/poweroff/sleep mode.

I've tried the C code from the page you posted but it gives me:

```
program a.out is using a deprecated SCSI ioctl, please convert it to SG_IO

ioctl_internal_command: ILLEGAL REQUEST asc=0x20 ascq=0x0
```

But there seems to be some development in libata:

http://thread.gmane.org/gmane.linux.kernel/304752

----------

## shawnifoley

hdparm 6.1 and latest morph-sources works like a charm for me:)

--

 Shawn

----------

## bollucks

search for sdparm on google

----------

## j-m

 *bollucks wrote:*   

> search for sdparm on google

 

In portage...

----------

## pilo

Use matching patch from this page: http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/

And of course as mentioned earlier, Hdparm 6.1.

Just remember that drives will wear out much faster when spun down and up. I haven't seen any comparison between high temperature and many spinups, but I'd bet harddrives fare worse by the latter.

OffT:

The patch should also let you read S.M.A.R.T.-values with smartmontools, if you pass "-d ata" as an argument.

----------

