Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how do you spin up array from the command line the mdcmd doesnt work

Featured Replies

  • Author

ya thats what i already have   

but i wanted to keep the drives spun up from 9am to 9pm  running the cron  and after 9pm  then  it shut down after 15 min

but so far  cant find the command line that spins up all the disks  or least disk1  then id copy and paste for all the disks lol  

  • Author

cuz when i use it during the day .. and spun down even with the file cache plugin it still cant go fast to access the array your sitting and waiting so thats why i wanna keep it spun up during the day but after it can spin down

  • Community Expert

normal actvity and call for data should spin the disk up.

If they are in a spin down state. I can see needing a coamdn to spin them down or stoping the array for that period of time so no interaction is happenign at all but not a spin spin up as that should spin up and work when the next task i called.

  • Author

so if i using it at home i may wanna acces files off the array so i gotta wait a 1 min or 2 for the disks to spin up from standby... and if i go away for 15--20 min not doing anything .. of course spins back down.. and then once again to access unraid shares takes 1 to 2 min before the drives spin up.. and stopping the array would kill all the vms and dockers..

so i trying to make it so the drives will stay spun up during the day and then it can goto sleep after 9pm if no activity at 15 min.. as i set the cron job to run ever 10 min to force the array to be spun up...

i tried a spin up from 2011 ya that didnt work that was just 2 lines of code lol

  • Author

i tried

smartctl -i -n idle /dev/sdd

to get the drive out of standby mode figured idle is spinup but it didnt like that either lol

  • Author

@bmartino1 i ended up getting your code to work kinda.. it wasnt working but i had to reboot my unraid box and this morning i tested it after 8am and the script through error

as the if statement doesnt like "08" for 8am

when you use if (( HOUR >= START_HOUR && HOUR < STOP_HOUR )); then

so i played with just stripping everything and ran in a script

#!/bin/bash

#!/usr/bin/env bash

set -euo pipefail

# Log file

LOG_FILE="/var/log/unraid-keep-spunup.log"

#########################################

# INTERNALS

#########################################

HOUR=$(date +%H)

CSRF=$(grep -Po '^csrf_token="\K[^"]+' /var/local/emhttp/var.ini || true)

COOKIE=/tmp/unraid.cookies

curl -sS -k --fail -e "http://localhost/Main" \

-c "$COOKIE" -b "$COOKIE" \

--data "csrf_token=${CSRF}&cmdSpinupAll=Spinup" \

http://localhost/update.htm \

|| curl -sS -k --fail -e "https://localhost/Main" \

-c "$COOKIE" -b "$COOKIE" \

--data "csrf_token=${CSRF}&cmdSpinupAll=Spinup" \

https://localhost/update.htm

now when i did that it didnt spin up any drives the logs showed

parent.document.getElementById('progressFrame').style.zIndex = 10;

origin = parent.location.origin;
search = parent.location.search;

function replaceName(name) {
var x = search.indexOf("name=");
if (x>0) search = search.substring(0,x+5) + name;
}

function replaceOrigin(new_origin) {
origin = new_origin;
}

function addLog(logLine) {
document.body.innerHTML += logLine;
window.scrollTo(0,document.body.scrollHeight);
}

function disablePage() {
setTimeout(function(){parent.document.getElementsByClassName('spinner fixed')[0].style.display = 'block';},500); // show spinner when operation takes longer than 0.5s
for (var i=0,element; element=parent.document.querySelectorAll('input,button,select')[i]; i++) element.disabled = true;
for (var i=0,link; link=parent.document.getElementsByTagName('a')[i]; i++) link.style.color = "gray"; //fake disable
}

function enablePage() {
parent.location.assign(origin + parent.location.pathname + search);
}

disablePage();




Script Finished Oct 20, 2025 08:22.14

Full logs for this script are available at /tmp/user.scripts/tmpScripts/test2/log.txt

in the end the only way things worked for me was

was cron */10 9-21 * * *

and script to

# Keep The Drives Spun Up 9am to 9pm Running every 10 Min

# cron 10 9-21 * * *

#for disknum in ls /dev/md* | sed "sX/dev/mdXX"; do /root/mdcmd spinup $disknum; done

#for disknum in ls /dev/md* | sed "sX/dev/mdXX"; do /root/mkdir /mnt/$disknum/abctest; done

tempdir="testabc"

mkdir /mnt/disk1/$tempdir

mkdir /mnt/disk2/$tempdir

mkdir /mnt/disk3/$tempdir

mkdir /mnt/disk4/$tempdir

mkdir /mnt/disk5/$tempdir

mkdir /mnt/disk6/$tempdir

mkdir /mnt/disk7/$tempdir

rmdir /mnt/disk1/$tempdir

rmdir /mnt/disk2/$tempdir

rmdir /mnt/disk3/$tempdir

rmdir /mnt/disk4/$tempdir

rmdir /mnt/disk5/$tempdir

rmdir /mnt/disk6/$tempdir

rmdir /mnt/disk7/$tempdir

this seems only way that worked not what i wanted but i guess it will do.. maybe i need to request a feature request where its built in where you can have the array be spin up in a certain hours

or have 2 command lines Spinup -All or Spinup <disk1> and Spindown -all or Spindown <disk1> so u can just easily run it from command line

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.