Sunday 2 February 2014

spinning down / standby HDD's on Ubuntu server 13.10 (to be continued)

Ubuntu server 13.10 with 7 disks, 1 sdd for system, 4 x 2 TB in raid10 and 2 x 1 TB mirrored.

Tried out pure hdparm thing first. Installed hdparm, edit /etc/hdparm.conf adding lines for each disk, switched ACHI in BIOS, reboot. Didn't work for me. Tried manually, didn't work either.

Found this post, made some progress. Saw at least one disk being standby. As the intention was to try the thing "as is", meaning I didn't disconnect server from network and didn't try to figure what can be using the disks, fine. Will take a look later / sometime what's the status of disks.

Made a shell script for displaying the status of all disks. Thought about emailing myself status from time to time, started to read about emailing from command line, but there was a lot to read, remembered that this is lazy weekend and dropped it this time.


----
Just to document the post in case the thing go away:
1. Install sg3-utils
2. Add the following to crontab (sda being the disk to be managed this way):


0-59/15 * * * * ( if [ ! -f /dev/shm/1 ] ; then touch /dev/shm/1 /dev/shm/2; fi ; mv /dev/shm/1 /dev/shm/2; cat /proc/diskstats > /dev/shm/1 ) >/dev/null 2>&1
0-59/15 * * * * ( export HD="sda "; if [ "$(diff /dev/shm/1 /dev/shm/2 | grep $HD )" =  "" ] ; then /usr/bin/sg_start --stop /dev/$HD; fi ) >/dev/null 2>&1

No comments:

Post a Comment