September 28, 20187 yr I recently changed a few settings on my server to help increase disk life. I am keeping in on less hours, but I set the disks to never spin down. However, I noticed that night my NAS wasn't shutting down (I use s3 sleep for shutdowns). Does s3 sleep only shut down the NAS if all the disks have spun down. If so, is there a workaround for people who never spin disks down?
December 27, 20187 yr Author Since this thread is being noticed by someone, I'll post my findings up to this point. No, s3 sleep does not have an option that allows for shutdowns when the disks are still spinning. However, Unraid keeps a record of all disk reads and writes in /sys/block/$DEV/stat with $DEV being the disk name. You can find an array of all hard drives (not cache) by running var=($(grep -PA1 '^name="(parity|disk)' $ini|sed -r '/^--/d;/^name=/d;s/"//g;s/^device=//')) var will contain all DEVs of the disks that are not cache. Then you can do a for loop like so DEV="${var[index]}" and append the contents of the file in /sys/block/$DEV/stat to a variable for each DEV in var. Sleep for a few seconds then run the loop again, except with another variable. Compare the two variables. If they are equal, no disk use. If not, the disk has been used (read or written from). If you want individual disk stats like write only, you can look into /sys/block/$DEV/stat and adjust your script accordingly (it has all info about disk reads, writes, ioticks, etc.) You can find documentation on it as this file occurs in many linux distros. P.S. Tested the script and it works!
December 27, 20187 yr Author Yes, this will work. Keep in mind that this will ignore all disk stats and the machine might turn off when you're using it. Its fine on most days, but I use my box past the cutoff all the time. I just have a 30 min timer and it resets when the disks are being used. Never have to worry about damaging my disks with spindows more often than necessary or unexpected turnoffs. Edited December 27, 20187 yr by DisplayNerd
Archived
This topic is now archived and is closed to further replies.