Find the answer to your Linux question:
Results 1 to 9 of 9
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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?

  2. #2
    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:

  3. #3
    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?

  4. $spacer_open
  5. #4
    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?

  6. #5
    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.

  7. #6


    Perhaps you can modify automount script:

    See also a sample of "/etc/auto.usb":

  8. #7
    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?

  9. #8


    Perhaps you can modify the following script and ask the author:
    (modify mounting path).

    Other example with udev rule:

  10. #9
    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:

Posting Permissions

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