linux – DMIDecode product_uuid and product_serial, what's the difference?

Question:

The /sys/class/dmi/id/ directory contains two files product_uuid and product_serial .

  • How are these files generated, how are they different?
  • How do they change?
  • Do they change when you reinstall the system?
  • Why do only root have read permissions for these files? Do the rest of the files in this directory have read permissions for all users?

Answer:

How are these files generated, how are they different?

these pseudo-files are generated by the code from the dmi-id.c , dmi_scan.c and dmi-sysfs.c from the drivers/firmware directory. the content is taken from the bios in accordance with the smbios specification, the documentation for which should first of all be consulted about “what does this or that returned information mean and how does it differ”. secondly (for example, if the returned information contradicts the specification), you should contact the manufacturer of the bios and / or motherboard.

on my system, for example, it is very difficult not to notice the differences between the contents of these two files:

$ sudo tail /sys/class/dmi/id/product_{serial,uuid}
==> /sys/class/dmi/id/product_serial <==
System Serial Number

==> /sys/class/dmi/id/product_uuid <==
0F0914E0-5BCB-11D9-AE58-5404A6CC1207

How do they change? Do they change when you reinstall the system?

this information can probably be gleaned from the description of the smbios specification mentioned above.

Why do only root have read permissions for these files?

the rights to pseudo-files in the discussed directory /sys/class/dmi/id/ defined in the dmi-id.c from lines 42 to 59 (in the second field in the call to the DEFINE_DMI_ATTR_WITH_SHOW macro). the commit adding these lines was made by Lennart Poettering <mzxreary@0pointer.de> (yeah, that one). details can probably be asked directly from him, or on the lkml mailing list .

Do the rest of the files in this directory have read permissions for all users?

yes, most do. which can be verified by looking at the same lines (from 42 to 59), and simply by running:

$ ls -l /sys/class/dmi/id/
Scroll to Top