-
Notifications
You must be signed in to change notification settings - Fork 17
/
ideas.txt
66 lines (49 loc) · 2.38 KB
/
ideas.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
IDE serial number - NOT SATA or SCSI
====================================
I am using the following code to get the hard disk serial number
struct hd_driveid hd;
int ide;
ide=open("/dev/hda",O_RDONLY);
(void)ioctl(ide,HDIO_GET_IDENTITY,&hd);
(void)printf("Serial number - %s\n",hd.serial_no);
this is working fine..but for sata hard disk it is not working how
to change the code to get SATA hard disk serial number....i
changed "/dev/hda" to "dev/sda" that is also not working
Another alternative to find the HDD serial number
=================================================
I think I found another alternative to find the HDD serial number.
Getting the boot define is fairly easy, so is the serial number for a
ATA (IDE) hard disk. As I said, SCSI and SATA is a bit more difficult.
But there seems to be a new method that should work too - I tested it
in three very different machines, each have a different version of
Linux too. And more importantly, all without ROOT access.
Knowing the UUID or device (eg: /dev/sda1) one can simply do a lookup
in the /dev/disk/by-id/ directory. Each file in that directory has the
following information: <bus>-<brand>-<model>-<serial#>[-<partition>]
So by simply parsing the name, you can find the serial number of the device.
This option has been verified as available on the following Linux distros:
- OpenSuse 11.2
- Ubuntu 8.04.2
- Debian
- Fedora 13 & 14
- CentOS
It seems all Linux distros since around 2006 and later have this device
information files.
Ideas for Identifying markers
=============================
* For M2 Centres we know they must be network enabled. So use MAC addy +
the IP address. Hash that with MD5 and go from there.
* Use the timestamp (date/time) of the /bin or C:\Windows or C:\WINNT directory.
Convert it to seconds since 1970-01-01.
* Use MAC address, MD5 it, then grab 32bits of that.
* Total installed memory. Linux: /proc/meminfo -> MemTotal
* Check partitions on system: Linux: /proc/partitions
* CPU info.
- Brand
- # of cores
- speed in Mhz
* Query the date/time value of the '/bin' directory under Linux, or the
'c:\Windows' (or 'c:\winnt' under Win2000). Then work out how many seconds
or milliseconds since say 1980-01-01. You then have a pretty unique value.
This chances of somebody else running your software and having installed
their OS in the exact same millisecond as somebody else is pretty slim.