1
# dmidecode --string system-uuid

i'm using the code above get the uuid on each host in my environment. As far as I understand the uuid should not change between different Linux distributions on the same host with the same hardware configuration. But after some tests on different Linux distributions I encountered different uuid with this same command

It seems that older dmidecode version will get different UUID result.

for example dmidecode 2.9 from sles11.2 result with string A and dmidecode 2.12 from debian 8 result with string B. How can I get the same uuid no matter the Linux distribution I deploy on my machine?

Additional information:

i wanted to use dmidecode and not MAC address as uuid because i saw that if i replace my network adapter or some other hardware’s settings the uuid will not change. What i need is some unique identifier that i can have on my machine to identify it across minor hardware changes and different OS. using dmidecode cannot be fake in some level i guess instead of just generating uuid and writing it to a file and using it. im working with VMware and machine clones are often used and that why i need something that will not be replicated with the clone.

  • what do you need to know is the same? the distro and version? – Skaperen Jun 22 '15 at 12:32
  • Not sure about system-uuid, but would the NIC's MAC-address work? – frostschutz Jun 22 '15 at 12:48
  • The uuid represents the host in my data base and that how I know what record to update. Do you recommend using mac address as my uuid? – Asaf Magen Jun 22 '15 at 13:19
  • What are the two values from dmidecdode? And if these were installed from a package what is that package information for that? – rocky Jun 22 '15 at 14:24
  • the value are uuid strings but they are different from one to another depending on the dmidecode version. it does not matter from what package dmidecode come from but the bin version. for example dmidecode 2.9 from sles11.2 result with string A and dmidecode 2.12 from debian 8 result with string B.(i don't want to publish the strings because of security matters). my main question is how to get one repeated uuid between all os's on the same host. – Asaf Magen Jun 22 '15 at 15:37
1

It's sw, it changes whether you want it or not :)

I wouldn't rely on it (and pretty much on any sw or hw-based auto-detected info) for a DB index - both hw and sw may have to be changed and if the info changes as a result you have to start over. Could be even worse - if you can get duplicates your DB will be in trouble.

I'd use an asset management tool for the index - to guarantee its uniqueness - and I'd map the auto-detected info (MAC, HDD, RAM, CPU, uuid, whatever) to the index but as separate/independent values, not blobbed up into a single value. This way you would locate the machine by single/multi-value queries (in most cases), falling back to the index/asset management system as needed. You can also handle hw/sw upgrades/swaps which add/change/remove one or more of the info values (updated uuid, for example).

  • Or use one of the numerous FOSS tool to do it for me... – MUY Belgium Feb 4 '19 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.