PDA

Bekijk de volledige versie : 1 USB and 1 HDD in the same time. Reboot



lordu
29-02-2008, 13:56
Example:
I have HDD on disc0 and USB stick on disc1
/dev/discs/disc0/part1 on /tmp/harddisk type ext3 (rw,noatime)
/dev/discs/disc1/part1 on /tmp/harddisk/part1 type vfat (rw,noatime)



After the reboot, the devices are " switched" bettwin. HDD become disc1 and USB become disc0


How can i avoid this ? I wish to use one (or two) USB devices INSIDE of the router (soldered).I want to be sure that disc0 stays disc0 and so on.
Any ideeas ?

Sorry for my english.
Im using Oleg's firmare 1.9.2.7-8

Thanks to all !

raas
29-02-2008, 15:51
Do you have the hdd connected to the lower usb-port?
and the usb-stick connected to the upper usb-port?

In my experience, the lower usb-port get accessed before the upper port.

this might help.

lordu
29-02-2008, 16:21
Do you have the hdd connected to the lower usb-port?
and the usb-stick connected to the upper usb-port?

In my experience, the lower usb-port get accessed before the upper port.

this might help.

You have right, now it's working !!!
Thanks !!!

lordu
29-02-2008, 18:53
Now i have another problem.My 2nd USB device is automatically mounted like this:

/dev/discs/disc1/part1 on /tmp/harddisk/part1

i would like to be like this:

/dev/discs/disc1/part1 on /opt

I've tryed to write this code in post-boot, but doesn't work :

#!/bin/sh
dropbear
umount /tmp/harddisk/part1
mount /dev/discs/disc1/part1 /opt
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

swapon /dev/discs/disc0/part2
/opt/etc/init.d/rc.unslung




Any ideea?

al37919
29-02-2008, 19:00
create /etc/fstab: http://wl500g.info/showthread.php?t=12295

lordu
29-02-2008, 19:54
create /etc/fstab: http://wl500g.info/showthread.php?t=12295

Great! You're a genius!

Another think

It is usefull/possible to use a USB stick (not HDD) for making swap ?

Thank you again!

al37919
29-02-2008, 20:03
possible but not useful.
usb flash has limited number of recording cyles. According to the postings of the people in this forum swap partition on usb stick lives about half a year.

lordu
29-02-2008, 22:28
possible but not useful.
usb flash has limited number of recording cyles. According to the postings of the people in this forum swap partition on usb stick lives about half a year.

Maybe. But the waranty period of this kind of devices is 5 years.
So, somehow, i don't care.I just must pay attention at speed.And i think that "migo" it's one of the mots quick common devices.

Thansk again !!!

raas
01-03-2008, 06:55
Hi,

yeah, usb-swap works great.. it's faster than the swap on the harddisk (mostly due to access-times)

BUT, (big but !)

like al37919 already said,

Mine lived for about half a year, due to the limited write-cycles.

then you start to get all kinds of weird error messages, and it took me a while to understand that my swap was breaking down..
When I switched to swap on harddisk again, the error messages where gone.

lordu
03-03-2008, 09:15
I've tryed to write down the code for fstab, but i don't know how to do-it.
Could some of you have some time to teach me ?
I have this error:

[admin@heavensdoor root]$ cat > /etc/fstab < ___eof
-sh: cannot open ___eof: No such file

after, i try like this :

[admin@heavensdoor root]$ cat > /etc/fstab

and it's free to edit, but i don't know how to save. I think something is wrong.

Can you help me, pls ?
The " step by step " code would be very helpfull for me

newbiefan
03-03-2008, 21:55
well, should be easy, but you must read a bit more anyway.....

Ok, provided you use telnet or putty: (if you don't know it, you must read more)

open a console on your router and start with 'vi /tmp/etc/fstab'
Consider that vi accept datas when pressing 'i' at first.
Input the attached file below and adjust the file to your needs.
(Remove extension txt!)
exit vi with 'ESC :wq'
start again 'vi /tmp/local/.files' and input just one line
'/tmp/etc/fstab'
exit vi with 'ESC :wq'
remove any mount command from post-boot!!
now perform a: 'flashfs save && flashfs commit && flashfs enable && reboot'
done....

lordu
04-03-2008, 14:53
Super, it works
I didn't know that the file exists, allready.

Thanks !

newbiefan
04-03-2008, 21:23
Super, it works
I didn't know that the file exists, allready.

Thanks !

Well, as long as you are using samba and/or ftp server of your asus, your system is working. When you disable samba and/or ftp server you'll get a problem again - your hdd will not be detected.
Just add to your post-boot after dropbear:

#when samba and/or ftp server is disabled in webif
if [ ! -d /dev/discs ] ; then
insmod scsi_mod && insmod sd_mod && insmod usb-storage
fi

Don't forget to store it again with: flashfs save && flashfs commit && flashfs enable && reboot

Now your system should work proper.......

lordu
05-03-2008, 12:15
it was exactelly like this.Now i can see the utility of this:


if [ ! -d /dev/discs ] ; then
insmod scsi_mod && insmod sd_mod && insmod usb-storage
fi


Super! Great support!
Thank you again!