Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am the owner of a NAS, running some Linux distribution. It comes with a web administration frontend, where I can manage several services, user rights and also when it should go to sleep. My problem is, for some reason, when the NAS has gone to sleep, the hard drive turns on again after a couple of minutes. Then it will spin for some time, then sleep again. This keeps going on indefinitely.

How can I try to determine the cause for this? I am very new to Linux, but I managed to get root access, and now have a SSH connection.

share|improve this question
    
This is very old, but may still have relevant tips. –  Gilles Jan 19 '12 at 0:36
    
Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel. –  Nikhil Mulley Jan 19 '12 at 6:16
    
The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790. –  Andreas Jan 19 '12 at 17:38
add comment

3 Answers

up vote 3 down vote accepted

inotify-tools is a simple way of doing this. There are several examples on their site that would be able to do what you want (see the inotifywatch example for a really basic one).

share|improve this answer
    
I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :) –  Andreas Jan 19 '12 at 17:34
add comment

Try running iotop perhaps? I've found it useful in the past.

share|improve this answer
add comment

Another tip: Use Systemtap, there are bunch of probe scripts on systemtap's site useful enough to find the culprit.

In another case altogether,

If you want to find out which process caused the disk to spin up, you can gather information by setting the flag /proc/sys/vm/block_dump. When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk needs to spin up, and to increase battery life even more. The output of block_dump is written to the kernel output, and it can be retrieved using "dmesg" or look at your syslog kern facility for the destination of the debug messages. Generally, it should be /var/log/debug . When you use block_dump and your kernel logging level also includes kernel debugging messages, you probably want to turn off klogd, otherwise the output of block_dump will be logged, causing disk activity that is not normally there.

share|improve this answer
add comment

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.