1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Linux Partition How-To

By Anthony Lissot

Coder lit by monitor
Sami Suni/E+/Getty Images

6.1. Volume Labels

Volume labels make it possible for partitions to retain a consistent name regardless of where they are connected, and regardless of whatever else is connected. Labels are not mandatory for a linux volume. Each can be a maximum of 16 characters long.

There are three tools to make volume labels: mke2fs, tune2fs and e2label.

6.1.1. Simple Invocation

e2label /dev/hdb1 pubsw

tune2fs -L pubsw /dev/hdb1

Either of thse two commands will label the first partition of the second drive "pubsw". That label stays with that particular partition, even if the drive is moved to another controller or even another computer.

mke2fs pubsw /dev/hdb1

mke2fs -L pubsw /dev/hdb1

will do the same thing as the first two commands - after they make the file system. This means that either of these last two commands will delete any existing data in the partition.

6.1.2. How to Use

Here is a sample fstab. This is a text file located in /etc, which is usually set up during the installation of the operating system. it describes where each partition wil be mounted, and how it will be mounted. It can be modified by you, either through a utility or manually, when you add/remove devices.


 LABEL=/ / ext3 defaults 1 1
 LABEL=/boot /boot ext2 defaults 1 2
 none /dev/pts devpts gid=5,mode=620 0 0
 none /dev/shm tmpfs defaults 0 0
 LABEL=HOME /home ext3 defaults 1 2
 none /proc proc defaults 0 0
 none /sys sysfs defaults 0 0
 LABEL=/usr /usr ext3 defaults 1 2
 /dev/hdc1 /k-space ext3 defaults 1 2
 /dev/hda6 swap swap defaults 0 0
 /dev/hdd /media/cdrecorder auto pamconsole,ro,exec,noauto,managed 0 0
 /dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0

The leftmost column lists devices and the second column lists mount points. This example contains a mixture of devices and labels. The master drive of the second controller is always mounted on /k-space . The partition labeled "HOME" is always mounted on /home , regardless of which drive it is on or which partition number it has. Notice that it is permissible to use mount points as labels, such as "/usr"

* License

* Linux Partition How-To Index

  1. About.com
  2. Technology
  3. Linux

©2014 About.com. All rights reserved.