Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have 3 SATA HDDs in my server. The first one is a SSD system drive, and the other two (in JBOD) are being used to store some data (accessed via Samba). Most of the time when there are no requests, those two data drives can go to sleep. However only one of those two does.

I have already set the noatime flag in fstab for both drives and Im pretty sure that there's no cron job accessing this drive. I also set the spindown timeout to 10 minutes (hdparm -S 128 command) for both.

Is there a way how do I determine which application still accesses the drive and preventing it from going to sleep?

I wouldn't normally care whether the drive is sleeping or not, but as this is a home server, setting those two drives asleep is worth saving some energy. The OS is Ubuntu Server 10.04.

Thanks for tips.

share|improve this question

4 Answers 4

up vote 3 down vote accepted

You could try powertop.

Another thing to try is to check which processes have files open on the filesystem in question. See the tools "lsof" and "fuser".

share|improve this answer

I've also heard good things about powertop.

However, you could also look at iotop (found on newer distros). iotop also help you identify what programs are writing to disk.

(It's also generally useful to see how much io a given process is doing.)

Good luck.

share|improve this answer

I believe the drive handles this.. Doesnt hdparm edit the harddrives conf???

I used the exact same configuration to put my disks to sleep.. Movies/Music/Pictures worked great, a small 40gb disk for my OS and logs :D

i know that NFS keeps the disks alive, writing logs also.. basically any binary that needs or could stat a file on the underlying disks would keep them spinning

Take a look at what your storing on these disks.. other than static files and the applications which work refer to them..

share|improve this answer

As you are on linux, you can use the new fatrace utility, which logs every file access and tells you which process is responsible:

https://launchpad.net/fatrace

More information here:

http://www.piware.de/2012/02/fatrace-report-system-wide-file-access-events/

It makes use of the linux fanotify API (more details) available since linux kernel 2.6.37.

fatrace isn't packaged by most distributions as of July 2014 (it entered debian testing recently, so should ship in 'jessie'), but is easy to install from source.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.