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?
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
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.
Hi,
is possible to use this for wl-500gx too?
But I will wait for tutorial to beginners
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
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.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:cd /usr/local/sbin wget http://oleg.wl500g.info/bin/scsi-stop chmod a+x scsi-stop
If your disk continues to spin then scsi-stop most likely doesn't support your ide->usb (or sata->usb) box.Code:/usr/local/sbin/scsi-stop /dev/scsi/host0/bus0/target0/lun0/disc
Please, post your results and your hardware here. Let other people know whether it is supported or not. And please add the output of
and search for corresponding VendorID&ProductID in the output ofCode:cat /proc/scsi/usb-storage-0/0
3. If you were successful you maybe would want to use my script for automatic spindown:Code:cat /proc/bus/usb/devices
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.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
Do:
To run script in background do, for example:Code:cd /usr/local/sbin cat > scsi-stop.sh <copy and paste the script> <press Ctrl-C> chmod a+x scsi-stop.sh
Notice that the script writes some log messages to /tmp/scsi-stop.log .Code:./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &
4. Don't forget to do
to save all the things in the router's flash.Code:flashfs save flashfs commit flashfs enable
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:
From /proc/bus/usb/devices: Vendor=04fc ProdID=0c15 Rev=c6.83Host 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
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:
3.Host scsi0: usb-storage
Vendor: Cypress Semiconductor
Product: USB2.0 Storage Device
Serial Number: DEF10C9308EE
Protocol: Transparent SCSI
Transport: Bulk
GUID: 04b468300000def10c9308ee
Attached: Yes
HDD: WD1600SD
Box: Vizo Luxon
Bridge vendor: JMicron
cat /proc/scsi/usb-storage-0/0:
4.Host scsi0: usb-storage
Vendor: JMicron
Product: JM20338 SATA, USB Combo
Serial Number: 8D88CA892915
Protocol: Transparent SCSI
Transport: Bulk
GUID: 152d233800008d88ca892915
HDD: WD400VE
Box: Sarotech Cutie OTG FHD-254UM
cat /proc/scsi/usb-storage-0/0:
I think this box has actually this chip:Host scsi3: usb-storage
Vendor: Unknown
Product: USB 2.0 Storage Device
Serial Number: 00000000000123456789
Protocol: Transparent SCSI
Transport: Bulk
GUID: 040256370000000123456789
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.
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
From cat /proc/bus/usb/devices : Vendor=067b ProdID=2507 Rev= 1.00Code:Host scsi0: usb-storage Vendor: Prolific Technology Inc. Product: Mass Storage Device Serial Number: 0 Protocol: Transparent SCSI Transport: Bulk GUID: 067b25070000000000000000 Attached: Yes
I was actually surprised that such a cheap/generic HDD box would support HDD idling!
Thanks,
Matt
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.
I'm a little confused. I created the scsi-stop.sh script and executed the command.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?Code:./scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc &
And how do I spin the drive up again? Or does a user just have to try accessing a directory via SAMBA?
Thanks.
when SAMBA is running, the box can not spin down.
I would really like to spin down my HDD when it is inactive for 20 minutes. When I try, I get this error:PHP Code:
/usr/local/sbin/scsi-stop /dev/scsi/host0/bus0/target0/lun
0/disc
Am I doing something wrong, or does it just not work with my HDD. If it doesn't work, are there any other options?PHP Code:
/dev/scsi/host0/bus0/target0/lun0/disc is not a SCSI block device
I'm using two 1tb discs in RAID1 (using mdadm) and mounted as md0
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:$ 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]
the discs:Code:scsi-stop.sh /dev/scsi/host0/bus0/target0/lun0/disc scsi-stop.sh /dev/scsi/host1/bus0/target0/lun0/disc
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.
I have the same problem, can anybody help?
PHP Code:
Host scsi0: usb-storage
Vendor: Sunplus Technology Inc.
Product: USB to Serial-ATA bridge
Serial Number: SAMSUNG HDS1Y6J1LS806829
Protocol: Transparent SCSI
Transport: Bulk
GUID: 04fc0c25315ffffffffffff9
Attached: Yes
Port: 1
Bus: 01:03.2-1
WORKING!
Thnks But i'm not understand HowTo find VendorID&ProductID, there is a lot of codeCode: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
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.