# [solved] harddrive (not) spinning down

## Sade

When i spin down my harddrive using hdparm -y /dev/sda it will spin down, but only for ~5 seconds and then it spins up again. This is probably because some program is accessing it, but i don't know which program.

How do i find which program is accessing the HDD and how do i make it access the drive less often?

note, that i don't use swap.

----------

## ppurka

You can emerge laptop-mode-tools and use lm-profiler to see which program is using the disk. The issue of decreasing disk access may depend on the program. You can also set up laptop-mode-tools to increase the time between two commits to the hard disk, and to spin down the hard drive. The configuration files are in /etc/laptop-mode/.

----------

## Sade

Sorry for the late response,

so i've installed laptop-mode-tools and these are the programs that lm-profiler returns:

anacron

cron

atd

apache2

mysqld

smbd

sshd

I don't (actively) use the first three, but i do use apache mysql samba and ssh, 

although i wouldn't mind if these last programs would access the harddrive less often.

----------

## aCOSwt

Hello,

Being said that I do not know exactly what I am speaking about...   :Rolling Eyes: 

Depending on the choice you made for the I/O scheduler, it may not necessarily be a process which directly needs the hard drive.

But the I/O scheduler itself.

I suggest you do the same test making sure you get the NO-OP I/O scheduler.

Additionally, if you want less access to your hdd, you can try the anticipatory I/O scheduler.

Warning : This is not worth 2 cts !

----------

## Sade

thanks for the tip, i tried lm-profiler for the noop scheduler, same results though.

----------

## Sade

bump  :Question: 

----------

## papahuhn

I had the same problem some months ago. For me it was /sbin/vol_id shipped with udev. I'm not sure any more why the problem had vanished, maybe because of an udev upgrade or because I switched to another Desktop Environment.

----------

## Sade

what is this atd process,

it is mentioned in the Power Management Guide but not really explained.

It is not in my rc-status, nor in the /etc/init.d/ directory

I've found on the interwebs that it runs programs for at, but what is at?

----------

## Sade

found it!

i needed to also give the -B 127 option using hdparm

I've revesed the advice from the Arch laptop wiki

Where they advice you to use the -B 254 option to disable drive spindown, apparently my drive had this by defailt and i had to set it to something less then 128 to allow spindown, see man hdparm.

For people with the same problem, it's a 2.5" WD scorpio black 320GB.

```
atom tmp # hdparm -i /dev/sda

/dev/sda:

 Model=WDC, FwRev=11.01A11, SerialNo=WD-WXE608PM6560

 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50

 BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=625142448

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 

 AdvancedPM=yes: unknown setting WriteCache=enabled

 Drive conforms to: Unspecified:  ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode
```

----------

## Sade

Apparently this was not the final solution to the problem, see this topic where a different solution is found.

----------

