Page 5 of 6 FirstFirst ... 3456 LastLast
Results 61 to 75 of 83

Thread: Firmware to spin-down HDD?

  1. #61
    I would really like to spin down my HDD when it is inactive for 20 minutes. When I try
    PHP Code:
     /usr/local/sbin/scsi-stop /dev/scsi/host0/bus0/target0/lun
    0
    /disc 
    , I get this error:
    PHP Code:
    /dev/scsi/host0/bus0/target0/lun0/disc is not a SCSI block device 
    Am I doing something wrong, or does it just not work with my HDD. If it doesn't work, are there any other options?

  2. #62

    scsi-stop in RAID1

    I'm using two 1tb discs in RAID1 (using mdadm) and mounted as md0

    Code:
    $ cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid5] [multipath]
    read_ahead 1024 sectors
    md0 : active raid1 scsi/host0/bus0/target0/lun0/part1[0] scsi/host1/bus0/target0/lun0/part1[1]
          976759936 blocks [2/2] [UU]
    if I use the scsi-stop script (one for each disc) the discs spindown correctly but when the discs are needed again only one disc resume, breaking the RAID sync. Is there a way to stop this from happen or another script to use raid md0?

    Code:
    scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc
    scsi-stop.sh /dev/scsi/host1/bus0/target0/lun0/disc
    the discs:

    Code:
    $ cat /proc/scsi/usb-storage-0/0
       Host scsi0: usb-storage
           Vendor: Iomega
          Product: External HD
    Serial Number: 9E057FFFFFFF
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 059b037000009e057fffffff
         Attached: Yes
             Port: 1.1
              Bus: 01:03.2-1.1
    Last edited by s1za; 25-05-2009 at 13:59.

  3. #63
    Spin-down/-up Works well on Oleg (lly.dev r655)

    Code:
       Host scsi1: usb-storage
           Vendor: Iomega
          Product: Iomega Select HDD
    Serial Number: 5E23FFFFFFFF
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 059b047a00005e23ffffffff
         Attached: Yes
             Port: 2.1
    Code:
    P:  Vendor=059b ProdID=047a Rev= 0.00
    S:  Manufacturer=Iomega
    S:  Product=Iomega Select HDD

  4. #64
    Hi, I'm actually using teddy_bear's USB Tomato mod on a WL-520GU (stupid 4 MB flash...), and it includes scsi-stop and scsi-start, and I wanted to share my experience with getting it working.

    I used a watt-meter to verify that the disk actually did spin down or up. My setup involves an external enclosure with the following stats.

    Code:
       Host scsi0: usb-storage
           Vendor: JMicron
          Product: JM20336 SATA, USB Combo
    Serial Number: DA0150217888
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 152d23360000da0150217888
         Attached: Yes
             Port: 1
              Bus: 00:03.1-1
    
    Vendor=152d ProdID=2336
    This is very similar to one that doesn't work (PID=2338). But I had to do something funny to get mine to work. If I call scsi-stop, the disk spins down, and when I go to access it, the disk becomes inaccessible. If I call scsi-stop and then scsi-start before accessing the disk, it behaves correctly, staying spun down until I go to access it.

    There are other Tomato-specific requirements for scsi-stop and scsi-start. You need to put the script in /jffs, and you need the build with awk. Here's the final script with the other Tomato-specific changes.

    Code:
    #!/bin/sh
    if /usr/bin/[ $# -ne 1 ]; then
            /bin/echo 1>&2 "Usage: $0 <device>"
            exit 1
    fi
    
    PERIOD=30
    BOUNDARY=1200
    SCSISTOP=scsi-stop
    SCSISTART=scsi-start
    LOGFILE=/tmp/scsi-stop.log
    
    searchstr="disk_io:"
    devaddr="(`/bin/ls -l $1 | /usr/bin/awk '{print($5 int($6/16))}'`)"
    
    str=`/bin/grep "$searchstr" /proc/stat | devaddr="$devaddr" /usr/bin/awk -v 'RS= |\n' -F : '{ if($1==ENVIRON["devaddr"]) print($2) }'`
    cooltime=0
    stopped=0
    
    while true; do
            /bin/sleep $PERIOD
            newstr=`/bin/grep "$searchstr" /proc/stat | devaddr="$devaddr" /usr/bin/awk -v 'RS= |\n' -F : '{ if($1==ENVIRON["devaddr"]) print($2) }'`
            if /usr/bin/[ "$newstr" = "$str" ]; then
                    cooltime=$(($cooltime + $PERIOD))
                    if /usr/bin/[ $cooltime -ge $BOUNDARY -a $stopped -eq 0 ]; then
                            $SCSISTOP $1
                            $SCSISTART $1
                            time=`/bin/date '+%b %e %H:%M:%S'`
                            /bin/echo "$time: Cooled down..." >> $LOGFILE
                            stopped=1
                    fi
            else
                    if /usr/bin/[ $cooltime -ne 0 ]; then
                            time=`/bin/date '+%b %e %H:%M:%S'`
                            /bin/echo "$time: Disk first used after $cooltime seconds" >> $LOGFILE
                    fi
                    cooltime=0
                    str=$newstr
                    stopped=0
            fi
    done

  5. #65

    Prestigio external usb hdd

    Prestigio Don't works


    Code:
       Host scsi0: usb-storage
           Vendor: Prestigio
          Product: USB Storage HDD
    Serial Number: 7DF88FFFFFFF
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 152d233900007df88fffffff
         Attached: Yes
             Port: 1
              Bus: 01:03.2-1

  6. #66

    Transcend StoreJet 2.5 works well

    Works well
    Box: Transcend StoreJet 2.5 (SATA)
    Code:
       Host scsi1: usb-storage
           Vendor: JMicron
          Product: StoreJet Transcend
    Serial Number: 0D0708925FFF
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 152d232900000d0708925fff
         Attached: Yes
             Port: 1.1
              Bus: 01:03.2-1.1
    Code:
    P:  Vendor=152d ProdID=2329 Rev= 0.00
    S:  Manufacturer=JMicron
    S:  Product=StoreJet Transcend

  7. #67

    scsi device

    Quote Originally Posted by AshDyk View Post
    I would really like to spin down my HDD when it is inactive for 20 minutes. When I try
    PHP Code:
     /usr/local/sbin/scsi-stop /dev/scsi/host0/bus0/target0/lun
    0
    /disc 
    , I get this error:
    PHP Code:
    /dev/scsi/host0/bus0/target0/lun0/disc is not a SCSI block device 
    Am I doing something wrong, or does it just not work with my HDD. If it doesn't work, are there any other options?
    I have the same problem, can anybody help?

    PHP Code:
     Host scsi0usb-storage
           Vendor
    Sunplus Technology Inc.
          
    ProductUSB to Serial-ATA bridge
    Serial Number
    SAMSUNG HDS1Y6J1LS806829
         Protocol
    Transparent SCSI
        Transport
    Bulk
             GUID
    04fc0c25315ffffffffffff9
         Attached
    Yes
             Port
    1
              Bus
    01:03.2-

  8. #68

    scsi

    My problem was firmware 1.9.2.7-d-r1612, with oleg 1.9.2.10 was everything ok.
    Problem was only my swap (its on the same hdd).
    Disc goes down, but after second it spin-up so nothing for me

  9. #69

    Thumbs up Asus WL-500G Premium v2 + Samsung Strory Station 1Tb

    WORKING!

    Code:
    Host scsi0: usb-storage
    Vendor: JMicron
    Product: Samsung STORY Station
    Serial Number: 0000002CE09310500532
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 04e85f05002ce09310500532
    Attached: Yes
    Port: 1.1
    Bus: 00:03.1-1.1
    Thnks But i'm not understand HowTo find VendorID&ProductID, there is a lot of code

    Code:
    T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 2
    B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS= 8 #Cfgs=  1
    P:  Vendor=0000 ProdID=0000 Rev= 2.04
    S:  Manufacturer=Linux 2.4.20 ehci_hcd
    S:  Product=PCI device 14e4:471a
    S:  SerialNumber=00:03.1
    C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms
    T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 2
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=0424 ProdID=2502 Rev= 0.01
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
    T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=04e8 ProdID=5f05 Rev= 0.00
    S:  Manufacturer=JMicron
    S:  Product=Samsung STORY Station
    S:  SerialNumber=0000002CE09310500532
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
    B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0000 ProdID=0000 Rev= 0.00
    S:  Product=USB OHCI Root Hub
    S:  SerialNumber=b8003000
    C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
    Last edited by d0s.kzn; 04-12-2011 at 12:40.

  10. #70

    Question Stoppin your hard drive motor on latest firmware.

    Hy , i have a question for you guys:

    How can i stop my HDD from spinning when i don't need it ?

    I read this post: http://wl500g.info/showthread.php?t=7836&page=5 and i tryied xander solution:

    Here's the possible solution:
    1. Download http://oleg.wl500g.info/bin/scsi-stop - this binary is able to spin-down your disk immediately after execution.
    2. Place it somewhere on your router (you should be able to reach it via PATH environment variable) and make it executable.
    3. You can use the script I've written which works in background and spins down disk after some period of inactivity:
    http://wl500g.info/showpost.php?p=47135&postcount=10
    I use it this way (I named the script scsi-stop.sh):

    Code:
    ./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &It automatically writes some log messages to scsi-stop.log.
    It works for me. You can change it as you wish.
    but seems that my hdd doesn't work through scsi mode because i get:

    Code:
    /dev/scsi/host0/bus0/target0/lun0/disc: No such file or directory
    and when i try the path that i think is correct ( newbie, i know )

    Code:
    [admin@RouterASSUS work]$ scsi-stop /dev/discs/disca/disc
    i get:

    Code:
    /dev/discs/disca/disc is not a SCSI block device
    I have latest 1.9.2.7-rtn-r3497 firmware from http://wl500g.googlecode.com/, and installed by wengi tutorial from: http://wl500g.info/showthread.php?t=10307 (with disca changes of course)

    Can anybody help ? Thank you !

  11. #71
    Hi ,

    you can modify that script for you needs ,plase it somwhere and make a cron job:
    It looks ugly , but worked for me.

    #!/bin/bash
    DISKNAME=sdd
    now=`/opt/bin/date`
    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 "$now /dev/sdd 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 "$now /dev/sdd Active-->wait ....." >> /opt/var/log/syslog.log
    fi
    exit 0


    Of cours you have to :
    ipkg install sg3-utils
    ipkg install sdparm

    Regards
    Rumen
    Last edited by rumenchooo; 01-01-2012 at 22:31.

  12. #72

    Talking

    thanks a lot, but how can i test it before because doesn't work on all hhd's ?

    And btw what do i put in crontab ? what line, or can i put the script in init.d ?
    And second, disk name i have to put my disk name ? and the time for waiting to idle is editable ? thank you very much!

    PS: when i try a simple command

    [admin@RouterASSUS root]$ /opt/bin/sg_start --stop /dev/discs/disca

    i get

    Error trying to open /dev/discs/disca: Is a directory

    even when i enter:
    [admin@RouterASSUS root]$ /opt/bin/sg_start --stop /dev/$DISKNAME

    i get:

    Error trying to open /dev/: Is a directory
    Last edited by tmsulica; 04-01-2012 at 10:36.

  13. #73
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by tmsulica View Post
    thanks a lot, but how can i test it before because doesn't work on all hhd's ?

    And btw what do i put in crontab ? what line, or can i put the script in init.d ?
    And second, disk name i have to put my disk name ? and the time for waiting to idle is editable ? thank you very much!
    I used the old scsi tools to do the same thing: http://wpte.kicks-ass.net/forum/showthread.php?tid=4
    it's a modification of the old d script

  14. #74
    hy, that is what i was looking for, but can i issue a command before all this to see if the hdd is stopping ? like in the old scsi-stop ?

    2. that is my problem i can't find hdd name .......

  15. #75
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by tmsulica View Post
    hy, that is what i was looking for, but can i issue a command before all this to see if the hdd is stopping ? like in the old scsi-stop ?

    2. that is my problem i can't find hdd name .......
    well the harddrives are labeled like "sdx" with x as a or b or c etc.
    so your first drive is called "sda" your first partition on sda is called "sda1" etc.
    you can check it in /dev :
    ls /dev/ | grep sd
    for me it shows this:
    sda
    sda1
    sda2
    sda3
    sdb
    sdb1
    you can try if the script will work like this:
    /usr/sbin/scsi-stop /dev/sda

Page 5 of 6 FirstFirst ... 3456 LastLast

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
  •