LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-12-2018, 09:27 AM   #1
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
Are GUIDs really unique?


From the internet, it seems that GUIDs are kinds of 16 bytes hashes and so are meant to be pretty unique and are generated when partitions are created.
However, sites like Wikipedia (see https://en.wikipedia.org/wiki/GUID_Partition_Table, chapter "Partition type GUIDs") reference some partition type GUIDs. Indeed, my SWAP partition GUID (which I can obtain via "lsblk -o parttype') is the same than the one on Wikipedia.
So, are GUIDs really unique please?
 
Old 08-12-2018, 10:34 AM   #2
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 62

Rep: Reputation: Disabled
You muddle up GUIDs used for identificating the partition itself and the type of partition. GUIDs of partitions itself, of course, have to be unique. But GUIDs used for types are not generated by partition managing software every time: they were generated once when the standards were developed, and are just shipped with such software.

In MBR era, a list of one-byte numbers was used to represent partition types. But the growing number of different filesystems and their purposes exposed the outrageous non-scalability of such a solution. So GPT developers decided to abandon the problem for near and far future, and replaced them not with two-bytes or even four-bytes codes, but with GUIDs right away. They still are a fixed list, but they are much more sparse and not ordered.
 
2 members found this post helpful.
Old 08-12-2018, 04:36 PM   #3
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
So it seems that I mixed up unique partitions GUIDs with partition types GUIDs. Right?
 
Old 08-12-2018, 04:49 PM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Universally Unique identifiers are usually called UUID's.
At least the blkid command lists the UUID's of my disk partitions.

GUID's sounds very similar to GID's.
 
1 members found this post helpful.
Old 08-12-2018, 06:23 PM   #5
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
Quote:
Originally Posted by JeremyBoden View Post
At least the blkid command lists the UUID's of my disk partitions.
Thanks for the "blkid" command hint. It looks similar to "lsblk".
However, following bodqhrohro's remark, I don't understand now the difference between "lsblk -o parttype" and the PARTUUID info from "blkid -o full". The sequences are not the same so there must be a difference somewhere...

PS: the difference betwwen GUID and UUID seems very tenuous. Some sources indicate that GUID would be more Windows specific.
 
Old 08-13-2018, 01:15 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,005

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Not really unique in theory. In practice yes.


https://www.quora.com/What-is-the-di...-UUID-and-GUID seems to be a rather good explanation.


How to use them. https://betterexplained.com/articles...uide-to-guids/

Last edited by jefro; 08-13-2018 at 01:17 PM.
 
1 members found this post helpful.
Old 08-13-2018, 01:43 PM   #7
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 62

Rep: Reputation: Disabled
Quote:
Originally Posted by l0f4r0 View Post
So it seems that I mixed up unique partitions GUIDs with partition types GUIDs. Right?
Yes.

Quote:
Originally Posted by l0f4r0 View Post
Some sources indicate that GUID would be more Windows specific.
Technically they are almost the same. You won't see any difference if not checking them with a very strict pattern. And even the name of GPT stands for "GUID Partition Table", so I don't see any reasons for doubt.
 
1 members found this post helpful.
Old 08-28-2018, 10:45 AM   #8
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
Thanks for all your answers.

Then can one says that:
Code:
lsblk -o parttype
returns the partition type GUIDs/UUIDs (so not unique and even referenced publicly)
whereas
Code:
blkid -o full
returns the partition GUIDs/UUIDs (a priori unique)
?

It seems that GUIDs/UUIDs are quite interchangeable. Even the RFC 4122 states:
Quote:
This specification defines a Uniform Resource Name namespace for UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDentifier).
Finally, can one states that what define a GUID/UUID are in the end the following?
  • the goal of having a pretty unique big sequence,
  • the format (groups of 4-2-2-2-6 bytes),
  • some conventions.
Indeed, https://betterexplained.com/articles...uide-to-guids/ suggests that the implementation could be very open/free...
So am I totally wrong if I pick a MD5 (let's say d6aa97d33d459ea3670056e737c99a3d), add some dashes to it (d6aa97d3-3d45-9ea3-6700-56e737c99a3d) and then call it a GUID/UUID?
 
Old 08-28-2018, 01:00 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,005

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
How did you get this md5 issue?
 
Old 08-29-2018, 02:10 AM   #10
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
Quote:
Originally Posted by jefro View Post
How did you get this md5 issue?
I'm not having any MD5 issue, I'm wondering what GUIDs/UUIDs represent on my computer (lsblk / blkid) and how to get them and deal with them
 
Old 08-29-2018, 11:57 AM   #11
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
A UUID is an almost certainly unique number.
They can be used to index hardware resources without hitting a duplicates problem.
 
1 members found this post helpful.
Old 08-29-2018, 02:45 PM   #12
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
Quote:
Originally Posted by JeremyBoden View Post
A UUID is an almost certainly unique number.
They can be used to index hardware resources without hitting a duplicates problem.
Indeed, thanks but please see post #8 for more specific questions I have
 
Old 08-29-2018, 03:59 PM   #13
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
I think its just a few formatting hyphens to aid humans.

I'm sure that a "real" UUID has no hyphens, since it is only used for comparison purposes and comparing two big numbers is much easier than comparing two strings with the hyphens in.
Personally, if I ever need to check a UUID is correct (in a fstab file) I just check the last 3 or 4 characters match with the disk partitions UUID.

I never generate UUID's - but you can do this, with the uuidgen command (which is part of libuuid from the e2fsprogs package).
See https://www.tutorialspoint.com/unix_...ds/uuidgen.htm
 
Old 08-30-2018, 12:23 AM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
on my system there's 3 commands:
Code:
uuidgen
uuidd
uuidparse
you (op) should look at their man pages and play with them.
 
Old 08-30-2018, 08:14 AM   #15
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Interesting thread ... Made me look up the Wikipedia entry someone mentioned above ... Pretty well written and informative - I recommend reading it.

Cheers.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] see only unique strings gargaks83 Linux - Newbie 9 12-10-2013 07:11 AM
Something Unique nankura Linux - Newbie 8 11-24-2011 05:47 AM
Tool for swapping user uids and guids? ubearcats Linux - General 1 12-14-2006 10:02 AM
guids and suids hongman Linux - Newbie 2 03-21-2005 04:18 PM
GUIDs sikil_nuru Programming 5 03-16-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration