Page 1 of 6 123 ... LastLast
Results 1 to 15 of 83

Thread: Firmware to spin-down HDD?

  1. #1

    Firmware to spin-down HDD?

    After days of messing, i've finally got my WL-500gP doing pretty much what I want. However, the one remaining annoyance is that the USB hard drive won't spin down, and to remove it I need to login to the web interface just to say "eject"... which isn't particularly helpful.

    So, i'm looking for a new firmware with that implemented. I'm currently using the standard Asus FW and happy enough with that - i need to keep the ability for it to operate as a router (share the WAN connection with several wifi devices), to share a printer, to share a hard drive, and for a wired network device to be on the network too. Other than that, i'll happily lose all the other features.

    Are there any firmwares out there that can do that, and that are suitable for a linux-novice (i've played a teeny bit with Linux, and can get a friend to explain bits of it over the phone, but not experienced myself).

    I have read around this and other forums about the problem, and it does seem to be possible, but I can't do anything with the standard firmware, and the most common Oleg one doesn't seem to include sharing the USB drive. Also, I only have a laptop so can't directly connect the drive to an IDE interface to change the HDPARAM settings.

    Any suggestions very gratefully received!

    David

  2. #2
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    170
    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.
    Last edited by Xander; 30-01-2007 at 10:38.

  3. #3
    Thanks a lot for that.

    Is it possible to do that on the standard firmware, or will I need Oleg's (or similar) to do it? I'm a little apprehensive to put the Oleg firmware on as the documentation suggests it doesn't support the USB hard drives.

    I noticed I couldn't telnet into the box with the standard firmware, how would I go about putting that file on it, and your script?

    Cheers

    David

  4. #4
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    170
    Quote Originally Posted by scuby View Post
    Thanks a lot for that.

    Is it possible to do that on the standard firmware, or will I need Oleg's (or similar) to do it? I'm a little apprehensive to put the Oleg firmware on as the documentation suggests it doesn't support the USB hard drives.
    Well, this is definitely untrue.
    Quote Originally Posted by scuby View Post
    I noticed I couldn't telnet into the box with the standard firmware, how would I go about putting that file on it, and your script?

    Cheers

    David
    I don't know whether my solution can work with standard firmware. I really don't think so. I recommend you to replace it.
    I didn't said that the most appropriate place for scsi-stop and scsi-stop.sh is in the router's flash so you should place it somewhere in /usr/local and then do:
    Code:
    flashfs save
    flashfs commit
    flashfs enable
    I don't think that this feature is implemented in the Asus firmware.
    Last edited by Xander; 07-01-2007 at 19:41.

  5. #5
    I am impressed that someone finally managed to find a way to spin down HDDs. I understand that Oleg was the hero (again).
    Because I did not know of this solution at the time, I have bought an Western Digital MyBook Essential 250GB. This drive spins down by itself.

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

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

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

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

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

  11. #11

    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

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

  13. #13
    NOT WORKING

    HDD: Seagate momentus 5400.3 80Gb IDE 2.5"
    Box: welland 2.5" ME-940 USB

    cat /proc/scsi/usb-storage-1/1
    Code:
    Host scsi1: usb-storage
    Vendor: Myson Century, Inc.
    Product: USB Mass Storage Device
    Serial Number: 100
    Protocol: 8070i
    Transport: Bulk
    GUID: 04cf88180000000000000100
    Attached: Yes



    Thanks,
    greengreen

  14. #14
    Not working:

    Code:
    HDD: 
           Vendor: WDC WD13  
            Model: 6AA               
              Rev: 05.0
    
    BOX: 
      Vendor=04cf ProdID=8818 Rev=b0.08
    
       Host scsi0: usb-storage
           Vendor: Myson Century, Inc.
          Product: USB Mass Storage Device
    Serial Number: 100
         Protocol: 8070i
        Transport: Bulk
             GUID: 04cf88180000000000000100
         Attached: Yes

  15. #15
    WORKING

    Code:
    HDD: 
           Vendor: SAMSUNG
            Model: SP2014N               
              Rev: VC10
    
    BOX: ICY BOX IB-350U
      Vendor=0000 ProdID=0000 Rev=0.00
    
       Host scsi0: usb-storage
           Vendor: Unknown
          Product: Unknown
    Serial Number: 11D2
         Protocol: Transparent SCSI
        Transport: Bulk
             GUID: 0000000000000000000011d2
         Attached: Yes

Page 1 of 6 123 ... 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
  •