[sf-lug] UUID seems unique for each partition

Evan Klitzke eklitzke.lists at gmail.com
Tue Jan 16 07:49:02 PST 2007


On Tue, 2007-01-16 at 07:12 -0800, jim stockford wrote:
>     i ran dumpe2fs /dev/hda{1,2,3,4,5} and got unique
> UUIDs for partitions 1,2, and 5 and for 3 (swap) i got
> "no magic number..." and for 4 (the extended partition)
> i got "...too short...." And the UUID for 1,2,5 was really
> different--no obvious pattern (e.g. part of the number
> would be the same or some incrementation...).
>     it surprises me no end that each partition has its own
> UUID, as i was sure the manufacturer provided this for
> each device. if i make more partitions, something is
> going on (with fdisk?) that creates a new UUID, yes?

Jim,

The UUID for a partition is generated when you create a filesystem on
that device. So if you were to run mke2fs on one of the partitions
again, the UUID would change. For this reason, I am not a really big fan
of using UUIDs to mount volumes. In the past I have resized partitions
and consequently had the UUID of that partition change, and thus had to
boot off a live CD to fix the /etc/fstab entry.

IMHO, it is better to use labels than UUIDs. All you have to do then is
keep the label the same if you change the partition layout. It is also
useful if you have a lot of partitions, and forget which ones are
supposed to be mounted where (as I do sometimes), in which case using
descriptive labels can be very helpful.

-- 
Evan Klitzke





More information about the sf-lug mailing list