PDA

Bekijk de volledige versie : 2 USB drives



MoD
18-10-2005, 20:26
I have moved my linux to 512 MB USB flash drive as described in http://oleg.wl500g.info/ "Root file system on the external USB drive"

USB flash mounts as root filesystem / .

Now I'm trying to add the second USB 300GB HDD drive. It loads as /tmp/harddisk.

But I see that in this case /opt does not mounts. It seems that linux boots from internal flas, no from USB flash drive. Why?

Styno
19-10-2005, 08:23
Long story. Let me try to explain in short:

Linux automounts the first partition on the first usb storage device it finds. If you attach two devices there is no way to determine which device is found first. Perhaps you can influence this by swapping the devices on th usb hub, or add an second hub for the device you want to detect latest.

Because wl-500g only mounts the first partition on the first device, you will have to mount all other partitions manually using the post-mount script.

MoD
19-10-2005, 17:25
Long story. Let me try to explain in short:

Linux automounts the first partition on the first usb storage device it finds. If you attach two devices there is no way to determine which device is found first. Perhaps you can influence this by swapping the devices on th usb hub, or add an second hub for the device you want to detect latest.

Because wl-500g only mounts the first partition on the first device, you will have to mount all other partitions manually using the post-mount script.

The funny thing is that I have reflashed my router at least 3 times. And always I have se thame problem withc later somehove disapears. I just did not notice how. I really want to understand;)

The configuration is following:
1) wl500gx router with 512 MB flash drive plugged in to USB hole closest to the power line input.
2)The second USB hole has USB hub where is connected my 300GB USB drive.
3) 512MB USB drive has two partitions - 450MB linux patrition and 62 MB swap partition.

If the USB hub with 300GB drive is connected to the router at startup, the router boots from internal memory, not from Flash drive.

If I boot it without USN hub connected, it boots from Flash drive and when I connect USB hub, it reconizes 300GB USB disk.

Any explanations why it wont boot from flash drive if the second USB hub is conected? it is more principle question. I start to think not to boot from USB flash drive, but just mount it as /opt directory to install packages. What is the difference? you are adding ipk pakages to /op dir anyway? Why it makes sense to boot from USB drive, if /usr/local is stored to the internal flash anyway?

Styno
20-10-2005, 08:17
Any explanations why it wont boot from flash drive if the second USB hub is conected? it is more principle question. What happens if you swap both ports?

I start to think not to boot from USB flash drive, but just mount it as /opt directory to install packages. What is the difference? The difference is the amount of memory required to uncram (unzip) the compressed Linux image into memory and mount it. The difference is a couple of megabytes. You can check the difference with the command 'free'. So by using usbboot you have more memory to run optware. [/QUOTE]


Why it makes sense to boot from USB drive, if /usr/local is stored to the internal flash anyway?The /usr/local directory is a 64k space in flash which is not used to store the firmware. To provide an alternative way of storing configuration between reboots without using nvram variables, Oleg kindly provided tools to acces this bit of unused space.

MoD
20-10-2005, 14:31
What happens if you swap both ports?
The difference is the amount of memory required to uncram (unzip) the compressed Linux image into memory and mount it. The difference is a couple of megabytes. You can check the difference with the command 'free'. So by using usbboot you have more memory to run optware.

The /usr/local directory is a 64k space in flash which is not used to store the firmware. To provide an alternative way of storing configuration between reboots without using nvram variables, Oleg kindly provided tools to acces this bit of unused space.[/QUOTE]

If I swap the ports, nothing happens.

About more space for optware, I still can mount USB as /opt folder to run optware. For this I dont need to boot from USB.

As far as I understand, then even if I boot from USB, /usr/local is still saved on a router chip memory?

Styno
20-10-2005, 15:41
About more space for optware, I still can mount USB as /opt folder to run optware. For this I dont need to boot from USB.Correct.

As far as I understand, then even if I boot from USB, /usr/local is still saved on a router chip memory?Correct again, but depends on the firmware you're booting. If it's, for example, a debian installation this doesn't have to be true.

MoD
21-10-2005, 14:29
Correct.
Correct again, but depends on the firmware you're booting. If it's, for example, a debian installation this doesn't have to be true.

To finalize an answer - if I pug 2 USB memory sticks in the router, there is no way to control that router will boot from flash?