Re: GUID on Linux

From: Jake Waskett (chilliesmad_at_hotmail.com)
Date: 03/14/04


Date: Sat, 13 Mar 2004 23:24:42 +0000

Armel Asselin wrote:

> I have another question now: should I use "libuuid" (or a port of it) on
> Windows too ? or will the GUID of Windows CoCreateGuid and those of
> "libuuid" be "compatible" enough so that I am sure that they won't
> generate colliding IDs ?
>
> Armel

Well a UUID is a UUID. They both implement the DCE specification, so you
shouldn't get a collision. If I were you, I'd use CoCreateGuid on Windows
and libuuid on Linux, but write your own little abstraction layer to hide
the differences.

There is of course a remote chance of a collision anyway, but it's
sufficiently improbable that you shouldn't need to worry about it.

Reading elsewhere in this thread, what you need to do to GUARANTEE
uniqueness is the following: combine a unique machine identifier (such as
ethernet address, assigned as a configuration setting, etc) and a
locally-generated sequence number (32 or 64 bits should do it). You should
be able to get the database you're using to generate the sequence number
itself.

Regards,
Jake.

>
> "Jake Waskett" <chilliesmad@hotmail.com> a écrit dans le message de
> news:oPJ4c.344$V11.333@news-binary.blueyonder.co.uk...
>> Armel Asselin wrote:
>>
>> > Hello,
>> >
>> > I am searching a function on Linux (C/C++) which actually generates a
>> > globally unique identifier (GUID) as CoCreateGuid does on Windows ???
>> >
>> > Thx,
>> > Armel
>>
>> Try "man libuuid", part of e2fsprogs. It should do what you need I think.
>>
>> Regards,
>> Jake.



Relevant Pages

  • Re: Boot-Auswahl-Screen
    ... sudo apt-get install grub". ... Bootpartition von Windows aufruft. ... menuentry "Windows 7 UEFI/GPT" { ... Die UUID 28cf-35de durch die der vorhandenen UEFI-Partion, ...
    (de.comp.os.unix.linux.misc)
  • Re: Dedicated Grub2 partition
    ... for a system with just one linux OS and 1 windows. ... The "fstat" error may mean something else ... Doing a dual install can run mkswap on the swap partition and ... change its uuid. ...
    (Ubuntu)
  • Determine UUID/GUID on Windows XP?
    ... Anyknow know how I determine the UUID/GUID being used by a Windows XP ... I presume it should be the UUID since it is a string which never ...
    (microsoft.public.windowsxp.general)
  • Win32_ComputerSystemProduct.UUID and Windows 98
    ... I would like to get the uuid of the computer my program is running on. ... This works fine using wmi on Windows 2000 and Windows XP (I access ... Michel ...
    (microsoft.public.win32.programmer.wmi)