Good idea! I never heard of it before. Looked up tune2fs. Can partitions with systems on already be labelled, or would that
destroy the boot procedure? Can a partition formatted NTFS (XP) also be labelled? Also, is there any reason I couldn't run
tune2fs from a live CD/DVD?
Thanx for the input--I will certainly label my partitions.
--doug
Yes, you can label a partition that was not previously labeled but already has an installation on it. You can also relabel a partition, giving it a new name. If your
/etc/fstab uses
LABEL=<name> to mount partitions, rather than
UUID=<numbers>, the label names must be correctly written, as to being case sensitive, and if changes are made to your
/boot/grub/menu.lst and
/etc/fstab to use
LABEL=<name> in place of
UUID=<numbers> you may also need to run
mkinitrd, as
root, to build a new initrd image that is sure to include the changes, and avoid any unnecessary boot delays. This is not always necessary, so try to reboot first, before doing so. If everything works properly and there are no unnecessary delays, you're done.
To label an ext* partition;
[root@localhost ~]# tune2fs -L <newlabel> /dev/<partition-designation>NTFS partitions can also be labeled, but need to be labeled using a different application (
ntfsprogs package) and command;
[root@localhost ~]# ntfslabel -f /dev/<partition-designation> <newlabel>Swap partitions can also be labeled with the command;
[root@localhost ~]# swaplabel -L <newlabel> /dev/<swap-partition-designation>
Using my /etc/fstab as an example;
[root@fatman ~]# cat /etc/fstab# Entry for /dev/sdc15 :
LABEL=64RC / ext4 defaults,noatime 1 1
LABEL=HOME64 /home ext4 defaults,noatime 1 2
LABEL=TR5-Documents /home/polack/Documents ext3 rw,user,noauto,exec,noatime 0 0
LABEL=Documents2 /home/polack/Documents2 ext3 rw,user,noauto,exec,noatime 0 0
LABEL=DL-1 /home/polack/Downloads ext4 rw,user,auto,exec,noatime 0 0
LABEL=VDI /vdi ext4 rw,user,auto,exec,noatime 0 0
LABEL=share1 /share1 ext4 rw,user,auto,exec,noatime 0 0
LABEL=SHARE2 /share2 ext4 rw,user,auto,exec,noatime 0 0
LABEL=share9 /share9 ext3 rw,user,auto,exec,noatime 0 0
LABEL=movies /movies ext3 rw,user,auto,exec,noatime 0 0
LABEL=movies2 /movies2 ext3 rw,user,auto,exec,noatime 0 0
LABEL=storage00 /zstorage00 ext3 rw,user,noauto,exec,noatime 0 0
LABEL=120backup /zbackup ext3 rw,user,noauto,exec,noatime 0 0
LABEL=boot2000 /mnt/boot ext3 rw,user,noauto,exec,noatime 0 0
LABEL=REPO /repo ext4 rw,user,auto,exec,noatime 0 0
none /proc proc defaults 0 0
# Entry for /dev/sdc2 :
LABEL=swap2000 swap swap defaults 0 0
# Entry for /dev/sda2 :
LABEL=swap1000 swap swap defaults 0 0
# Entry for /dev/sdb2 :
LABEL=swap750 swap swap defaults 0 0
none /dev/pts devpts mode=0620 0 0
/dev/fd0 /mnt/floppy auto rw,user,noauto,exec 0 0
/dev/cdrom /mnt/cdrom auto ro,user,noauto 0 0
/dev/dvd /mnt/dvd auto ro,user,noauto 0 0
# none /dev/shm tmpfs defaults 0 0
For this to work the mount point directories must actually exist, and as most are not in my users $HOME directory, those that aren't must be created by
root.. Partitions can be mounted anywhere one chooses, and most documentation says they should be in a sub directory of /mnt. It being my computer, I choose to mount many partitions in directories located directly in the / directory. I use the /mnt directory for mount point sub-directories for temporary mounting of lesser used partitions and devices, for specific tasks.
[root@fatman ~]# ls -l /mnttotal 32
drwxr-xr-x 2 root root 4096 Jan 26 14:44 bbackup/
drwxr-xr-x 11 root root 4096 Jan 26 12:58 boot/
drwxr-xr-x 2 root root 4096 Jan 26 14:41 cdrom/
drwxr-xr-x 2 root root 4096 Jan 26 14:41 dvd/
drwxr-xr-x 2 root root 4096 Jan 27 05:26 floppy/
drwxr-xr-x 2 root root 4096 Jan 26 14:41 here/
drwxr-xr-x 2 root root 4096 Jan 26 14:41 there/
drwxr-xr-x 2 root root 4096 Jan 26 14:44 usb/
I don't allow hal/udev to automount anything, so my /media directory is always empty, or in most installations, like this one, non-existent.
[root@fatman ~]# ls -l /medials: cannot access /media:
No such file or directoryThis is pretty old school, and how Unix and Linux were originally designed to mount partitions, before trying to emulate Windows auto-mounting. While must newly arrived Windows refugees seem to like, and expect, partition mounting to be like that in Windows, I prefer to use the original Linux method, and it is very much alive and well and fully functional in all modern Linux systems.
[rant]We tell new users that Linux is different from Windows, but no longer seem willing to teach those users that this is one of the differences. Instead we try to emulate "the Windows way" rather than demonstrate the logic that actually makes the Linux difference superior. The argument used is that new users "don't want to have to learn" the Linux way of doing things. While true for some, I personally think it's a disservice to them, and a cop out excuse from programmers, to add layers of unnecessary complexity and the additional problems that complexity brings with it. Why are we willing to teach people how to fix their broken auto-mounting udev rules, rather than teach them to properly edit a single /etc/fstab file, and avoid the udev mounting problems altogether? How can we not expect our Linux systems to become overly bloated, when we go out of our way to emulate overly bloated Windows systems?
[/rant]