Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
So it seems that I mixed up unique partitions GUIDs with partition types GUIDs. Right?
Yes.
Quote:
Originally Posted by l0f4r0
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.