Menu

uniquely identify an OS instance

2008-06-09
2013-04-05
  • mehul radheshyam choube

    Hi,

    the question is related to disk clonning. if it is misfit for this form then please pardon me.

    i work on a utility which gives an unique id to the host. it generates an UUID and stores it in /etc.

    now the problem is that if the system is cloned (disk cloning) and the image is used to setup a new host then the utility doesn't generate a new UUID as the UUID is already present in /etc.

    somehow the utility should know that it is now running in a cloned environment and generate a new UUID.

    initially i thought of storing a combination of IP address and MAC address. but what if someone adds a new network card or changes existing network card or the ip changes in case of DHCP.

    so is there some unique id or info for an OS which i can rely on?

    for eg. in case of windows platform, by checking the windows SID (http://www.pluralsight.com/wiki/default.aspx/Keith.GuideBook/WhatIsASID.html) for a user/group it can get the unique machine id. the SID in case of windows is based on a unique 32-bit machine id. when a windows OS is cloned the new OS instance gets a new SID by running sysprep utility. all disk cloning products take care of running sysprep. my utility can check the SID to know if its running in a cloned environment.

    on UNIX i am looking for some info like above for me to rely on.

    i checked hostid command but its based on IP address...

    i am trying to get info on the 'post-cloning operations on UNIX'. if anyone has pointers on that then please share.

    i know that now a days devices are assigned UUID but i cant rely on them as they are replaceable.

    any help is appreciated.

    Thanks,
    mrc

     
    • Steven Shiau

      Steven Shiau - 2008-06-11

      IMHO, if the unique ID is saved in the harddisk, it can be cloned, which means, nothing is unique.

       
    • Pebbles Flintstone

      use somethig like:

      dmidecode
      hwinfo

      both commands work in linux, look specifcally for the BIOS MainBoard Serial number, this will always be unique, especially if you use OEM hardware (Dell, HP, Gateway, IBM, Intel etc.)

      If your doing this in windows then try looking into Windows WMI BIOS stuff, I use AutoIT to pull this stuff out of the machine in Windows works like a charm.

      Hope this helps.

       

Log in to post a comment.

MongoDB Logo MongoDB