TIP Media mount points

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Contents

[edit] /media mount points

When sys-apps/hal detects a partition that's not listed in /etc/fstab, like when you attach a removable usb drive, it's automaticly mounted in /media.

Unlabeled partitions are mounted in /media/disk, /media/disk-1, /media/disk-2 and so on. It can be annoying that if you boot with multiple external drives you can't tell which one will get /media/disk and which one will get /media/disk-1.

If you label the partition, the mount point will be /media/<label>.

[edit] Labeling a partition

In this example I will assign the label "shinynewdisk" to /dev/sdb1:

[edit] ext2/ext3

Install sys-fs/e2fsprogs if you don't have it yet.

$ emerge e2fsprogs -av

read existing label

$ e2label /dev/sdb1

set new label

$ e2label /dev/sdb1 shinynewdisk

[edit] vfat

Install sys-fs/mtools

$ emerge mtools -av

edit /etc/mtools/mtools.conf and asign a windows device name to your disk

...
drive c: file="/dev/sdb1"
...

read existing label

$ mlabel -s c:

set new label

$ mlabel c: shinynewdisk

[edit] Other filesystems

Use the right tool for your file system: sys-fs/xfsprogs for xfs, sys-fs/reiserfsprogs for reiserfs, etc.

Personal tools