Alias for pen drives

Manuel Arostegui Ramirez manuel at todo-linux.com
Mon Oct 1 11:42:23 UTC 2007


On Monday 01 October 2007 13:36:11 Paul Smith wrote:
> On 10/1/07, Manuel Arostegui Ramirez <manuel at todo-linux.com> wrote:
> > > > > The alias '/dev/dvd' is for dvd. What is the alias for pen drives?
> > > >
> > > > They'll be another pseudo-SCSI drive (/dev/sd something).  Whether
> > > > it's sda, sdb, etc., will depend on what other drives are on your
> > > > system, and how the interfaces are managed.
> > > >
> > > > This system has two internal hard drive, they're /dev/sda and
> > > > /dev/sdb. I'd expect that plugging in a USB flash drive would be
> > > > /dev/sdc, but sometimes it's a higher letter.  I haven't worked that
> > > > one out yet.
> > > >
> > > > Another of my systems has one internal hard drive, and one of those
> > > > multi-card readers (SD, Compact, etc.).  If I add a USB flash drive,
> > > > it gets a much higher letter than I expect.  I imaging that's due to
> > > > the multi-card reader grabbing some devices, even if there's no
> > > > memory cards plugged into it.
> > > >
> > > > This unpredicability is why labels are so useful.  You can label a
> > > > drive with a name, and always find it by that name (later on), no
> > > > matter where it's plugged in.
> > > >
> > > > If you don't want to use labels, your other option is making UDEV/HAL
> > > > rules.  You'd pick something identifying about your device (e.g. that
> > > > flash drive, or all flash drives), and assign them a device name of
> > > > your own choosing.  I used to do that with my Polaroid camera.  If I
> > > > plugged it in it be /media/usbdisk, and I couldn't tell it apart from
> > > > flash drive plugged in at the same time (there'd be two
> > > > /media/usbdisks, and I'd have to remember which was plugged in
> > > > first).
> > >
> > > Thanks to all.
> > >
> > > Then, how can I set up a label for my pen drive?
> >
> > Setting the mount point in the /etc/fstab
>
> Yes, Manuel, but how? What sort of line should I add to  /etc/fstab?
>
> Paul

This is an approach that should work, keep in mind you might want use 
different options, dirs...

Pay attention to sdaX, where the X is the number of your usb port, you can see 
it if you plug your usb and tail -f /var/log/messages

/dev/sdaX /media/pendrive auto defaults,noauto,user 0 0

Hope this helps
Manuel
-- 
Manuel Arostegui Ramirez.

Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues.




More information about the users mailing list