Thread: Equivalent to volume serial number in linux

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445

    Equivalent to volume serial number in linux

    I have a system whose server runs on linux and clients run on windows currently. I would very much like to port the client over to linux, but the current system uses MAC address, hostname, and volume serial number to authenticate stations. Is there an equivalent value in linux for volume serial number, or something else that is equally unique per-machine that would be useful for authentication, and could easily be hashed down to a 32-bit number? I've been searching google and this forum for over an hour and have found nothing useful. I found reference to an entry in /proc and another reference to using hdparm, but hdparm fails on my server, probably because it is for ide/ata drives, and the /proc entry does not exist on my server. I'm really hoping someone here knows something, because this is really holding me up in my efforts to develop a linux port of my client.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    There's "scsi_id" for non-ata drives...

    gg

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Is it really appropriate to authenticate clients with host characteristics? What sort of system is this where the user doesn't matter in the authentication process?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by brewbuck View Post
    What sort of system is this where the user doesn't matter in the authentication process?
    the user matters, but the station is also important. different stations have different devices (bill acceptors, receipt printers, credit card readers, etc.) installed, some of which require that a persistent state be stored on the server, which demands that the server be able to positively identify which station it is talking to.

    as a workaround, I get the output of "uname -a" and hash it down to a 32-bit quantity and use that. it is not quite as unique as a volume serial number, but at least it doesn't change over time without a change of kernel.

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Newer Linux distributions allow you to mount drive partitions by "volume ID" -- these IDs will be visible in the /etc/fstab file. You might try checking there.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by brewbuck View Post
    Newer Linux distributions allow you to mount drive partitions by "volume ID" -- these IDs will be visible in the /etc/fstab file. You might try checking there.
    no such luck in this case. can you think of any other data that I can readily get from the system that is as unique as a volume serial number, aside from hostname and MAC?

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    You could do several things when you first run the program, and store the results in a file somewhere.

    - the 32-bit time of when the program was run.
    - the 32-bit value composed of the pid() and parent pid() of the registration task.
    - the 32-bit uptime at that moment.

    Or just use a uuid generator
    uuid_generate(3): create new unique UUID value - Linux man page
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Code:
    sudo vol_id --uuid /dev/sda1
    ?

  9. #9
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by cyberfish View Post
    Code:
    sudo vol_id --uuid /dev/sda1
    ?
    I downloaded and installed the rpm package for that program, and it seems to work, and may be exactly what the doctor ordered.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wireless Network Linux & C Testbed
    By james457 in forum Networking/Device Communication
    Replies: 3
    Last Post: 06-11-2009, 11:03 AM
  2. Number Guessing
    By blacknapalm in forum C Programming
    Replies: 2
    Last Post: 10-01-2008, 01:48 AM
  3. Linux serial port interrupts
    By danga1993 in forum Linux Programming
    Replies: 1
    Last Post: 04-28-2007, 11:15 AM
  4. Linux equivalent of con
    By dwks in forum Linux Programming
    Replies: 3
    Last Post: 11-12-2005, 11:58 AM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM