Crazy USB request
I am using very striped Debian, just enough to run xorg and apt. I have one USB port with a two port USB hub attached. I want the two usb ports to auto-mount any FAT device connected (Flash drives, hard drives...) to the /mnt folder as a r/w device.
Here is the catch: Any device plugged into USB port 1, must mount to /mnt/p1, and likewise port 2 must mount to /mnt/p2.
I want to keep the system as streamline as possible to keep my quick bootup. So...any advice?
As a generic answer, if you have a recent kernel (>=2.6.15) and you have udev installed (if not, you can easily install), then you can install autofs and you should be able to configure it to do what you need.
Check out this:
and this too:
Thanks for the reply.
Yes, I am using a modern kernel, 2.6.18 infact. I atempted to use autofs, but I couldn't configure it for what I needed. I could make it work if, for instance, I was using pendrive A and pendrive B, and I wanted them to mount to /mnt/usbA and /mnt/usbB respectfully. Unfortunatly, I need pendrive A to mount to /mnt/usbA if plugged in to USB port 1, and to /mnt/usbB if in port 2.
Is there a way to configure autofs based on port instead of device?
Ah, in that case, I won't be of much help because I just had the generic answer. I'm interested to hear in the response, though. Have you read all that you can about autofs?
Unfortunately, yes. This problem has me stumped. I know it's possible because Debian based "In The Groove" does it. I asked the creaters for some help, and they never responded.
I'm not linux illiterate, but I'm not exactly that great at it either.
Well, I'm fairly sure I'm going to be using AutoFS. However, the script you provided doesn't change the way USB devices mount, just where they do. I tried the script, and no matter what port I pluged into, the first device was always /mnt/usb1 and the second was always /mnt/usb2.
I know the system reads USB block devices using SCSI emulation, but how does the system see the individual ports?
Ooh, that Zenwalk link has an example that may prove useful. Do you know if there is some kind of udev option where instead of:
I could do something like: