Overview: UUID, Partition Labelling and fstab
Persistent block device naming has been made possible by the introduction of udev and has some advantages over bus-based naming.
While Linux distributions and udev are evolving and hardware detection is becoming more reliable, there are also a number of new problems and changes:
1) If you have more than one sata/scsi or ide disk controller, the order in which they are added is random. This may result in device names like hdX and hdY switching around randomly on each boot. The same goes for sdX and sdY. Persistent naming allows you not to worry about this at all.
2) With the introduction of the new libata pata support, all your ide hdX devices will become sdX devices at some point in the future. Again, with persistent naming, you won't even notice.
3) Machines with both sata and ide controllers are quite common these days. With the libata changes mentioned above, the first problem will become even more common, as sata and ide hard drives will both have sdX names.
By default Joatha will use uuid in your fstab when you install
There are more reasons, but these are the most critical ones now and in the near future. That's why Joatha encourages you to change your setup to persistent naming schemes.
The four different schemes for persistent naming:
1. Persistent Naming by UUID
UUID stands for Universally Unique Identifier and is a mechanism to give each filesystem a unique identifier. It is designed so that collisions are unlikely. All Linux filesystems (including swap) support UUID. FAT and NTFS filesystems don't support UUID, but are still listed in by-uuid with a unique identifier:
$ /bin/ls -lF /dev/disk/by-uuid/ total 0 lrwxrwxrwx 1 root root 10 Oct 16 10:27 2d781b26-0285-421a-b9d0-d4a0d3b55680 -> ../../sda1 lrwxrwxrwx 1 root root 10 Oct 16 10:27 31f8eb0d-612b-4805-835e-0e6d8b8c5591 -> ../../sda7 lrwxrwxrwx 1 root root 10 Oct 16 10:27 3FC2-3DDB -> ../../sda6 lrwxrwxrwx 1 root root 10 Oct 16 10:27 5090093f-e023-4a93-b2b6-8a9568dd23dc -> ../../sda2 lrwxrwxrwx 1 root root 10 Oct 16 10:27 912c7844-5430-4eea-b55c-e23f8959a8ee -> ../../sda5 lrwxrwxrwx 1 root root 10 Oct 16 10:27 B0DC1977DC193954 -> ../../sdb1 lrwxrwxrwx 1 root root 10 Oct 16 10:27 bae98338-ec29-4beb-aacf-107e44599b2e -> ../../sdb2
As you can see, the fat and ntfs partitions (fat and windows labels above) have shorter names, but are still listed. The advantage about using the uuid method is that it is less likely that you have name collisions than with labels; the disadvantage is that they are more difficult to memorise.
2. Persistent Naming by LABEL
Almost every filesystem type can have a label. All your partitions that have one are listed in the /dev/disk/by-label directory:
$ ls -lF /dev/disk/by-label total 0 lrwxrwxrwx 1 root root 10 Oct 16 10:27 data -> ../../sdb2 lrwxrwxrwx 1 root root 10 Oct 16 10:27 data2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Oct 16 10:27 fat -> ../../sda6 lrwxrwxrwx 1 root root 10 Oct 16 10:27 home -> ../../sda7 lrwxrwxrwx 1 root root 10 Oct 16 10:27 root -> ../../sda1 lrwxrwxrwx 1 root root 10 Oct 16 10:27 swap -> ../../sda5 lrwxrwxrwx 1 root root 10 Oct 16 10:27 windows -> ../../sdb1
You can change the labels of your filesystems using these commands:
* swap: Create a new swapspace like this: mkswap -L <label> /dev/XXX * ext2/ext3: e2label /dev/XXX <label> * reiserfs: reiserfstune -l <label> /dev/XXX * jfs: jfs_tune -L <label> /dev/XXX * xfs: xfs_admin -L <label> /dev/XXX * fat/vfat: There is no tool to change the label using Linux, but when you create the filesystem, use mkdosfs -n <label> <other options>. You may also change the label of an existing filesystem using Windows. * ntfs: ntfslabel /dev/XXX <label< or change it using Windows.
Be careful: The labels have to be unique to make this work", it applies equally to USB/firewire sticks and to harddisks. The LABEL=/ UUID= syntax is preferred over /dev/disk/by-*/ for UN*X partitions
3. Persistent Naming by id
by-id creates a unique name depending on the hardware serial number.
4. Persistent Naming by path
by-path creates a unique name depending on the shortest physical path (according to sysfs). Both contain strings to indicate which subsystem they belong to and thus are not suitable for solving the problems mentioned in the beginning of this article. They won't be discussed any further here.
Enabling persistent naming
Having chosen which naming method you'd like to use, let's now enable persistent naming for your system:
In fstab
Enabling persistent naming in /etc/fstab is easy, just replace the device name in the first column by the new persistent name. In my example I would replace /dev/sda7 by one of the following:
/dev/disk/by-label/home or /dev/disk/by-uuid/31f8eb0d-612b-4805-835e-0e6d8b8c5591
Do so for all the partitions in your fstab file.
Instead of giving the device explicitly, one may indicate the filesystem that is to be mounted by its UUID or volume label, writing LABEL=<label> or UUID=<uuid>, for example:
LABEL=Boot
or
UUID=3e6be9de-8139-11d1-9106-a43f08d823a6
Persistent Naming in the boot manager
To use persistent names in your boot manager, all of the the following prerequisites have to be met:
1) You are using a mkinitcpio initramfs image
2) You have udev enabled in /etc/mkinitcpio.conf
3) When your initramfs image was generated, version 101-3 or greater of klibc-udev was installed (persistent naming is broken in any earlier version). If you are updating klibc-udev from an earlier version and want to use persistent naming, regenerate your initramfs image before you reboot.
In the above example, /dev/sda1 is the root partition. In the grub menu.lst file, the kernel line looks like this:
kernel /boot/vmlinuz26 root=/dev/hda1 vga=0x318 ro
Depending on which naming scheme you prefer, change it to one of the following:
kernel /boot/vmlinuz26 root=/dev/disk/by-label/root vga=0x318 ro
or
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/2d781b26-0285-421a-b9d0-d4a0d3b55680 vga=0x318 ro
There is an alternative way to use the label embedded in the filesystem. For example if (as above) the filesystem in /dev/hda1 is labelled "root", you would give this line to grub:
kernel /boot/vmlinuz26 root=LABEL=root vga=0x318 ro
(source:wiki.archlinux.org whom used marc.theaimsgroup.com Content from wiki.archlinux.org was stated to be available under GNU Free Documentation License 1.2 ) and has been re-edited for Joatha-manuals

