PDA

Bekijk de volledige versie : Problems with hdd spindown og rc.local



ashansen
10-12-2007, 22:21
Hi there

I have made a rc.local file as described in the toturial.
After a reboot i can see that the watchdog is not killed.
I think that the rc.local file is not loaded or executed.

My rc.local file i placed in /shares/MYVOLUME1 with 755 rights.

I want to make my hardidsk spindown.

This is the content of my rc.local file:

#!/bin/sh

pool=`nvram get apps_pool`
share=`nvram get apps_share`
internal_hdd=/dev/ide/host2/bus0/target0/lun0/disc

if [ \! -f /tmp/rc.local.done ]; then

# Indicate we've already done this
touch /tmp/rc.local.done

#
# Mount /opt and connect in various system files
#
if [ -e /shares/${pool}/opt ]; then
mount -o bind /shares/${pool}/opt /opt

cat /proc/mounts > /opt/etc/fstab

ln -s /opt/etc/shells /tmp/shells
ln -s /opt/etc/fstab /tmp/fstab

export PATH=/opt/bin:/opt/sbin:${PATH}
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
fi

# Start utelnetd on local interface only!
/apps/bin/utelnetd -i br0 &

fi

# Sleep for a little bit to not interfere with normal system startup
# before we kill a bunch of Asus processes.
sleep 5

# The killing of watchdog is necessary
# to allow the disk to spin down (watchdog is a horribly written hack
# anyway!)
killall -q -9 watchdog

# Do the necessary steps so the internal HDD will spin down
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}

When i try to execute the commands manually it failt with the command line
mount -o remount,noatime,nodiratime /shares/${pool}

And i get this error

mount:
Cannot read /etc/fstab: No such file or directory


Can anyone help me?

Allan

emailpr
13-12-2007, 04:16
I am getting the same error.. My hard drive doesn't seem to spin down either. it is constantly on.. even though the default asus media server is switched off. (the ushare is on)

emailpr
14-12-2007, 03:50
Remove this line mount -o remount,noatime,nodiratime /shares/${pool} COMPLETELY from the rc.local file. This line gives an error because of which when it runs after rebooting, it stops at that juncture and doesn't execute anything after it. That is why even the hdd never spun down for me. Now I have removed this line and it is working great!..the hdd spins down and no errors at all.
Try this and let me know if it works.

kfurge
22-12-2007, 02:41
Hmmm... Interesting. Your rc.local should work OK.

- K.C.

roehrist
30-12-2007, 14:21
With the command line
mount -o remount,noatime,nodiratime /shares/MYVOLUME1
I've got the error, too.

I managed to create the file /etc/fstab, but in my case the error is caused by the missing file /etc/mtab.

Perhaps a little mismatch between your local system and the distributed firmware?

kfurge
05-01-2008, 02:33
Perhaps a little mismatch between your local system and the distributed firmware?

No, I'm running the same image as on the website...

- K.C.

ashansen
14-02-2008, 20:06
Hi again

Thanks for all your questions and thoughts

I have now updated the firmware again because i could se a big difference on the size og the firmware files.
Know i am running this formware: Custom ASUS 1.0.7.8 based firmware for the WL700gE
The filse size is 23.501kb.

My HD still not spindown. I cannot understand it.

Can i in anyway see if my rc.local file is loaded?
My watchdog is not killed, i kan see it with the command ps and it is indicated that is is running by " 259 root 5832 S watchdog".

Does anybody know why i can't the commandline to spin down HD manually (just for test) like typing this in the shell

killall -q -9 watchdog
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}

when i type the last two command line i got list of functions, like the commandlines need some parametres.
Do they?

Fx

[root@NetworkStorage /]$ smartctl -dT ${internal_hdd}
smartctl version 2.1 - S.M.A.R.T. Control Program
useage: smartctl -[opts] [device]
Read Only Commands:
a Show All S.M.A.R.T. Information (ATA and SCSI)
g Show General S.M.A.R.T. Attributes (ATA Only)
v Show Vendor S.M.A.R.T. Attributes (ATA Only)
l Show S.M.A.R.T. Drive Error Log (ATA Only
L Show S.M.A.R.T. Drive SelfTest Log (ATA Only)
i Show S.M.A.R.T. Drive Info (ATA and SCSI)
c Check S.M.A.R.T. Status (ATA and SCSI)

Enable / Disable Commands:
e Enable S.M.A.R.T. data collection (ATA and SCSI)
d Disable S.M.A.R.T.data collection (ATA and SCSI)
t Enable S.M.A.R.T. Automatic Offline Test (ATA On
ly)
T Disable S.M.A.R.T. Automatic Offline Test (ATA O
nly)

Test Commands:
O Execute Off-line data collectioni(ATA Only)
S Execute Short Self Test (ATA Only)
s Execute Short Self Test (Captive Mode) (ATA Only
)
X Execute Extended Self Test (ATA Only)
x Execute Extended Self Test (Captive Mode)(ATA On
ly)
A Execute Self Test Abort (ATA Only)
[root@NetworkStorage /]$


Hope anyone can help me

All the best

Allan

mumsoft
15-02-2008, 21:20
Hi again

Thanks for all your questions and thoughts

I have now updated the firmware again because i could se a big difference on the size og the firmware files.
Know i am running this formware: Custom ASUS 1.0.7.8 based firmware for the WL700gE
The filse size is 23.501kb.


You'd better tell what the name is of this firmware. But I guess you mean WL700gE_kc_1078_02.nas



My HD still not spindown. I cannot understand it.


I do. It did not work for me either. Please see:
http://wl700g.homelinux.net/drupal/?q=node/191



Can i in anyway see if my rc.local file is loaded?
My watchdog is not killed, i kan see it with the command ps and it is indicated that is is running by " 259 root 5832 S watchdog".


DropBear is one of the installed packages. With ipkg list_installed you should see it listed.
Referring to watchdog, it is not killed because it does not interfere anymore with spinning down in rel 1.0.7.8. You have this old information from the 1.0.4.6 days.



Does anybody know why i can't the commandline to spin down HD manually (just for test) like typing this in the shell

killall -q -9 watchdog
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}

when i type the last two command line i got list of functions, like the commandlines need some parametres.
Do they?


This is because ${internal_hdd} is nothing. Replace it with /dev/ide/host2/bus0/target0/lun0/disc
Replace ${pool} with MYVOLUME1
And forget about watchdog.

For more information about this firmware, to make your changes permanent, please read:
http://wl700g.homelinux.net/drupal/?q=node/134

Regards
Marc

dalanik
15-02-2008, 21:37
speaking of spindown, is there a way to check in software that the HDD has really spun (spinned?) down? (like a command or such).

D.

kfurge
16-02-2008, 02:00
speaking of spindown, is there a way to check in software that the HDD has really spun (spinned?) down? (like a command or such).

D.

I don't think so. The spindown is managed completely in the HDD itself.

- K.C.

dolphine
16-02-2008, 14:54
Some time ago when I used to test if the spindown works I have had this in my crontab :



/opt/sbin/hdparm -C /dev/ide/host2/bus0/target0/lun0/disc | grep "drive state" | /opt/bin/logger


it worked pretty fine, however until I put the logfile to ramfs the impact was that it spinned-up the drive when checking the state.

So should you need to find out the drive state just type


/opt/sbin/hdparm -C /dev/ide/host2/bus0/target0/lun0/disc | grep "drive state"


you can issue the -i parameter intstead of -C for some other info

HTH,

Vasek

PS: Not tested on 1.0.7.6 as I'm still running the "good old" KCFurge's 1.0.4.6 as I don't have time to play with the new one and can find reason to prioritize the upgrade and re-customization (as I have quite lots of customizations [syslog to ramfs, logrotate to hdd, fail2ban, etc.]) and still not sure about the multicast support that is the only thing I'm missing now.

ashansen
20-02-2008, 21:14
Hi again


Thanks for all the replies.
I the firmware i am using is WL700gE_kc_1078_02.nas
I think i am pretty close to the goal.

After i read http://wl700g.homelinux.net/drupal/?q=node/191
I created opt/etc in /shares/MYVOLUME and then copied rc.local to this destination.
After a reboot /opt and /shares/MYVOLUME/opt is the same.
And HDD spindown doesnt work yet...

Could it be because u have to move /opt ?
I i move the directory and it is wrong, i am afraid that the nas will not boot... maybe i am wrong...?



Anyone who can help me here?

All the best

Allan

ashansen
20-02-2008, 22:12
Well i have done something wrong with with the /opt directory

Wenn i telnet to tha nas i am trying to log in as root. After i enter the password i get this errormessage:

login: cannot run /opt/bin/bash: No such file or directory

Can any one help?

ashansen
20-02-2008, 22:48
Hi again

Now i have reflashed my nas again. It is still running WL700gE_kc_1078_02.nas firmware.
Now the problem with telnet login is solved.

So, should i move the /opt directory to /shares/MYVOLUME and then place rc.local there or is it another opt directory that i need to move?
I refer to to http://wl700g.homelinux.net/drupal/?q=node/191

Allan

mumsoft
21-02-2008, 09:30
Allan,

Hi again

Now i have reflashed my nas again. It is still running WL700gE_kc_1078_02.nas firmware.
Now the problem with telnet login is solved.

So, should i move the /opt directory to /shares/MYVOLUME and then place rc.local there or is it another opt directory that i need to move?
I refer to to http://wl700g.homelinux.net/drupal/?q=node/191

Allan

You should at least follow the first 4 steps in:
http://wl700g.homelinux.net/drupal/?q=node/187
and follow it with step 7 (but use a proper linux editor like joe or nano).

But if you have some time left, you'd better read it all before you start doing things.
Unfortunately the rc.local that is in /opt/etc does not do the job of spinning down the proper way, or at least in my opinion.
So that's why you must copy the whole bunch of /opt to a writable space and change a few lines in rc.local:

In the current rc.local of K.C.Furge two lines are present:
hdparm -B 164 ${internal_hdd}
hdparm -B 114 ${internal_hdd}
which I have used for many days. With these my HD never sleeps, and I think that is the sole purpose. I think that two lines of the same kind are also overkill.
So I replaced them with what I had before:
hdparm -S 60 ${internal_hdd}
And now my hard disk sleeps after a while.

I would appreciate it when K.C.Furge has his saying on this matter, and eventually changes this in the firmware.

Marc

kfurge
23-02-2008, 04:28
Unfortunately the rc.local that is in /opt/etc does not do the job of spinning down the proper way, or at least in my opinion.

I would appreciate it when K.C.Furge has his saying on this matter, and eventually changes this in the firmware.



The method in my rc.local is correct but significantly different than yours. You're configuring a very straight-forward spin down. I elected to do the HDD power management a little more elaborately knowing that the HDD would be spinning up/down on a very regular basis.

The two hdparm commands together configure the HDD to enter a low power mode after 5 minutes followed by an even lower power mode after 60 minutes. Details of these commands, and the timing formulas, can be found in the HDD datasheet from Toshiba. I've also posted a long winded explanation containing the formulas somewhere on this forum already.

One reason you might have thought that the HDD spin down was not working was because nether of these modes completely spin down the HDD. Rather they're low (and lower) RPM modes with no servo lock on the spindle or heads which significantly reduce HDD power consumption. In contrast to a full spin-down, I believe spinning up from a low RPM mode to be less stressful on the HDD over the long term.

I'll admit that the 60 minute timeout programmed by the second hdparm command is somewhat long, and there are a number of programs that annoyingly touch the HDD within that hour long window if not properly configured, but I did not want the HDD in my box constantly spinning up and down 24/7. Rather, I only wanted it to spin down when truly idle.

- K.C.

mumsoft
23-02-2008, 16:15
The method in my rc.local is correct but significantly different than yours. You're configuring a very straight-forward spin down. I elected to do the HDD power management a little more elaborately knowing that the HDD would be spinning up/down on a very regular basis.
[cut]
- K.C.

Very informative, thanks. I noticed that my HDD (with my settings) spins down, but also that it spins up after a while, maybe after an hour. With the old 1.0.4.6. firmware and the same instructions it really spun down 'forever'. I have both mt-daapd and Twonky running, and both are told to not update anything if not asked to do so. So I think now something else must sweep its tail now and then.
I guess we will find out some time.
Again, thanks for your long answer.
According to
http://wl500g.info/showpost.php?p=45110&postcount=5
the Asus consumes about 5 watts to let the HDD spin. Now I'm curious how much power is saved with your settings. Do you know that?

Marc

ashansen
23-02-2008, 19:12
yup, i am back again :)

when i try to copy /opt to /shares/MYVOLUME (logged in as root via ordinary windows telnet session) with the command "cd /; tar cf - opt" then it runs/creates this ar archive... i supose.... When i stop running i never get the shell or command line for furhter command...

Then i have tried to make another telnet session to the nas box for extracting the tar archive - using this command: cd /shares/MYVOLUME1; tar xf -
Then i just get an "extra" line to write on... I cannot exit it again...

Is there something i completely misunderstood?
I'll hope you all can help me...

Tanks

Allan

ashansen
23-02-2008, 19:15
i forgot to write, that i also have tried to log in as admin and copy /opt. But this user dont have permission to do so...

mumsoft
23-02-2008, 20:02
yup, i am back again :)
[cut]
Allan

I see... :eek:
why don you just cut & paste this:
(cd /; tar cf - opt) | (cd /shares/MYVOLUME1; tar xf -)
as listed.
So including everything including ( ) and all in one go. And yes, being root.
You might also login as admin, and then do:
sudo bash -l
(again, copy & paste it). This will make you root.

Marc

ashansen
23-02-2008, 21:16
Great :)
Now it all works.

Thanks far all your help - specially you, Marc

All the best

Allan

kfurge
25-02-2008, 00:41
the Asus consumes about 5 watts to let the HDD spin. Now I'm curious how much power is saved with your settings. Do you know that?


They're virtually the same.

- K.C.

pooz
27-01-2009, 22:33
Hi,

so ashansen followed the way mumsoft suggested. But how can I get working the way kfurge suggests?

My drive is not spinning down.
I am running 1.0.7.8 (Not sure, which exact version, I guess the latest. I bought it from a friend. Is there a way to find it out?)

I would be very thankful for any help. I am a linux n0^2b.
pooz

mumsoft
28-01-2009, 14:42
Hi,

so ashansen followed the way mumsoft suggested. But how can I get working the way kfurge suggests?

My drive is not spinning down.
I am running 1.0.7.8 (Not sure, which exact version, I guess the latest. I bought it from a friend. Is there a way to find it out?)

I would be very thankful for any help. I am a linux n0^2b.
pooz
Hi Pooz,
In the web interface you can find what version it is running, but not whether this is a KFurge modified version or not.
You can however try to telnet to the Asus, and once logged in, see if /opt is there (cd /opt) or not. If it is, goto etc (cd etc), being there, check if there is a rc.local (ls rc.local). This is the rc.local that the kfurge version uses.
In this rc.local you will find the spindown settings, either those from KFurge, or modified versions from someone else. The KFurge settings won't actually spin down the HD.
Another way to tell if you have the latest KFurge version is rebooting the Asus, and see whether the powerled blinks three times after several minutes. At this point you can press the copy button until the blinking stops, and so prevent the rc.local from executing (only in case of problems). If you don't touch anything, the rc.local will be executed.

Good luck,
Marc

pooz
28-01-2009, 14:55
Hi Marc,

thanks for your help.

You can however try to telnet to the Asus
Due to I am new and did not find a beginners FAQ with step-by-step tuts, like telnet to my router, I wouldlike to ask, how this is done to my wl700ge?


In this rc.local you will find the spindown settings, either those from KFurge, or modified versions from someone else. The KFurge settings won't actually spin down the HD.
Did I get it right, that kfurges settings only does a kind of "lowering the rpm" of the drive, instead of a complete spin down. (like he mentioned here (http://wl500g.info/showpost.php?p=84379&postcount=16)), while other setting do a complete powering off of the HDD?
I donīt know, which might be better/less harm to the drive.

Thanks again, for any help!
pooz

mumsoft
28-01-2009, 15:05
Hi Marc,

thanks for your help.

Due to I am new and did not find a beginners FAQ with step-by-step tuts, like telnet to my router, I wouldlike to ask, how this is done to my wl700ge?


Did I get it right, that kfurges settings only does a kind of "lowering the rpm" of the drive, instead of a complete spin down. (like he mentioned here (http://wl500g.info/showpost.php?p=84379&postcount=16)), while other setting do a complete powering off of the HDD?
I donīt know, which might be better/less harm to the drive.

Thanks again, for any help!
pooz
Telnet:
telnet asus
or:
telnet <ip-address>
you can login with root or as yourself. You should know the password though.

In my situation, with the WLAN off most of the time, the HD is powered off for days. I have written/modified some radio script to be able to press the copy button and switch wlan on and off.
So I use my own version of the spindown routine.

Look around for what the kfurge version does.
Look here:
http://wl700g.homelinux.net/drupal/node/134

pooz
28-01-2009, 22:45
Thanks for your help!

let me ask one beginners q, please :o
When logging in via "telnet <ip>", I can only log in with username "root" and then surprisingly no passwort is required. is this correct? My login data via Web-IF doesnīt work.

Is logging via ssh better? but doing "ssh <ip>" or "ssh root@<ip>" doesnt work either.

Anyway: the rc.local file is there! I was able to read it via "nano". But how can I check, if I got the latest version "02" instead of "01" ?

greetings

mumsoft
29-01-2009, 22:01
Thanks for your help!

let me ask one beginners q, please :o
When logging in via "telnet <ip>", I can only log in with username "root" and then surprisingly no passwort is required. is this correct? My login data via Web-IF doesnīt work.

Is logging via ssh better? but doing "ssh <ip>" or "ssh root@<ip>" doesnt work either.

Anyway: the rc.local file is there! I was able to read it via "nano". But how can I check, if I got the latest version "02" instead of "01" ?

greetings
As said, version 2 waits in the boot process and blinks the ready (sorry, i said power) button 3 times.
It's a long time ago i saw the same login stuff that you have. Did you study the guide from the link I gave you?
I think ssh is better, and it should work. But, telnet in a local network at home isn't really dangerous.

You could do no harm if you install 02 yourself, if you're still not sure.
But you should really study the guide FIRST.

Marc