Spin Down/Up Drives via Bash Script?


Recommended Posts

 

Hello all I am trying to find the command Unraid uses to spin down and up disks so that I can add this to a bash script. My use case is that I know after a certain time my server will not be accessed for usually 12~ hours so I would like to spin down the drives at that time as there is no need for them to be up. Does anybody know what the command is as I've scoured the forum but have not found anything up to date that works. 

Link to comment
  • 4 years later...
On 4/16/2019 at 2:49 PM, Squid said:

 

mdcmd spindown x
mdcmd spinup x

But, simplest way is to simply set drive spindown timers in the drive's settings.  That way unRaid will spin down the drives when not accessed.

Did this command change? Doing mdcmd spindown sdc for example returns "/usr/local/sbin/mdcmd: line 11: echo: write error: Invalid argument".

Edit: emcmd cmdSpindown=disk1 works.

Edited by mathiasdoe
Link to comment
On 9/26/2023 at 10:50 AM, mathiasdoe said:

Doing mdcmd spindown sdc

Because Unraid is basically a new install every boot, the sdX designations can and do change when there are hardware changes, and sometimes when there are only software changes. Any scripted disk reference needs to use something OTHER than the sdX designation or you risk applying the command to the completely wrong disk.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.