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:
    http://www.greenfly.org/tips/autofs.html

    and this too:
    http://www.debian-administration.org/articles/127

  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
    $spacer_close
  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

    Smile

    Perhaps you can modify automount script:

    http://users.tpg.com.au/coltree/usb-storage.html

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

    http://greenfly.org/talks/autofs/autofs.html

  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

    Smile

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

    http://forums.gentoo.org/viewtopic.php?t=113911

    Other example with udev rule:

    http://www.reactivated.net/writing_u...example-usbhdd

    http://manual.zenwalk.org/en/ch03s03.html

  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:
    Code:
    BUS=="usb",SYSFS{serial}=="08C1B350D3B0A929",ENV{NICEMOUNTPOINT}="/mnt/usb-work"
    I could do something like:
    Code:
    BUS=="usb",SYSFS{port}=="001",ENV{NICEMOUNTPOINT}="/mnt/usb1"

Posting Permissions

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