I need to create a serial number for my application in a Unix machine.
- The generated serial number should be unique
- Do not change over time (Only changes after hard drive or mother board changes)
- Do not need root privilege.
I found that, in Ubuntu there are some information about hard drives under the following folder:
/dev/disk/by-id
These files seem to be serial numbers of attached hard disks to the machine. I want to use the following command to generate a unique finger print of the machine.
ls /dev/disk/by-id | grep -v 'part'
Is this possible? Does this command meets the conditions I specified above?