LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-15-2019, 08:50 AM   #1
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Xubuntu
Posts: 459
Blog Entries: 2

Rep: Reputation: 194Reputation: 194
A small error in the 'lsblk' help text.


Just a little something I noticed: There’s a small error in the description of the ‘PTUUID’ column in the help text of the ‘lsblk’ command (note that I’m running Slackware64-current on a Legacy BIOS computer with a GPT-partitioned disk):
Code:
$ lsblk --version
lsblk from util-linux 2.34
$ lsblk --help | grep 'UUID  '
        UUID  filesystem UUID
      PTUUID  partition table identifier (usually UUID)
    PARTUUID  partition UUID
That note about PTUUID saying “(usually UUID)” is incorrect, as demonstrated by the following output:
Code:
$ lsblk --output=PATH,UUID,PARTUUID,PTUUID,PARTLABEL --nodeps /dev/sda /dev/sda1 /dev/sda2
PATH      UUID                                 PARTUUID                             PTUUID                               PARTLABEL
/dev/sda                                                                            38ef380d-5a78-4757-a695-f2635093ac5d 
/dev/sda1                                      3e22819f-7030-4d68-b325-7f9fa8ce6b6b 38ef380d-5a78-4757-a695-f2635093ac5d BIOS boot partition
/dev/sda2 feaba671-d648-4b16-b6c5-ba42f39f2312 416e21b4-911a-4733-8866-2924b6da7df0 38ef380d-5a78-4757-a695-f2635093ac5d Linux filesystem
As I understand it:
  • PTUUID (partition table UUID) is assigned at the time the partition table is created, and remains in effect, no matter how often and how many partitions get created on the disk or removed from it;
  • PARTUUID (partition UUID) is assigned at the time the partition is created, and remains in effect, no matter how often a filesystem is created on it (i.e., the partition is “formatted”);
  • UUID (filesystem UUID) is assigned whenever a filesystem is created on the partition, and will change upon each “formatting” operation (unless you explicitly assign the previously existing UUID to the new filesystem).
Thus, these three values are quite distinct, and do not have anything to do with one another. (Granted, nothing earth-shattering, but I just thought I’d mention it here.)

Last edited by luvr; 07-15-2019 at 08:52 AM.
 
Old 07-15-2019, 09:15 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I would suggest to write and submit a patch then.
This is the commit that added the text: https://github.com/karelzak/util-lin...30200f6bdb0195
 
Old 07-15-2019, 09:54 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
I don't see an error here. UUID means Universally Unique IDentifier and the "universally unique" attribute applies to a kind of object, so the objects partition table, partition and file system have each their own UUID.

That the PTUUID be displayed on a line for a partition should not bother you: it just says that the parent of this partition is a device whose UUID is indicated.

Similarly you can display the field PKNAME, which is the name of the device parent of this partition. So in case of a partition both PKNAME and PTUUID are ways to identify the parent device of this partition.

I don't see how this can be confusing and would classify this as notabug.

Do I miss something?

Last edited by Didier Spaier; 07-15-2019 at 12:18 PM.
 
Old 07-15-2019, 12:34 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
The help text is attempting to say that the partition table identifier (PTUUID) can be arbitrary text but is usually a UUID, not some UUID displayed in the UUID column. Perhaps that line should read
Code:
      PTUUID  partition table identifier (usually a UUID)
 
Old 07-15-2019, 11:59 PM   #5
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Xubuntu
Posts: 459

Original Poster
Blog Entries: 2

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by rknichols View Post
The help text is attempting to say that the partition table identifier (PTUUID) can be arbitrary text but is usually a UUID, not some UUID displayed in the UUID column.
Ah, I get it now. I never considered the possibility that a column described as “Partition Table UUID might contain anything but… a UUID. I also didn’t think beyond the common x86 platform and its partition table types (and their UUIDs).

It remains a bit weird that what is called a “Universally Unique Identifier” could ever be set to, perhaps, a “Universally Ambiguous Identifier”, doesn’t it?

Anyway, I’m probably just thinking too deeply about some silly, little, inconsequential detail again… I’m notorious for doing so every now and then…

In any case, I’ll try and overcome my tendency to be pedantic next time around—but I won’t make any promises.

By the way, I’m attaching a little bash script thingie that demonstrates the documented values that the ‘lsblk’ command can report about a disk device. It will display a dialog that lists the available disk devices, and subsequently list the results for the selected one. Just FYI.

Also, in case you ever need to find a disk partition when given its filesystem label, you could run the ‘findfs’ command—albeit as root:
Code:
# findfs LABEL="${FILESYSTEM_LABEL}"
As a normal (non-root) user, on the other hand, you could do:
Code:
$ readlink --canonicalize-existing /dev/disk/by-label/"${FILESYSTEM_LABEL}"
Attached Files
File Type: txt test-lsblk.txt (11.8 KB, 15 views)
 
1 members found this post helpful.
Old 10-14-2020, 01:49 AM   #6
MrCalvin
LQ Newbie
 
Registered: Mar 2019
Posts: 3

Rep: Reputation: Disabled
Thanks for clarifying the difference between ptuuid and partuuid :-)
 
  


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
"lsblk" sees flash drive but "fdisk -l" does not themohawkninja Linux - Newbie 5 06-13-2017 01:42 PM
lsblk failed to read hansaplazt Linux - Server 2 04-27-2017 09:43 PM
lsblk looks Chinese Soapm Linux - Software 4 11-27-2014 02:19 PM
fdisk lsblk, parted do not work eliassal Linux - Newbie 4 06-25-2014 11:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:34 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