Everything posted by lewcass
-
Looking for better ideas how how to sleep/suspend my unraid box
I get the following softreset errors: Doesn't seem to have any functional impact though.
-
Looking for better ideas how how to sleep/suspend my unraid box
From the wiki:
-
Looking for better ideas how how to sleep/suspend my unraid box
Hard to help without knowing what is confusing you. In the wiki agw explains how to install an s3.sh script which he links to. That script works fine as intended but does not include all the features and customizations we have been talking about and adding recently. If you want to take advantage of those new features then install ReneV's latest s3_notHrHdTcpIp.sh script in the same manner described in the wiki. But be sure to use a text editor to edit the configurable options in the script to suit your needs before running it. [Edit: You also will need to install bwm-ng.] Eventually someone will update the wiki to incorporate the new script and its features. Meanwhile, if you have specific questions just ask them.
-
Looking for better ideas how how to sleep/suspend my unraid box
Also makes a fine lesson in scripting / structured coding for a novice to learn from. Thanks for putting in the time and effort to make this professional grade.
-
Looking for better ideas how how to sleep/suspend my unraid box
OK. Agreed. If you can script to do that without bwm-ng, it would make sense to do it in the simplest manner.
-
Looking for better ideas how how to sleep/suspend my unraid box
There either was some network activity in the past 30 minutes, or there was no network activity in the past 30 minutes. These are the only two things you care about, aren't they? Actually, I just care about whether there is network activity at the time I check. bwm-ng is supposed to average over 30 seconds, not thirty minutes. I am not knowledgeable enough about networking to be certain this is necessary. But it seemed to me that it would be possible to check at one moment and get "0.00" when there was actually still ongoing activity, while averaging, if only for a few seconds would greatly reduce the possibility of a false reading.
-
Looking for better ideas how how to sleep/suspend my unraid box
Actually, with no one offering any other solution when I asked, I (knowing next to nothing about linux) just did the best I could on my own. Though I did intentionally set the bwm-ng parameter to avg, because I do think it makes more sense than taking just one momentary reading.
-
Looking for better ideas how how to sleep/suspend my unraid box
See this post by WeeboTech. (Search ) [edit] Deleted download link. One already in WeeboTech post. [/edit]
-
Looking for better ideas how how to sleep/suspend my unraid box
Very nice. Thanks. Makes an excellent lesson for me to study.
-
Looking for better ideas how how to sleep/suspend my unraid box
The point of this modification is to prevent S3 sleep while there is traffic on the ethernet controller. This addresses a problem I was having with my unRAID box going to sleep while I was using it to play music via my WDTV media player. I believe this occurred because the RAM buffer was large enough to offload and store all of the music remaining in the playlist thus allowing a time interval sufficient for the drives to spin down and for the S3.SH script to initiate sleep, even though the box was still serving music to the client. Another practical benefit would be to prevent sleep while connected to unRAID for maintenance with telnet or web interface (Menu or unMenu). I have been testing this script and it appears to work as intended. i.e., My unRAID box has not gone to sleep in the middle of music playlists which were previously problematic, though it does sleep as intended after drives spin down and network traffic ceases. This version of the s3.sh script is based on the most recent enhancement by ReneV and its predecessors. It requires the installation of the bwm-ng bandwidth monitor package. bwm-ng can be installed via unMenu or the go script. #!/bin/bash flash=/dev/`ls -l /dev/disk/by-label| grep UNRAID | cut -d"/" -f3 | cut -c 1-3` timeout=5 count=5 while [ 1 ] do awake=$((for d in $(ls /dev/sd? | grep -v $flash); do hdparm -C $d | grep active ; done) | wc -l) if [ $awake -eq 0 ] then count=$[$count-1] else count=$timeout fi #Check traffic on eth0 using bwm-ng traffic=$(bwm-ng -o csv -c 1 -d 0 -T avg | grep eth0 | cut -d";" -f5) if [ $count -le 0 -a $traffic = '0.00' ] then # Do pre-sleep activities sleep 5 # Go to sleep echo 3 > /proc/acpi/sleep # Do post-sleep activities # Force NIC to use gigabit networking ethtool -s eth0 speed 1000 # Force a DHCP renewal (shouldn't be used for static-ip boxes) # /sbin/dhcpcd -n sleep 5 count=$timeout fi # Wait a minute # echo COUNT $count sleep 60 done
-
Looking for better ideas how how to sleep/suspend my unraid box
I found another variable that may affect some network controllers' ability to negotiate 1000Mbps speed. My setup had been consistently negotiating a Gbit connection without any problem until the other day. Then, apparently out of the blue, it became sporadic - settling for 100Mbps much of the time. I tried various things and nothing seemed to help. Then looking at my motherboard's manual I noticed that the PCIe network controller shared an interrupt with one of my 4 USB controllers and not with the other 3. It was then that I realized that the problem with negotiating 1000Mbps began when I moved my USB flash drive to a different USB port. Sure enough that port was on the USB controller that shared the interrupt with the network controller. Once I moved the flash drive back to a port on a controller that did not share the interrupt with the network controller, all was well again!
-
Looking for better ideas how how to sleep/suspend my unraid box
I think I worked out a solution to my problem. Need to do some testing to be sure. I'm using bwm-ng to check for absence of network traffic before sleeping. Here is code as inserted into ReneV's script. #Check traffic on eth0 using bwm-ng traffic=$(bwm-ng -o csv -c 1 -d 0 -T avg | grep eth0 | cut -d";" -f5) if [ $count -le 0 ] AND [$traffic -eq 0] then # Do pre-sleep activities If it works it will be a testament to my ability to figure out how to do this scripting on my own with no previous experience. If it doesn't work I believe I am at least closing in on the solution. [Edit] Whoops. Had to fix the syntax errors first: if [ $count -le 0 -a $traffic = '0.00' ] Shows how much I don't know! Tested the logic. Now to test the script in operation... [/Edit]
-
Looking for better ideas how how to sleep/suspend my unraid box
Seems to be an elegant concept. Agree that "perfection" would require code to automatically identify and exclude the flash drive. (And - in my own case - check for absence of network traffic before sleeping.)
-
Looking for better ideas how how to sleep/suspend my unraid box
Sorry. You guys are far... far ahead of me when it comes to Linux, which is to say that I don't know enough about Linux to write a competent script on my own. Rereading Guzzi's post and looking at the S3.SH script that I am using from awg's wiki, I now understand that Guzzi is refering to modifications he made on his script to check whether his HTPCs were on, and not to the basic script I am using. So Guzzi, if you would be kind enough to share your code I would like to give it a try. [edit]If all the added code does is ping the client for a response, I don't think it will help with the WDTV, because the WDTV does not power off completely. It only "soft-offs" so the network controller remains on. You can even telnet and FTP to it while it's in the "off" state.[/edit] And, WeeboTech, if you could illustrate how to incorporate your idea into the script I would also appreciate it. Though, please note, I am using NFS shares not smb, so maybe it wouldn't help in my case. My apologies for being at the beginning of the learning curve on this stuff and relatively useless at helping myself. Any help would be appreciated.
-
Looking for better ideas how how to sleep/suspend my unraid box
Yes. I understand the script checks if all disks are spun down. In my case, unRAID disks have all spun down, though there is still music qued in the RAM cache and being transmitted to my media player at the time the unRAID box goes to sleep. I'm not entirely clear if what you are stating relates to my situation... I don't have an HTPC. I am using a WDTV as my media player (though essentially that amounts to a Linux "PC"). If I understand correctly, you are saying that your script is already checking with pings to determine if any device is receiving traffic from the unRAID server? If so, then there appears to be a problem in my case. Thanks for any clarification or thoughts you might add.
-
Looking for better ideas how how to sleep/suspend my unraid box
Have you guys tried upgrading to the latest unRAID beta? 4.5 beta 7 I ask because, just possibly, the latest Linux kernel may have better drivers for your network controller. I have had similar experiences with the gigabit network adapters (Marvel) on two of my motherboards not renegotiating 1000Mbps on S3 wake-up under Windows Vista. Eventually driver upgrades solved the problems. The Marvel adapter on my unRAID board was one of the troubleprone ones. It now works fine with unRAID 4.5 beta 6. Another possibility is a marginally compliant cable. I've seen that as well, with both CAT 5e and CAT 6 cables that usually worked fine at 1000Mbps from a cold boot but sometimes still prevented the network adapter from negotiating 1000Mbps on S3 wake-up. Might be worth experimenting with another cable. Now could anyone please lend a hand with my questions, three posts up?
-
Looking for better ideas how how to sleep/suspend my unraid box
I was able to get S3 sleep working on my new unRAID box quickly, thanks to agw's wiki and the info I found here. So I thought I had everything working the way I wanted... that is until I experienced a couple of incidents where unRAID went to sleep while serving music to my media player! I believe the problem is that my RAM buffer (I have 2 GB installed) is able to store more music than will play in the time period I have set before the hard drives spin down + the delay I have set in the S3.SH script. Obviously one solution is to significantly increase the time periods so that they exceed the maximum amount of "play time" the cache will hold. (Can anyone tell me approximately how much of my 2GB is dedicated to buffering?) But I suspect this would mean the server would stay awake a lot longer than would otherwise be necessary in the vast majority of circumstances. I think the optimal solution would be to modify the S3 script to check to see if there is any network activity going on before implementing the sleep state. Do you think I have diagnosed the problem correctly? Can anyone suggest how to change the script to accomplish what I describe? Thanks!
-
Pimp Your Rig
Basic Beast This is my first NAS build. Probably not exceptional, but I'm happy with it, so I'm posting this as an example of a simple but, I think, fairly high performing build for anyone just starting out to take a look at. I tend toward the frugal Yankee mindset, in that I don't want good resources to go to waste, and I also want to get as much bang for my buck as I can. So all of the hardware I used here, except for the case and hard drives, I already had on hand from a previous workstation build and I simply recycled to put to use for this unRAID NAS. I found the Antec 200 case on sale at Newegg for ~$40 including shipping + $10 for two additional fans. The case comes with 2 two-speed ( 1x140mm and 1x120mm) exhaust fans. There are cutouts for mounting two additional 120mm intake fans in the lower drive bay, and one more on the side of the case. For a budget case, I think it works out quite well for this purpose. Plenty of room for hard drives, good air-flow, etc. From a construction perspective its certainly no Lian Li but it is still well designed and put together, and fine, I think, for a server that is hiding in my basement. I went with three new relatively high priced, high quality Western Digital (WD1001FALS-00J7B1) hard drives because these are the critical "wear items" of the system. The motherboard and processor are overkill, but they do perform well. The video card is even more overkill (a power waster for this application) so I'll keep my eyes open for an inexpensive "greener" alternative. Its taken me maybe 30 hours to get everything working as I want, but I have done a bit of tweaking and enhancing. That's the nature of "rolling your own". I'm pleased with the current results. I have good performance (67Mbps reads over a gigabit network using NFS disk shares, 61Mbps with user shares) and capability to automatically go to S3 "sleep" to save power for the 80-90% of the day the box won't be utilized. The main question remaining is long term reliability, and only time will tell for that. NAS Hardware running unRAID Basic 4.5-beta6 Motherboard: Asus A8R32MVP Deluxe BIOS: 7.01 NB: ATI Crossfire Express 3200 SB: ULI M1575 Onboard SATA Controller: Silicon Image 3132 Onboard NIC: Marvel 88E8053 PCIe Gigabit LAN Controller Processor: AMD Opteron 185 @ 2.6GHz RAM: 2GB 400MHz DDR Storage: 3 X 1TB WDC_WD1001FALS-00J7B1 (read testing at 106-109 MB/s) PSU: Enermax Liberty 500w Case: Antec 200 w/ two added Cooler Master 120mm LED intake fans Video: PowerColor Radeon X1800GTO USB Drive: Generic card reader with 1GB SD card Optional Packages / Scripts Installed unMENU FEMUR S3.SH bwm-ng pci-utils Clean Powerdown (powerdown 1.02) rsync-3.04 go #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & # Start unMENU /boot/unmenu/uu & # Start FEMUR (Firefox Tool) nohup awk -W re-interval -f listen.awk >/dev/null 2>&1 & # Auto-install selected packages cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c # Enable WOL ethtool -s eth0 wol g # Execute s3.sh sleep script fromdos < /boot/custom/bin/s3.sh | at now + 1 minute LAN Client & server connected at 1000Mb/s to 3COM Gigabit network switch Media Player Western Digital WDTV-HD Firmware: WD beta 1.02.10 beta plus Zorander ext3-boot 0.9.2 mod TrendNet TU2-ETG H/W: V1.3R USB Gigabit Ethernet Adapter (AX88178 chip) Level 1 Test Info Photos: