Page 1 of 2 12 LastLast
Results 1 to 15 of 28

Thread: Problems with hdd spindown og rc.local

  1. #1

    Problems with hdd spindown og rc.local

    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

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

  3. #3

    OK FIGURED IT!!

    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.

  4. #4
    Hmmm... Interesting. Your rc.local should work OK.

    - K.C.

  5. #5
    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?
    Last edited by roehrist; 30-12-2007 at 14:29. Reason: Additions

  6. #6
    Quote Originally Posted by roehrist View Post
    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.

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

  8. #8
    Join Date
    Jan 2007
    Location
    The Netherlands
    Posts
    244

    Some thoughts

    Quote Originally Posted by ashansen View Post
    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

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

  10. #10
    Quote Originally Posted by dalanik View Post
    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.

  11. #11
    Some time ago when I used to test if the spindown works I have had this in my crontab :

    Code:
     /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
    Code:
     /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.
    Last edited by dolphine; 16-02-2008 at 15:11.

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

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

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

  15. #15
    Join Date
    Jan 2007
    Location
    The Netherlands
    Posts
    244
    Allan,
    Quote Originally Posted by ashansen View Post
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. thttp problems after HDD standby
    By grisu901 in forum WL-HDD Q&A
    Replies: 4
    Last Post: 07-12-2007, 13:22
  2. WL550gP + external HDD problems
    By Verbal_Kint in forum WL-500gP Q&A
    Replies: 0
    Last Post: 21-03-2007, 10:01
  3. Where is the thread about HDD spindown??
    By Xander in forum WL-500gP Q&A
    Replies: 8
    Last Post: 30-01-2007, 16:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •