Michael Pobega wrote:
On Tue, Apr 24, 2007 at 04:03:13PM +0200, Andrea S. Gozzi wrote:I noticed that ubuntu 7.04 switched to the UUID method for drives/partitions identification in fstab. I heard rumors that debian will soon do the same (or already does). Even with google I couldn't find any *impartial* comparison of the two methods for identifying hardware. Since it seems to be what most distributions will do from now on, I wanted to discuss its benefits and/or flaws. Personally I don't see any point in using UUID=xxxxxxx instead of /dev/xxx (also beacuse to get the ID you need 'vol_id -u /dev/xxx'), but there are surely pros I'm not aware of... AndreaI think UUID is used because it is better to use UUID to recognize the drives than /dev. For example, if you're trying to have your USB drive automount to /mnt/usb, you'd use something like "/dev/sdb1" in fstab, correct? What if you plug in an external drive? That will be picked up at /dev/sdb, and following that the USB thumbdrive will be picked up as /dev/sdc. The reason for UUIDs is to make it so that the computer can recognize the drives by their device ID rather than the order they were plugged in. I may be wrong though. This is what I've been told.
This is correct, but is a 'high overview' level description. A few more details, maybe, will help understanding what's going on (and the only downside I know for it).
First, the UUID and LABEL methods work in basically the same way, but the UUID is generally considered better, particularly for drives that migrate between systems (such as USB or Firewire). There is less of an issue with colliding values between multiple systems using the UUID.
On booting, the system scans devices and determines the UUID (or LABEL), and creates symlinks from the UUID/LABEL directories (/dev/disk/by-uuid or /dev/disk/by-label) pointing to the actual device node associated with the UUID/LABEL.
So the system can find a device node, using the LABEL or UUID. Once found, the system uses the device node. It's this that leads to the single 'downside' that I've seen, of using UUID/LABEL:
Once mounted, the system 'forgets' the UUID/LABEL, so output of the 'mount' command lists device nodes. Same for 'df'.
And, KwikDisk (KDE applet) will show two items for a particular mount point, the content from fstab (LABEL/UUID) and the device node actually mounted and used to access the device. It's pretty quickly obvious (for the moderately experienced user) which element to use to umount the device, but the multiple entries can become confusing if you have several disks or partitions set up this way.
Bob
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature