[OT] LABEL vs UUID [was: Re: Adding a drive]

Joe(theWordy)Philbrook jtwdyp at ttlc.net
Thu Apr 8 03:41:13 UTC 2010


It would appear that on Apr 7, Steve Morris did say:

> On 06/04/10 08:23, Alan Dacey Sr. wrote:
> > > On 05/04/10 23:53, Tom H wrote:
> > > > Not using a UUID goes against Ubuntu standard practice (and upcoming
> > > > Debian standard practice).
> > > >
> > > > It should be standard operating procedure for anyone about to embark
> > > > on any of the above partition changes to make a note of the UUIDs (if
> > > > she/he does not have this information saved offline) in order to
> > > > reassign them (a very simple procedure).

That's true enough Tom. But I for one never did understand why they chose to
standardize on the NON-human readable UUID when the LABEL method, that Steve was
suggesting, is just about as persistent. 

Of course I'm assuming that anyone who is going to bother manually replacing
/dev/Xdx# references or UUID ones with LABEL should also be smart enough to make
sure the LABELs are unique. IE: "xyzProjData01" IS preferable to "DATA" And don't
get me started about certain distros that like to automatically label their root
partition as just "/"...

> > UUID's are the way to /always/ identify a particular partition.  Since they should
> > not change vey often, it really isn't much of a problem.  The only time you may
> > want to identify them by /dev/sc# is if you have a partition that you test new
> > distros/releases on (that you want quick access to the data) and gets reformatted
> > frequently.

UUIDs are *_ONE_* way Alan. But LABEL is just about as persistent.  Either one
*_CAN_* be messed with by some root level processes. But as far as I know you can't
restore the original UUID, when something does actually change it. Whether it was
due to some resize tool as Steve suggests can happen <below> Or the way it used to
bite me when I'd restore partition contents from an archival tarball after
reformatting a corrupted file system. I'd have to find every place I used the old
UUID (fstab, grub, personal admin scripts,etc... {since I multi-boot that means I
had to find the references in the other installed Linux file systems as well.
etc...})  and edit them all!  If some errant root level process messes with my
LABEL I *_CAN_* restore the original LABEL to the partition thus making all that
editing unnecessary... (See my comment to Steve <below>)

> > It also teaches you to make the right size partitions.  Especially if you are lazy!

Needs sometimes change... 

> I wasn't suggesting the use of /dev/sc# in fstab, I was suggesting the use of
> LABEL= to identify the partition, which as far as I have been able to
> determine is only changeable by a format. The obvious issue with UUID= is the
> home partition where multi-user usage of applications like mail requires the
> home partition to be resized because the original size has become too small.
> This resizing will change the uuid, and depending on the distribution it is
> done from and the tool used can result in a uuid that is invalid, thereby
> making the partition unusable.

In principal I agree with you whole heartedly Steve. But there are two things I'd
like to point out... Last one first: An invalid partition UUID is only unusable
while your using UUID methods. Simply replace all the UUID references with LABEL
ones and the problem is gone.

First one last: Your wrong about needing to reformat a partition to
assign a partition LABEL. (Unless your talking a swap partition that is...)

Actually I can only speak from experience with ext2 & ext3, But
according to: http://manpages.ubuntu.com/manpages/karmic/man8/e2label.8.html
e2label can also do ext4 file systems. And then there is "tune2fs -L"...
Which I'm sure glad of because I know I can actually restore my
original human readable partition "LABEL"(s) if any of them do get
trashed. And there are tools out there to deal with several other
file system types such as: reiserfs, jfs, xfs, & even ntfs...
At least according to the wiki entry on the subject from Arch Linux:
http://wiki.archlinux.org/index.php/Persistent_block_device_naming
Which incidentally makes a fairly strong case for using either LABEL
like you and I have embraced, OR UUID which I strongly dislike.

-- 
|   ---   ___
|   <0>   <->     Joe (theWordy) Philbrook
|       ^              J(tWdy)P
|    ~\___/~      <<jtwdyp at ttlc.net>>





More information about the kubuntu-users mailing list