Results 1 to 8 of 8

Thread: Router is not responding on restart with usb drive

  1. #1

    Router is not responding on restart with usb drive

    Hi,
    My router stops responding after a reboot. The activity lights are still on but I cant connect to ssh/telnet, even the setup page won't load.

    This only happens if the external usb drive is plugged in.
    If I remove the usb drive then replug the router, It works properly.

    I can only use the router + usb drive again if I remove the swap and opt partition then reinstall all the packages from the start.

    When i plug the same usb drive on my ubuntu computer the drive is working properly.

    I'm running wl500g premium on oleg + wdc 500gb essentials.
    This setup is working properly before.

    Need help Thanks.

  2. #2
    Hi,

    Could you post your post-boot script here..
    Maybe it waits and waits for the mounting of the drive,
    (I have the exact same drive and never had problems with it.)

  3. #3

    I have a feeling thats it.

    Im using the posted post-boot on wengi's guide .
    modified to use with usb hdd and a fourth partition.

    I'm thinking that this problem started after I've added the mount for a fourth partition.

    something like

    mount /dev/discs/disc0/part3 /mnt
    mount /dev/discs/disc0/part4 /tmp/harddisk

    btw: is it ok to mount at /mnt?

    I cant post the exact post-boot file now because I'm at work now and accessing ssh remotely. Ive issued a reboot then I can't access ssh anymore.

    I'll post the post-boot file later when i got home.

    Thanks much, at least I have a new lead now on what is causing this problem.

  4. #4
    Quote Originally Posted by before View Post

    btw: is it ok to mount at /mnt?
    Yep, that's ok, I've mounted my data partition to /mnt also.

    What you can do is this.

    disable the post-boot file (flush al it's contents except the dropbear command), flash/reboot,
    login,

    and then start entering the commands which were in the post-boot file manually in the console, This should give you a lead, which commands work, and which don't/give you an error.


    One last question... (and I have a feeling this is it, )
    is your post-boot script executable ? Because you're telling me that after a reboot you cannot login with SSH (and the post-boot starts the dropbear which is needed for SSH). otherwise, chmod +x your post-boot, and don't forget to flash/reboot after this.
    If this is the case you still should be able to login using telnet, not ssh.


    HTH

  5. #5

    Almost there

    Thanks, I'm getting a lot of progress here. Just a little more...

    I've modified post-boot to just

    Code:
    #!/bin/sh
    # Start SSH service
    dropbear
    And issued the commands one line at a time.

    I'm having errors on.
    Code:
    mount /dev/discs/disc0/part4 /tmp/harddisk
    As there is no /tmp/harddisk on reboot. (is that normal?, there was before.)

    Everything works now and I can even reboot properly, except i need to run the commands again manually.


    Some more clues,

    here are my old post-boot:

    Code:
    #!/bin/sh
    # Start SSH service
    dropbear
    
    # test if USB disc has been attached
    # if not - then insert needed modules
    if [ ! -d /dev/discs ]
        then
    insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
        fi
    
    # Wait for /opt to mount
    mount /dev/discs/disc0/part2 /opt
    mount /dev/discs/disc0/part3 /mnt
    mount /dev/discs/disc0/part4 /tmp/harddisk
    
        i=0
    while [ $i -le 30 ]
        do
    if [ -d /opt/etc ]
        then
        break
        fi
    sleep 1
    i=`expr $i + 1`
        done
    
    # Activate swap
    swapon /dev/discs/disc0/part1
    
    #to let midnight commander run on terminals, make alias for colored mc
    echo "export TERMINFO=/opt/share/terminfo">>/etc/profile
    echo "alias mc=\"mc -c\"">>/etc/profile
    
    # Run all active services - active means starts with S
    /opt/etc/init.d/rc.unslung
    Using my old post-boot, when I reboot the router with the usb-hdd plugged-in and try to connect to ssh quickly, I can manage to enter my username and password then issue at least one command before the router stops responding.
    Also using the old post-boot, when i reboot with no usb-hdd plugged in, the operation is normal (except for the missing packages), then I'll plug the usb-hdd. When the usb-hdd starts spinning thats when the router then stops responding.
    This also happens, even if the /opt partition is empty.

    I think there is something in the issued commands on my old post-boot that does that. As it doesn't happens now when using the post-boot with dropbear only.

    Another question:
    Does the usb-hdd auto mounts to the router?
    I'm thinking thats where the router stops responding when i'm using the old post-boot.


    Thanks ^^

  6. #6
    Hi,

    in your old post-boot file, part 3, 4 aren't mounted properly., you should place them outside the mountig of /opt

    mount them after you've activated the swap.

    so cut the lines
    Code:
    mount /dev/discs/disc0/part3 /mnt
    mount /dev/discs/disc0/part4 /tmp/harddisk
    and paste them under
    Code:
    # Activate swap
    swapon /dev/discs/disc0/part1

    so I took your old post-boot file and modified it to something that should work in your situation

    Code:
    #!/bin/sh
    dropbear
    # test if USB disc has been attached
    # if not - then insert needed modules
    #
    # uncoment the following 4 lines if using an USB HDD.
    if [ ! -d /dev/discs ]
    then
    insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
    fi
    
    #Wait for /opt to mount
    mount /dev/discs/disc0/part2 /opt
    i=0
    while [ $i -le 30 ]
    do
    if [ -d /opt/etc ]
    then
    break
    fi
    sleep 1
    i=`expr $i + 1`
    done
    
    # Activate swap
    swapon /dev/discs/disc0/part1
    
    
    #mount /data shares
    mount /dev/discs/disc0/part3 /mnt
    mount /dev/discs/disc0/part4 /tmp/harddisk
    
    #to let midnight commander run on terminals, make alias for colored mc
    echo "export TERMINFO=/opt/share/terminfo">>/etc/profile
    echo "alias mc=\"mc -c\"">>/etc/profile
    
    # Run all active services - active means starts with S
    /opt/etc/init.d/rc.unslung

  7. #7

    It works

    Thanks raas,

    It's working properly now. I just have to add mkdir /tmp/harddisk before the mount, I dont know why /tmp/harddisk is missing. But it works now.

    Thanks.

  8. #8
    Quote Originally Posted by before View Post
    Thanks raas,

    It's working properly now. I just have to add mkdir /tmp/harddisk before the mount, I dont know why /tmp/harddisk is missing. But it works now.

    Thanks.
    Hi,

    yeah.. happend to me one time, don't know either why /tmp/harddisk is missing.
    what you could do, is create the folder and then a flash/reboot, then it should survive a reboot.


    But I'm happy to hear it's working now.
    Last edited by raas; 11-02-2008 at 13:56.

Similar Threads

  1. linuxrc bug? - WL-500g not booting from usb drive with hub
    By daniel632 in forum WL-500g Custom Development
    Replies: 5
    Last Post: 14-03-2012, 16:28
  2. Unstable boot from USB
    By Tamadite in forum WL-500g Q&A
    Replies: 6
    Last Post: 20-08-2008, 16:19
  3. 7.09 + USB + hotplug
    By oilinki in forum WL-700g Q&A
    Replies: 0
    Last Post: 18-11-2007, 13:51
  4. Syntax for a drive on the 2nd USB port
    By Tellus1 in forum WL-500gP Q&A
    Replies: 3
    Last Post: 17-11-2007, 23:07
  5. Mirroring WL-700g external USB hard drive
    By Joho in forum WL-700g Q&A
    Replies: 0
    Last Post: 11-09-2006, 15:49

Posting Permissions

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