Page 6 of 6 FirstFirst ... 456
Results 76 to 83 of 83

Thread: Firmware to spin-down HDD?

  1. #76
    yes that was helpfull. THANK YOU

    But i have a problem when i run your script, my command line freezes and i have to exit with ctrl+c and hdd won't stop spinning. how can i test this ?

    and by the way thank you very much for your help !

    [admin@RouterASSUS root]$ /usr/sbin/scsi-stop /dev/sda
    /dev/sda is not a SCSI block device
    by the way my firmware is not oleg's latest .10 , is 1.9.2.7-rtn-r3497 as i said . hdd seems that doesn't work via scsi mode or something is changed ....
    Last edited by tmsulica; 04-01-2012 at 11:41.

  2. #77
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by tmsulica View Post
    yes that was helpfull. THANK YOU

    But i have a problem when i run your script, my command line freezes and i have to exit with ctrl+c and hdd won't stop spinning. how can i test this ?

    and by the way thank you very much for your help !
    quoting:
    this can be used like:
    /usr/local/sbin/scsi-stop.sh sda &
    /usr/local/sbin/scsi-stop.sh sdb &
    don't forget the & character, it will make the script run in the background

    by the way my firmware is not oleg's latest .10 , is 1.9.2.7-rtn-r3497 as i said . hdd seems that doesn't work via scsi mode or something is changed ....
    I know I use this script on my rt-n16.
    if it says "/dev/sda is not a SCSI block device" it might not be possible.
    it did work on .10/d firmware for you?
    Last edited by wpte; 04-01-2012 at 11:44.

  3. #78
    adn yes: ........

    Code:
    [admin@RouterASSUS root]$ ls /dev/ | grep sd
    sda
    sda1
    sda2
    sda3
    but

    Code:
    [admin@RouterASSUS root]$ /usr/sbin/scsi-stop /dev/sda
    /dev/sda is not a SCSI block device

  4. #79
    Quote Originally Posted by wpte View Post
    quoting:


    don't forget the & character, it will make the script run in the background


    I know I use this script on my rt-n16.
    if it says "/dev/sda is not a SCSI block device" it might not be possible.
    it did work on .10/d firmware for you?
    Yes you'r right it was the & symbol.

    in .10 firmware didn't work ( so i thought) because my hdd wasn't supported. but i didn't have those errors. is an another way to stop my hdd ? thanks for your support !

  5. #80
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by tmsulica View Post
    in .10 firmware didn't work ( so i thought) because my hdd wasn't supported. but i didn't have those errors. is an another way to stop my hdd ? thanks for your support !
    hmmm yes, the .10 firmware trick is the same as this one... just the script to check the activity is different. so then you should probably use the sdparm version rumenchooo uses.
    if that doesn't work either... no idea

  6. #81
    OK so i tryied Rumen Code but i get :

    Code:
    # ./hdd-stop.sh
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    syntax error
    
    "ctrl+c"
    
    [admin@RouterASSUS root]$
    what is wrong ?

    PS i switched hdd disk name from sdd to sda. and i saw running mc that i do not have an /date directory on /opt/bin.
    Last edited by tmsulica; 04-01-2012 at 17:41.

  7. #82
    but one more question wpte ... on .10 firmware existed path /dev/scsi/host0/bus0/target0/lun0/disc

    now in this build with what is replaced ?

    because /dev/sda is not an SCSI block device, so on this build where is the scsi block device ??

    10x

  8. #83
    Hey tmsulica ,

    so you have one HDD (sda)?

    Try this one.

    1.Check the paths/location of your programs

    /opt/bin/sdparm
    /opt/bin/sync
    /opt/bin/sg_start
    etc..

    are they correct for you??

    2.Did you install sdparm and sg3-utils??

    3.Put this line in /opt/etc/crontab:
    */10 * * * * admin /opt/whatever-you-want/that_script
    It will check fo activity every 10 min.

    4.Are the commands worked for you by himself????
    sdparm --flexible --command=stop /dev/sda &>/dev/null
    sdparm --flexible --command=sync /dev/sda &>/dev/null
    sg_start 0 --pc=2 /dev/sda
    awk '/sda/ {print $12}' /proc/diskstats
    etc.....

    But even if you succeed , the disk will not remain down , because firmware need to access it.(log , swap ... etc)!!!
    Even cron need to read that script from HDD!!!
    So spin up again ->> spin down --> spin up --> spin down.
    And that is for VERY short periond.
    As you know HDD don`t like spin up/donw too much.

    You have to install /opt on the flash stick and use HDD only for storage.


    #!/bin/bash
    DISKNAME=sda
    a=0
    #check 70 times with 0.1s gaps,
    #and go on adding
    for i in `seq 0 70`
    do
    b=`awk '/$DISKNAME/ {print $12}' /proc/diskstats`
    a=`expr $a + $b`
    sleep 0.1s
    done
    echo $a
    if [ $a == 0 ]
    then
    echo "$DISKNAME No Activity-->>spindown" >> /opt/var/log/syslog.log
    /opt/bin/sync
    /opt/bin/sdparm --flexible --command=sync /dev/$DISKNAME &>/dev/null
    /opt/bin/sdparm --flexible --command=stop /dev/$DISKNAME &>/dev/null
    /opt/bin/sdparm --flexible --command=stop /dev/$DISKNAME &>/dev/null
    /opt/bin/sg_start --stop /dev/$DISKNAME
    /opt/bin/sg_start --stop /dev/$DISKNAME
    /opt/bin/sg_start 0 --pc=2 /dev/$DISKNAME
    /opt/bin/sg_start 0 --pc=2 /dev/$DISKNAME
    /opt/bin/sg_start 0 --pc=3 /dev/$DISKNAME
    /opt/bin/sg_start 0 --pc=3 /dev/$DISKNAME
    else
    echo "$DISKNAME Active-->wait ....." >> /opt/var/log/syslog.log
    fi
    exit 0




    Regards
    Rumen
    Last edited by rumenchooo; 05-01-2012 at 23:38.

Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. Use copy-button to spin down hdd?
    By dome in forum WL-700g Q&A
    Replies: 9
    Last Post: 17-10-2007, 02:55
  2. WL 500Gp Keine HDD mehr nach Oleq Firmware Update
    By Greenhorn04 in forum German Discussion - Deutsch (DE)
    Replies: 1
    Last Post: 08-01-2007, 22:15
  3. twonky media server, network drive with oleg firmware
    By black_bottom in forum WL-HDD Q&A
    Replies: 3
    Last Post: 22-03-2006, 07:15
  4. HDD spin down with 1.2.3.4 firmware - how to edit?
    By jpritzkat in forum WL-HDD Q&A
    Replies: 0
    Last Post: 01-05-2005, 22:08
  5. Flashing Oleg's Firmware in WL HDD
    By hugo in forum WL-HDD Custom Development
    Replies: 29
    Last Post: 21-10-2004, 14:55

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •