Author Topic: Why default to disc by-UUID?  (Read 1071 times)

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Why default to disc by-UUID?
« on: July 13, 2011, 04:10:04 AM »
I would not consider PCLinuxOS as my first choice for a server with many discs and partitions, I would however highly recommend it for the the desktop user, this user typically is at some stage likely to want to alter their partition setup.

As I understand it with disc by-UUID if the start position of the partition is changed you then need to edit '/etc/fstab' and if the partition is '/' also '/boot/grub/menu.lst'

If so, would it not make more sense to use disc by-label as the default? Or have I missed the point? Any thoughts?

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10633
  • MLUs Forever!
Re: Why default to disc by-UUID?
« Reply #1 on: July 13, 2011, 04:18:43 AM »
Labels can be duplicated .....  what then?

PCLOS is not server oriented and does not wish to be .....  Tex has posted on this many times.


As I understand your concern, I would suggest that the tools provided in PCLOS overcome whatever concerns you with the arrangement.

Of course if you choose to make changes manually, then I guess you expect to complete those changes manually ......  which would include ensuring that the UUIDs are correct.

regards
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #2 on: July 14, 2011, 06:58:42 PM »
Quote
As I understand it with disc by-UUID if the start position of the partition is changed you then need to edit '/etc/fstab' and if the partition is '/' also '/boot/grub/menu.lst'

Well, it seems I don't understand it correctly!
To test this I ran gparted from a liveCD, moved/resized my PCLinux root partition (sda3) changing both its size and start position on the disk.
I expected to need to edit /etc/fstab and /boot/grub/menu.lst due to the need for a change of UUID,  however that was not needed, all was well using the original UUID. My questions are:

Does this also apply if root is on a logical (say sda5), instead of a primary and the above is done?

What does UUID use for its unique identifiers?

Perhaps a link to a useful explanation?
« Last Edit: July 14, 2011, 07:02:23 PM by dvhenry »

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #3 on: July 14, 2011, 07:23:44 PM »
@ Just19,
Thanks, it's always nice to get a friendly response!

Offline ThirdOfSix

  • Hero Member
  • *****
  • Posts: 745
Re: Why default to disc by-UUID?
« Reply #4 on: July 14, 2011, 10:08:16 PM »
I have moved and re-sized partitions many times.

It has never created a problem.

I believe that the only time the uuid will change is if you delete the partition and re-create it.

The other situation that can get you in trouble is if you delete or add a partition because the remaining partitions will be renumbered and GRUB will not find them.

As to whether things work the same for logical partitions, yes it does.

Most of my installs are on logical partitions with multiple distros or flavors installed at once.


Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10633
  • MLUs Forever!
Re: Why default to disc by-UUID?
« Reply #5 on: July 15, 2011, 03:56:45 AM »

What does UUID use for its unique identifiers?

Perhaps a link to a useful explanation?

Maybe see

man:uuidgen
man:uuidd
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #6 on: July 15, 2011, 04:24:52 AM »
Quote
I have moved and re-sized partitions many times.

It has never created a problem.

I have too, but for me initially I used 'device names' (back then, for my occasional look at a Linux system, 'device names' were the norm),
For some time now I have been using 'labels' only, I would like to know any important difference between labels and UUIDs That may affect partition edits.

My initial understanding was that a UUID is created specific to the partition, in that the creation looks at some partition specifics like perhaps, details of the hard disk the partition is on, details of the start position of the partition, etc,etc.

Quote
I believe that the only time the uuid will change is if you delete the partition and re-create it.

This however suggests that it is simply a randomly produced  'number' assigned to that partition.

Perhaps the truth of how the UUIDs are created is somewhere between the two?

