/* As stated in mount.h in /usr/src/include/sys/, the struct fsid is unique per filesystem on a single machine. typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ File identifier. These are unique per filesystem on a single machine. struct fid { u_short fid_len; /* length of data in bytes */ u_short fid_reserved; /* force longword alignment */ char fid_data[MAXFIDSZ]; /* data (var) }; */ /* For windows, you can get the hard drive's serial nuimber form the registry at: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\ In linux, you can use a tool called hdparm. You can also use cookfp() a tool which will get a hash value of a file and use it on a unique file to linux systems (/etc/passwd comes to mind). */ #include #include #define MAXFIDSZ 16 int main (int argc, const char * argv[]) { struct statfs tStats; printf("Filesystem ID for BSD: %d\r\n", tStats.f_fsid); return 0; }