Beiträge von MattGym

    Set up a scheduled job in the gui of OMV that runs every 5 min.


    Place the scipt in /usr/local/bin and point the scheduled job to run the script

    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export SHELL=/bin/sh; sudo --shell --non-interactive --user='root' -- /var/lib/openmediavault/cron.d/userdefined-d3e19231-4772-42cd-b3f1-12c7768ae55c 2>&1' with exit code '126': /var/lib/openmediavault/cron.d/userdefined-d3e19231-4772-42cd-b3f1-12c7768ae55c: 4: /var/lib/openmediavault/cron.d/userdefined-d3e19231-4772-42cd-b3f1-12c7768ae55c: spindown.sh: Permission denied

    Fun fact.

    I've setuped for both drives APM 127 and 10 min

    Old one (WD without APM spins down after ~10-15 min)

    New one (Hitachi with APM spinning all the time :/ WTF )

    I consider this a bad idea. If you care about availability (only reason to use RAID1) why do you use an old drive for it?

    Consider to use one drive as your main storage and the second one as backup. Then use rsync or rsnapshot to backup the data from the primary storage to the backup drive.

    1. Drive is in good shape like ~40k LoadCycles and aprox 10k hours of working, never felt down ect. It was used not so often (external via USB2.0)

    2. Yes it is for backup the most important stuff. I'll have to check that rsync option. No diffrence for me, even better, cause i'll schedule that for syncing once every day. Disk should live longer (but the problem is that new drive doesn't spin down right now. So if i use it as primary drive it will not spin down, the old one will spin up during rsincing and spins down 10 min after that. But NEW one will spins like maniac)


    3. It will not solve my problem with constantly spinning drive.


    I've made simple spindown.sh script

    But it has sense only in Raid1 config

    Code
    sdb_spin=$(hdparm -C /dev/sdb | grep standby)
    sdb_stb=${#sdb_spin}
    if [ $stb_stb -gt 0 ]; then hdparm -y /dev/sdc; fi


    script works fine now and i need to run it every 5-10 min

    How to do that?

    Hi,

    I have old drive 3tb(WD Green), i bought another one also 3tb (HGTS) and i've created RAID 1 . Everything works ok.. well sort off .

    The old drive does not support APM so it never spins down. I'm totaly new in Linux so i have problem. I have idea how to solve it but i don't have skils to do that.

    I want to add to OMV script which will check every 5 min, if newer disk is in standby mode via hdparm -C /dev/sdb | grep standby - and result of command hast to be stored in SRTING value

    after that i need to check if length of STRING is bigger than 0 if it is i need to send command to spin down other drive hdparm -y /dev/sdc.

    so in my head it looks like this:

    Every 5 min


    STRING = hdparm -C /dev/sdb | grep standby

    if [expr length {#STRING} -gt 0]

    then

    hdparm -y /dev/sdc



    PS.

    Sometime new disk spinning all the time too IDK why. Settings are APM 1 spin off 5 min(for tests at the ent it will be 15 - 20 min )

    does write cash prevents disk from spinning down ?


    Can somebody help me to create script ?