Re: automatically mounted filesysystems in /media



On 2007-08-30, Rob <ramseyrt@xxxxxxxxx> wrote:

I just partitioned an external USB hard drive, creating one 40GB vfat
(/dev/sdb1) and on 40GB ext3 (/dev/sdb2) filesystem. When I'm logged
into KDE, the system automatically mounts the two filesystems as /
media/disk (/dev/sdb1) and /media/disk-1 (/dev/sdb2).

How do I change the names that these are automatically mounted with?
I realize I could manually mount them using the fstab, but this
external storage is attaching to a laptop and will not always be
connected.

Just give the partitions a "disk label" (like you can in DOS/Windows).

To give a label to an ext2/3 partition (I prefer ext2 on an USB drive BTW),
just use:
e2label /dev/sdb2 USB_EXT
.... and the partition will appear as /media/USB_EXT at the next mount.

For the FAT partition, you might have to define the label on a Win machine.
Can't remember if I ever did it from Linux.


Limit the names to max 12 chars. More is possible but not recommended,
especially in FAT.
Certain chars may not be allowed. ('_' might not be, for instance)



--
There is an art, it says, or rather, a knack to flying.
The knack lies in learning how to throw yourself at the ground and miss.
Douglas Adams
.



Relevant Pages

  • Re: use of label in fstab
    ... label ublinux edited fstab to contain: ... I made another partition /dev/sda5 and used e2label to label it dyndata, ... On bootup now, the first partition mounts correctly, but the second gives ... ~# mount -L dyndata /dyntest ...
    (Ubuntu)
  • Re: Disk Label Problem
    ... The disks are different sizes. ... > partition and the third to mount at /usr then when writing the changes ... this generated an error that it couldn't write label. ...
    (freebsd-questions)
  • Problems mounting by label
    ... Using the latter defeats the purpose however, since I want eventually to mount things to a different mount point depending on their label. ... The data for partition 1 is: ... I also used glabel to try to get a label on it, but couldn't see how I could use the glabel information for mounting. ...
    (freebsd-questions)
  • Re: use of label in fstab
    ... use of label in fstab ... > I made another partition /dev/sda5 and used e2label to label it dyndata, ... I don't generally mount by label & I don't use ext filesystems, ...
    (Ubuntu)
  • Re: Problem with random disks mount sequence
    ... I'll get random mount sequences. ... At the beginning the USB ... nautilus remember that 'storage3' was 1st partition, ... SCSI drives are listed by order of discovery. ...
    (Fedora)