Results 1 to 15 of 83

Thread: Firmware to spin-down HDD?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt a.M.
    Posts
    299
    hi Xander,

    great that you managed it!!!

    I'm using your script and it works really nice.

    Can you write a complete HOW-TO for the beginners?
    WL-500gP => 1.9.2.7-7g (2007-04-06)
    Running: thttpd, php 5.1, vsftp, rrdtool

    http://onlinefussballmanager.de/userbar/0/53647.png

  2. #2
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    170
    Quote Originally Posted by britnet View Post
    hi Xander,

    great that you managed it!!!

    I'm using your script and it works really nice.

    Can you write a complete HOW-TO for the beginners?
    Well, Ok, I'll write it soon. I must tell everybody that this binary is not working with several hard drives. This was reported in the similar topic in the Russian forum.
    Oleg said also that this tool is a part of scsi-idle package, so you can compile it yourself. Just grab sources here: http://lost-habit.com/scsi.html
    Last edited by Xander; 22-01-2007 at 15:14.

  3. #3
    Hi,
    is possible to use this for wl-500gx too?
    But I will wait for tutorial to beginners

  4. #4
    HI Xander
    something new about the tutorial of spining-down disc?
    Can you write here which kind of disc isn't suported?(My knowledges of Russia language are nothing )

    THX very much

  5. #5
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    170
    Tutorial.

    If you want to spindown your external HDD, scsi-stop tool may help you. This tool is a part of scsi-idle package. If you don't want to build the tool from sources, just use the first link to get a prebuilt binary provided by Oleg.

    Since you want to spindown your disk it is not very sensible to place the binary on it. So the appropriate place is the router's flash.

    Steps:
    1.
    Code:
    cd /usr/local/sbin
    wget http://oleg.wl500g.info/bin/scsi-stop
    chmod a+x scsi-stop
    2. Now you can test your disk for compatibility. Please, ensure your login shell is /bin/sh and you run scsi-stop in it. cat /etc/passwd will help you to find out.
    Code:
    /usr/local/sbin/scsi-stop /dev/scsi/host0/bus0/target0/lun0/disc
    If your disk continues to spin then scsi-stop most likely doesn't support your ide->usb (or sata->usb) box.
    Please, post your results and your hardware here. Let other people know whether it is supported or not. And please add the output of
    Code:
    cat /proc/scsi/usb-storage-0/0
    and search for corresponding VendorID&ProductID in the output of
    Code:
    cat /proc/bus/usb/devices
    3. If you were successful you maybe would want to use my script for automatic spindown:
    Code:
    #!/bin/sh
    if /usr/bin/[ $# -ne 1 ]; then
            /bin/echo 1>&2 "Usage: $0 <device>"
            exit 1
    fi
    
    PERIOD=30
    BOUNDARY=1200
    SCSISTOP=/usr/local/sbin/scsi-stop
    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 /bin/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
                            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
    You can change "period" and "boundary" variables. They are in seconds. With the current settings script will wake up every 30 seconds to gather information and after 20 minutes of inactivity it will stop disk.
    Do:
    Code:
    cd /usr/local/sbin
    cat > scsi-stop.sh
    <copy and paste the script>
    <press Ctrl-C>
    chmod a+x scsi-stop.sh
    To run script in background do, for example:
    Code:
    ./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &
    Notice that the script writes some log messages to /tmp/scsi-stop.log .

    4. Don't forget to do
    Code:
    flashfs save
    flashfs commit
    flashfs enable
    to save all the things in the router's flash.

    The most important: Hardware Compatibility List.
    Working:

    1.
    HDD: Samsung SP2504C (sata)
    Box: Vantec NexStar3 NST-360SU-BK
    Bridge vendor: Sunplus Technology Inc.
    cat /proc/scsi/usb-storage-0/0:
    Host scsi0: usb-storage
    Vendor: Sunplus Technology Inc.
    Product: USB to Serial-ATA bridge
    Serial Number: SAMSUNG SPS09QJ1NL805434
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 04fc0c15317ffffffffffff9
    Attached: Yes
    From /proc/bus/usb/devices: Vendor=04fc ProdID=0c15 Rev=c6.83

    Not working:

    1.
    HDD: Seagate Barracuda 7200.9 (ide)
    Bridge vendor: Cypress Semiconductor
    Bridge chip: CY7C68300A-56PVC

    2.
    Bridge vendor: Cypress Semiconductor
    cat /proc/scsi/usb-storage-0/0:
    Host scsi0: usb-storage
    Vendor: Cypress Semiconductor
    Product: USB2.0 Storage Device
    Serial Number: DEF10C9308EE
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 04b468300000def10c9308ee
    Attached: Yes
    3.
    HDD: WD1600SD
    Box: Vizo Luxon
    Bridge vendor: JMicron
    cat /proc/scsi/usb-storage-0/0:
    Host scsi0: usb-storage
    Vendor: JMicron
    Product: JM20338 SATA, USB Combo
    Serial Number: 8D88CA892915
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 152d233800008d88ca892915
    4.
    HDD: WD400VE
    Box: Sarotech Cutie OTG FHD-254UM
    cat /proc/scsi/usb-storage-0/0:
    Host scsi3: usb-storage
    Vendor: Unknown
    Product: USB 2.0 Storage Device
    Serial Number: 00000000000123456789
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 040256370000000123456789
    I think this box has actually this chip:
    Vendor: ALi Corp.
    Product: M5637 IDE Controller

    Update:
    I tried to summarize all the gathered information in this post:
    http://wl500g.info/showpost.php?p=52360&postcount=20
    I'll keep it up to date.
    Last edited by Xander; 10-06-2007 at 16:12.

  6. #6

    Working: Ritmo CE-3515 with Seagate 320Gb IDE HDD

    Hi All,

    Xander, thanks for the great tutorial! Worked perfectly. My results:

    Working
    HDD: Seagate 320Gb IDE
    Box: Ritmo CE-3515 (generic 3.5in IDE enclosure, @ $25 AUD)

    cat /proc/scsi/usb-storage-0/0
    Code:
       Host scsi0: usb-storage
           Vendor: Prolific Technology Inc.
          Product: Mass Storage Device
    Serial Number: 0
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 067b25070000000000000000
         Attached: Yes
    From cat /proc/bus/usb/devices : Vendor=067b ProdID=2507 Rev= 1.00

    I was actually surprised that such a cheap/generic HDD box would support HDD idling!

    Thanks,
    Matt

  7. #7
    Join Date
    Apr 2006
    Location
    Heesch, Netherlands
    Posts
    118
    As stated; my box doesn't work.
    Inside a Hitachi Travelstar, which might be spindown by itself, according to another topic...

    Box: 2,5 inch, Sweex
    Host scsi2: usb-storage
    Vendor: Unknown
    Product: Cypress AT2LP RC7
    Serial Number: DEF10BBF4198
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 04b468300000def10bbf4198
    Attached: Yes

    My 3,5 inch box doesn't work either:

    Host scsi1: usb-storage
    Vendor: Genesyslogic
    Product: USB Mass Storage Device
    Serial Number: 001300014118
    Protocol: Transparent SCSI
    Transport: Bulk
    GUID: 05e307020000001300014118
    Attached: Yes
    Last edited by mistraller; 14-02-2007 at 21:53.

  8. #8
    Quote Originally Posted by Xander View Post
    Tutorial.

    3. If you were successful you maybe would want to use my script for automatic spindown:
    Code:
    PERIOD=30
    BOUNDARY=1200
    SCSISTOP=/usr/local/sbin/scsi-stop
    LOGFILE=/tmp/scsi-stop.log
    Do:
    Code:
    cd /usr/local/sbin
    cat > scsi-stop.sh
    <copy and paste the script>
    <press Ctrl-C>
    chmod a+x scsi-stop.sh
    To run script in background do, for example:
    Code:
    ./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &
    I'm a little confused. I created the scsi-stop.sh script and executed the command.
    Code:
    ./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &
    Now, how do I ensure this works properly after rebooting? Should I place this line:
    Code:
    ./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &
    into my post-boot file?

    And how do I spin the drive up again? Or does a user just have to try accessing a directory via SAMBA?

    Thanks.

  9. #9
    when SAMBA is running, the box can not spin down.

  10. #10
    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?

  11. #11

    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.

  12. #12

    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-

  13. #13

    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.

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
  •