Announcement

Collapse
No announcement yet.

GUIDs for ALL partitions?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GUIDs for ALL partitions?

    Is there a command to get the GUIDs of all the partitions on either your PC or at least on one hard drive?

    I'm aware you can use
    sudo gdisk /dev/sda
    to get an interactive mode where you can specifiy
    i
    then the partition #
    to get the GUID of that one, single partition--one partition at a time.
    But is there a command to print a listing of all partitions on that disk w/their GUIDs? or for all partitions on all disks detected on the PC? I googled and haven't given up but am not spotting anything, not even @ Rod Smith. It's not a big deal, but would be convenient when messing or experimenting with several partitions.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    #2
    ls -l /dev/disk/by-partuuid

    That's for the UUID's but AFAIK the GUID is the UUID. ?
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      The term GUID typically refers to various implementations of the universally unique identifier (UUID) standard ...
      https://en.wikipedia.org/wiki/GUID

      They are different. You can compare the UUID (say by blkid) and GUIDs (using gdisk /dev/sdX) and see they do differ.
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        ... for a GPT disk, btw (GUID Partition Table).
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          UUID is completely arbitrary and identifies nothing. You can give a partition any UUID you want. And, in fact, every time I restore a dd image of a partition to another machine, I have TWO partitions on two computers with the same "unique" identifier. Duh!

          The planet has gone stoopid. Everyone is making their own UUID for everything instead of using natural keys (like the drive's serial number). I've seen systems that spend 90% of their time translating Bob's UUID into Larry's UUID into Sam's UUID because they all thought they were "beyond" relational design.

          Comment


            #6
            Your ranting, rambling, idle philosophy is most helpful. Thanks.
            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              Originally posted by Qqmike View Post
              Is there a command to get the GUIDs of all the partitions on either your PC or at least on one hard drive?

              I'm aware you can use
              sudo gdisk /dev/sda
              to get an interactive mode where you can specifiy
              i
              then the partition #
              to get the GUID of that one, single partition--one partition at a time.
              But is there a command to print a listing of all partitions on that disk w/their GUIDs? or for all partitions on all disks detected on the PC? I googled and haven't given up but am not spotting anything, not even @ Rod Smith. It's not a big deal, but would be convenient when messing or experimenting with several partitions.
              CLI utility is gpt
              Using Kubuntu Linux since March 23, 2007
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                CLI utility is gpt
                Yes, Rod Smith's gdisk--the (or "a") GPT version of fdisk. As I say, it works to get you (only) one GUID at a time.
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  sudo blkid

                  Comment


                    #10
                    The GUIDs for partitions are different from the UUIDs you (or I) get from gdisk.
                    Code:
                    mike@mike-desktop:~$ sudo gdisk /dev/sda
                    GPT fdisk (gdisk) version 0.8.8
                    
                    Partition table scan:
                      MBR: protective
                      BSD: not present
                      APM: not present
                      GPT: present
                    
                    Found valid GPT with protective MBR; using GPT.
                    
                    Command (? for help): i   
                    Partition number (1-7): 1
                    Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
                    Partition unique GUID: [B]0B3A3E36-B506-4F4A-9811-8549F1B5D884[/B]
                    First sector: 2048 (at 1024.0 KiB)
                    Last sector: 1026047 (at 501.0 MiB)
                    Partition size: 1024000 sectors (500.0 MiB)
                    Attribute flags: 0000000000000000
                    Partition name: ''
                    
                    Command (? for help): i
                    Partition number (1-7): 2
                    Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
                    Partition unique GUID: [B]300DBC2C-E8A7-41E7-8F55-86490EFA4347[/B]
                    First sector: 1026048 (at 501.0 MiB)
                    Last sector: 62466047 (at 29.8 GiB)
                    Partition size: 61440000 sectors (29.3 GiB)
                    Attribute flags: 0000000000000000
                    Partition name: ''
                    
                    Command (? for help): q
                    
                    mike@mike-desktop:~$ sudo blkid
                    /dev/sda1: UUID="[B]74D7-02F2[/B]" TYPE="vfat" 
                    /dev/sda2: UUID="[B]127fc14b-aa8a-4c00-b781-0a70a88cf07c[/B]" TYPE="ext4" 
                    /dev/sda3: UUID="1c6b5c19-90a9-49a4-ba47-13da87d1ce36" TYPE="ext4" 
                    /dev/sda4: UUID="812b1589-9e2e-4732-9fa9-e9c8339da0ed" TYPE="swap" 
                    /dev/sda5: UUID="93a75dd6-5ce0-4870-9e48-26ad081f6e41" TYPE="ext4" 
                    /dev/sda6: UUID="4ce4cc70-914f-4a17-8ee3-b8fe19ffb3ae" TYPE="ext4" 
                    /dev/sda7: UUID="2814-3C2A" TYPE="vfat" 
                    /dev/sdb1: UUID="1765-DFF5" TYPE="vfat" 
                    /dev/sdb2: UUID="b65ee9d2-6dd4-4e66-bfe5-16bf0a551bd4" TYPE="ext4" 
                    /dev/sdb3: UUID="0528d150-d14f-4bb4-9d04-ed57ad43ac6f" TYPE="ext4" 
                    /dev/sdb4: UUID="e5f42b2c-77ff-4b11-b0f8-ba9f3cfc8d80" TYPE="swap" 
                    /dev/sdc1: LABEL="MY_DATA" UUID="F968-D426" TYPE="vfat"
                    Or, am I mistaken about something here?
                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #11
                      On my system, this lists all my "Partition unique GUID" numbers, if that's what you want:

                      Code:
                      ll /dev/disk/by-partuuid/
                      The output from above differs from "blkid". Strange that they used "partuuid" to identify it, but maybe if you have a mixed (GPT and MBR) drives you'd get bith UUID's for MBR disks and GUIDs for GPT disks?
                      Last edited by oshunluvr; May 25, 2015, 06:32 AM.

                      Please Read Me

                      Comment


                        #12
                        I guess it's too early this morning or I've been on this PC too long. What is "ll" -- the first two characters of your command? I'm sure it's something I should know, but last time I checked there's no law against acting stupid.
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #13
                          ell ell

                          you know, equal to ls -l

                          Please Read Me

                          Comment


                            #14
                            ell ell

                            you know, equal to ls -l
                            Ha! I'm not embarrased to be embarrased to admit I've missed that somehow, although I see you, Vinny, and others using it all the time.

                            OK, /dev/disk/by-partuuid/, good: that works to get GUIDs of partitions when you have a GPT.

                            This is a bit confusing, UUID vs GUID, but this makes the distinction more clear (to me):

                            https://wiki.archlinux.org/index.php..._device_naming
                            https://bbs.archlinux.org/viewtopic.php?id=165051

                            UUID --> filesystem
                            GUID --> GPT only --> partition

                            Thanks for ell ell and for GUIDs.
                            Last edited by Qqmike; May 25, 2015, 08:25 AM.
                            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                            Comment


                              #15
                              Curious as to why you need GUIDs vs. UUIDs - for what purpose?

                              Seems to me mounting a filesystem would prefer a UUID over a GUID, required in the case of a multi-device filesystem like btrfs.

                              Please Read Me

                              Comment

                              Working...
                              X