Log in

Bekijk de volledige versie : How to make sure I always mount the same disk on /opt



captain747480
21-01-2009, 10:35
I have an intermittent problem which has been occurring for a while.

I use an Asus and have 2 drives attached to it. The first is a small flash drive which I mount to /opt the second is a 500GB drive that I use as a NAS.

My problem is that when the Asus reboots it occasionally sets the 500GB drive as Disk0 and the smaller flash drive as Disk1. When this happens my Post-Boot mounts the 500GB drive as /opt and so all my services (which are on the the flash drive) don't get started. I can stop this happening by unplugging the 500GB drive whilst the Asus boots but I'd like to have a way that allows the Post-Boot to detect which of my 2 drives has been set as Disk0 and then mount the appropriate one (i.e. the USB Flash Drive) to /opt.

Does anyone have any ideas.

raas
21-01-2009, 11:12
Hi,

have a look at /etc/fstab
described here : http://www.wl500g.info/showpost.php?p=112605&postcount=2

Lesiuk
21-01-2009, 15:11
Yeah, you must set everything in fstab

al37919
21-01-2009, 15:26
fstab unfortunately will not help, because. it relies on something like disc0 and disc1, however, what will be these 0 and 1 is identified only during boot up

Search the forum again, there were several script-based solutions offered for this problem, which detect who is who and then remount in correct order.

I found the following:
http://wl500g.info/showpost.php?p=71881&postcount=2 ( my early an not very nice version )
http://wl500g.info/showpost.php?p=79119&postcount=249
http://wl500g.info/showthread.php?t=13369 ( discussion and improvement of the previous solution ( Russian ) )

wpte
21-01-2009, 15:42
hmm... it works fine for me...
the only thing I had to take in mind is, that the router detects from usb port 1 to 2.
and If you have an usb hub, it will first detect the ports in order of the hub before going to like the 2nd usb port on your router...
this is also the order it should detect the drives, and I never had them swapped this way:confused: