@kcomer Yes so it looks like with your card we can’t do hdparm for this, but I have been looking into this myself since you raised the issue and I think the most promising ‘work around’ would be to use our old friend smartctl to try and do this, since it’s already aware of the ‘re-direction’ these cards seem to require.
There is a ‘–set’ option that, along with the hard won LSI specific custom smart options, may allow us to set the drives built in spin-down, akin to what hdparm normally manages to do. It has the advantage of addressing the same built in drive based facility and shares the same settings values (which are quite strange as it goes).
I have opened an issue (see below) to extend Rockstor’s custom smart options validation to include the ‘–set’ smartctl option, however it’s facility to set spin down is as yet unproven in the current context of how these settings are used. That is, Rockstor’s custom settings are applied to every smart call made by the system, specifically the pole driven smart available / enabled call used to populate the last column on the ‘Disk’ page. So it may need more extensive integration as an hdparm -S work around, which in the current release is only executed on initial config or change and there after only on boot via a dedicated systemd script; so not repeatedly as the custom smart options are.
So it would definitely help to evaluate the viability of this work around and if we need to incorporate some kind of ‘don’t run --set on every pole’ type exclusion (or wait until we are fully event driven) if you could identify how it behaves. Initially we need to know if for example the following command manages to execute without error and also does what we hope, ie set spindown successfully.
smartctl -d 3ware,1 --set standby,60 /dev/twl0
Which as you are now keenly aware (but for other readers) is device on port 1 on the first LSI controller named /dev/twl0 (down to driver / card type).
Obviously I’m hoping this works for you although you may have to do a few drives in order to be able to hear if it works, given the hdparm power status read issue with these controllers (ie the unknown return). Also of note from man smartctl we have “… there is no get option because ATA standards do not specify a method to read the standby timer.” so we can’t just run a command to see if the setting took. Rockstor’s existing spin down mechanism simply retrieves the setting stored in the file we create to set it in the first place; it would have been nicer to retrieve from the device itself but as documented this isn’t an option.
Anyway if this works and the chosen drives spin down when completely unused for the designated period (5 mins in the example) then it would also be really handy to know if a second application of the same smartctl command to a device known to be already in standby mode, ie spun down, will cause that device to spin up again. If so then I can add this info to the issue I’ve already opened as a result of this discussion:
but it would make this a fair bit more complicated as a work around path. Especially given the command would have to be executed at least once on every boot (at least it does in the hdparm variant of setting spin down time).
Otherwise we are stuck with using LSI’s own custom and varied utilities which are far less likely to be integrated into Rockstor (for some time at least), especially given they may well only work with certain kernel versions etc and as far as I know vary from card to card so another whole can of worms.
Let us know how you get on with the suggested --set variant of smartctl and just as a reminder this will have to be executed on the command line until the utility is proven to afford the time spent on the GitHub issue highlighted.
Thanks for persevering with this one as I believe LSI cards are a popular choice, not sure how popular spin down on such hardware is though.