Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

USB mass storage and mount points

  • 12-07-2004 7:38pm
    #1
    Technology & Internet Moderators Posts: 28,830 Mod ✭✭✭✭


    I wonder if there's a way around this:

    I have two USB mass storage devices - a 128MB disgo Lite and a Fuji camera. When I plug either into any USB port, it presents on /dev/sda. I want to use nice friendly mount points, so I have these lines in /etc/fstab:
    /dev/sda1     /disgo        vfat       noauto,user    0 0
    /dev/sda1     /camera       vfat       noauto,user    0 0
    
    Problem is, this doesn't allow me to use both devices at the same time. If one is already plugged in, plugging the other in makes it present on /dev/sdb instead. I can get around it with sudo mount -tvfat /dev/sdb1 /camera, but it's not nearly as handy as mount /camera.

    Is there a way of getting hotplug to recognise the device, and assign it to a predetermined device? Alternatively, does anyone know how to go about writing a script that hotplug can call, so I can automagically mount the device to the appropriate mount point depending on the device type?


Comments

  • Registered Users, Registered Users 2 Posts: 188 ✭✭slartibardfast


    its a job for udev, just write a rule for both of your devices!

    here is a nice gentoo guide, should give you enough pointers for what ever flavour you like.

    http://webpages.charter.net/decibelshelp/LinuxHelp_UDEVPrimer.html

    Best of luck,


  • Registered Users, Registered Users 2 Posts: 1,569 ✭✭✭maxheadroom


    You can do this, but only if you're using UDEV instead of DevFS. You write a custom UDEV rule that assigns your camera to /dev/camera and your usb stick to /dev/disgo

    EDIT: Damn, slarti beat me to it ;)


  • Technology & Internet Moderators Posts: 28,830 Mod ✭✭✭✭oscarBravo


    ...and this, my friends, is why I love boards.ie. Three hours later, and I have a customised udev setup consistently creating /dev/ symlinks exactly where I want them.

    Thanks, guys.


  • Registered Users, Registered Users 2 Posts: 1,067 ✭✭✭tomk


    Nice one folks. I was about to post about the same issue, and I 've been looking for an excuse to try udev, now that my 2.6 setup is up and running.

    I'll be doing it on Debian, so if there are any peculiarities, I'll post them.


  • Registered Users, Registered Users 2 Posts: 3,284 ✭✭✭dubhthach


    My memory is a bit hazy as i tend to use IRIX instead of Linux these days but i always remember under redhat/fedora that with disgo devices that they would appear under /mount once you pluged them in.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,569 ✭✭✭maxheadroom


    Originally posted by dubhthach
    My memory is a bit hazy as i tend to use IRIX instead of Linux these days but i always remember under redhat/fedora that with disgo devices that they would appear under /mount once you pluged them in.

    Yes, but the problem is that if you have 2 removable devices, the device names depend on the order they're plugged in (first one gets /dev/sda, second gets /dev/sdb, etc). UDEV lets you do things like "If USB mass storage device with vedor id FUJI and SERIAL NO XXXXX is plugged in, call it /dev/fuji"

    Which means that if you mount /dev/fuji as /mount/fuji, you know that its only ever going to be your camera.


  • Registered Users, Registered Users 2 Posts: 7,496 ✭✭✭quarryman


    i've a question to tag onto this.

    I have my USB stick working in my unix system but it seems to prevent long filenames. anything longer than 8 chars i think.

    it renames longfilename.txt to long~1.txt etc.

    any suggestions?


  • Technology & Internet Moderators Posts: 28,830 Mod ✭✭✭✭oscarBravo


    Originally posted by quarryman
    I have my USB stick working in my unix system but it seems to prevent long filenames. anything longer than 8 chars i think.

    it renames longfilename.txt to long~1.txt etc.
    Check the fstype you're using to mount it - you need vfat. If fstab has auto as the fstype, it will use the first one that works, which is fat16 (I think). Look at my first post for example fstab entries that work, long filenames and all.


  • Registered Users, Registered Users 2 Posts: 1,569 ✭✭✭maxheadroom


    look in /etc/fstab, find the mount point, and change the filesystem from auto or fat to vfat


Advertisement