Hi Peter,

Am 16.12.2025 um 23:03 schrieb [email protected]:
Hi,

How can existence of a given UUID within a system be tested in bash?
Preferably not restricting to a specific kind of device. Eg. avoiding
reference to /dev/disk.

My understanding is that UUIDs in general do not imply any particular type of entity to be defined. In other words, youre free to label anything with an UUID.

As you refer to /dev/disk I assume you think of UUIDs used to identify storage in any way.

Now, for storage, we have an astonishing complex stack of layers: particular attributes, files, file systems, block devices which can be stored in partitions (or without) of other block devices, possibly LVs that are members of VGs which span PVs where those can be on RAIDs which can span partitions again which could be on other dive aggregates of all sorts. In short, it's a mess or abitrary layers of things.

Most of those things can be identified by UUIDs.

Just as a first glimpse:

$ lsblk --help | grep UU
        UUID  filesystem UUID
      PTUUID  partition table identifier (usually UUID)
    PARTTYPE  partition type code or UUID
    PARTUUID  partition UUID

and below that I have

# mdadm --misc -D /dev/md12? | grep UUID
              UUID : 6b39e3fd:41b943b3:670b85ed:c5d54346
              UUID : 29eca8f7:aaa015b1:15052cc0:bf23ecab
              UUID : e105b973:9d80d0b5:379ce26e:15dcc50b

and further down the stack:

# dmidecode | grep -i UUID
        UUID: 00000000-0000-0000-0000-ac1f6b0e43f4


So, my question is -- which sort of thing identified by UUIDs are you interested in?

Also, I believe that a better question would actually be "what problem are you trying to solve?"

Cheers,

Arno

Thx,             ... P.



--
Arno Lehmann

IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück

Reply via email to