Re: Mounting USB devices with stable names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2006-11-14 at 18:40 -0700, Reg Clemens wrote:
> OK, Im missing something.
> Ive been following this thread since I have the same problem,- I want to mount
> thumb-drives in known locations.
> 
> Im not thrilled with labels, but if they will do the job, OK.
> 
> However, I know how to label a ext2/3 drive with e2label, but for compatability
> reasons (so I/we can move files from Windows <-> Linux all of my pen-drives
> are formated as vfat.
> 
> I see mlabel which claims to be able to label vfat drives.  Im not sure that 
> the
> whole mount thing will recognize those labels, but Im one stop back from being
> able to try it.  mlabel SEEMS to only want to work with file systems on 
> /dev/fd0
> so I have no way to label these pen-drives.
> 
> So, how to get the label on the drive in the first place, and then can I 
> expect mount
> to see it?
> 
> -- 
>                                         Reg.Clemens
>                                         reg@xxxxxxx
> 
> 
I copied this from the web somewhere
It works well on my system


"I wanted to rename the fat32 partitions that get automounted when they
are plugg
ed in to the USB drive. Two were exactly similar external hard disk
drives, and
one was an iPod. The exactly similar hard disk drives (one each at home
and work
) were both getting mounted at /media/sda1 or sda2 etc, and it was
impossible to
 distinguish one from the other easily. Also, I found that it wasn't
that easy to edit the partition labels for FAT32 partitions. So I
thought I would summarize how I named my fat32 partitions to have
consistent names. This has the benefit that when these drives are
automounted, they will be at the location /media
/partition-label, where partition-label is the label that you give the
partition
.

Step by step instructions to re-label FAT partitions follow:

1) Install mtools:
$sudo apt-get install mtools

2) After the usb drive is automounted after plugging in, find out the
device descriptor using:
$mount
and Note down where it says sda1 or similar

3) copy the mtools.conf to ~/.mtoolsrc
$cp /etc/mtools.conf ~/.mtoolsrc

4) Edit ~/.mtoolsrc to add one line at the very end:
drive i: file="/dev/sda2"
you may have to change sda2 to something else depending on what you got
in step 2 above.

5) Change to the cdrive i:
$mcd i:

6) Check what the label for the drive is currently:
$sudo mlabel -s i:

7) Change the label to something pretty:
$sudo mlabel i:my-ipod

8) Check if the label has changed:
$sudo mlabel -s i:
I got the following output
Volume label is MY-IPOD

You're all set!! The next time that partition gets automounted, it will
be at /media/MY-IPOD"


John





[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux