Determine last write time

I am trying to reduce my system's power usage, because it is idle for 95% of the time. My ZFS pool now spins down after 30 minutes of inactivity. It reduces power from 70W back to 46W (6x HDD). However, they will always spin back up, because of smartd(8) and periodic-snapshot(8).

I can reconfigure smartd(8), so it only runs at midnight. Checking the disks only once a day is fine with me. Unfortunately, I haven't found a way to workaround the snapshot issue. I only need to create a snapshot when something has been written on the filesystem. I already use noatime, so only actual writes will change something in the filesystem.

I might be able to change periodic-snapshot(8), so it will check if the filesystem has actually been changed since the last snapshot. If not, then no snapshot needs to be made. Can somebody point me out how I can check when the filesystem has been written to for the last time (without spinning up the drive!!!)?
 
While it is possible to get last write time using something like DTrace, I think it is simpler to just take a snapshot at the same time when smartd run.
 
Back
Top