I was having some difficulty with a disk spinning up periodically and in the process of debugging it I created a small shell script which others might find useful if they have the same problem.
What it does:
- It writes out buffered data to the disk
- Enables Block Dump Reporting
- Puts the Drive into Standby (spin-down)
- Then sits in a while loop waiting for the drive to spin back up.
- When it does spin up it turns off the reporting and displays the messages relating to the drive you are watching.
Run: find_culprit <drive>
Example: find_culprit sdc
(/dev/sdc is my spin disk)
Output looks like this:
So now I can see that the files:
- Plex Media Server.log (in Logs)
- com.plexapp.system.log (in PMS Plugin Logs)
In this case it was actually sync'ing the RAM directories back to the physical disk that woke it up (daily cron job). But this helps automate the work of finding what is accessing your disk and waking it up.