My internet searches have not been of much use for me on this (I'm probably using the wrong search strings).


Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #7 on: July 15, 2011, 04:39:33 AM »
Quote
Maybe see

man:uuidgen
man:uuidd

Thanks for the man page suggestions.
from
Code: [Select]
man uuidgenexplains allot.

Quote
DESCRIPTION
       The uuidgen program creates (and prints)  a  new
       universally  unique  identifier (UUID) using the
       libuuid(3) library.  The new UUID can reasonably
       be  considered unique among all UUIDs created on
       the local system, and  among  UUIDs  created  on
       other systems in the past and in the future.

       There  are  two types of UUIDs which uuidgen can
       generate:  time-based  UUIDs  and   random-based
       UUIDs.   By default uuidgen will generate a ran‐
       dom-based UUID if a high-quality  random  number
       generator  is present.  Otherwise, it will chose

Thanks again, it's not always easy to know where to look!

Offline JALU

  • Sr. Member
  • ****
  • Posts: 456
  • Just Another Linux User
Re: Why default to disc by-UUID?
« Reply #8 on: July 15, 2011, 05:24:40 AM »
dvhenry,
You might find this of interest>
http://atlanticlinux.ie/blog/?p=101
Quote
    Generate new UUIDs with uuidgen

    uuidgen
    f15f8aed-0073-4d2f-abec-aa5da4f72e8c

    Write this uuid to your new partition (WARNING: Do not run these commands against an existing partition),
    for ext2, ext3 or ext4:

    sudo tune2fs -U f15f8aed-0073-4d2f-abec-aa5da4f72e8c /dev/sdc5

(Take care if you want to experiment!)
Cages
THEN and THAN usage..
Use than to make a comparison. Use then when referring to time.

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3984
Re: Why default to disc by-UUID?
« Reply #9 on: July 15, 2011, 05:46:20 AM »
Of course, that last line in the instructions was written with Debian-derived distributions in mind. We don't misuse sudo like that here. Just su to root and use the rest of the line. (Or, better still, stick to the graphical tools unless you really need to fix something.)

-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #10 on: July 15, 2011, 06:31:41 AM »
Quote
You might find this of interest>
http://atlanticlinux.ie/blog/?p=101


Yes, it is of interest, but it only compares 'UUID' like
Code: [Select]
UUID=663f1349-3d37-4633-af59-849eda89bae4 to 'device names' (The device name issue has been around for some time now) like
Code: [Select]
/dev/sda1It does not compare 'LABEL' like
Code: [Select]
PCLinuxOS_11.6

UUIDs are nothing more than a randomly generated string of numbers used in place of a LABEL, as such they can be treated the same when editing partitions.
This is what I did not know, and was trying to find out with this thread.

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #11 on: July 15, 2011, 06:45:26 AM »
Quote
Just su to root and use the rest of the line.
Should not that be su - ?

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10633
  • MLUs Forever!
Re: Why default to disc by-UUID?
« Reply #12 on: July 15, 2011, 06:51:32 AM »

blkid

in a terminal will give you details of the UUID & Label of the various partitions in your PC.

Your system caches the info, so if there has been a change you may need to use the '-c' option and  /dev/null, to get a refreshed listing.
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3984
Re: Why default to disc by-UUID?
« Reply #13 on: July 15, 2011, 09:08:56 AM »
Quote
Just su to root and use the rest of the line.
Should not that be su - ?

No, I don't think you need root's environment; just the privileges.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline dvhenry

  • Full Member
  • ***
  • Posts: 106
Re: Why default to disc by-UUID?
« Reply #14 on: July 15, 2011, 03:57:53 PM »
Quote
blkid

in a terminal will give you details of the UUID & Label of the various partitions in your PC.

Your system caches the info, so if there has been a change you may need to use the '-c' option and  /dev/null, to get a refreshed listing.

I have looked at blkid, you have some very useful tips there.

Quote
No, I don't think you need root's environment; just the privileges.

I guess I'm just in the habit of using su -

Thanks to all for helping to clear up my misconceptions about UUIDs, they are easy enough to work with.