LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-29-2002, 04:50 PM   #1
k__
LQ Newbie
 
Registered: Jun 2002
Posts: 1

Rep: Reputation: 0
Question Floppy serial number


Does anybody know how to get volume serial number of a floppy disc? I'm writing a C program that is supposed to run under linux and I can't find the proper library... also a linux command will do.

Thx
 
Old 06-29-2002, 10:29 PM   #2
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
It sounds like you are referring to the FAT file system from DOS. That number I believe is generated when the disk is formatted and it changes when the disk is formatted again. I do not know of a Linux command to do it. Perhaps there is a lib call, you might review some of the source files for the DOS utils in the /sbin directory, like mkdosfs. The man page (man 8 mkdosfs) reports an option for a 32 bit hex number that defaults to the file system creation time.

I would suppose it to be written in the first block of the disk. You could use something like:

dd if=/dev/fd0 of=dosdisk.id count=1

That would read the first block of the disk into the file named dosdisk.id. You could then us "vi" to view the file. The command vi normally points to elvis and it will display the file in a hex style similar to the DOS debug program.

For your program, then create a function that would perform a direct read of the first block into a buffer and parse out the number desired.

Perhaps another LQ viewer will have a more elegant solution.

Good luck!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nero 2.0.0.3 serial number TigerLinux Linux - Software 13 10-20-2005 03:13 AM
edit volume serial number (VSN) on floppy disk nvbauer Linux - Hardware 11 08-12-2005 07:44 AM
VMware - Mandrake 9.2 -Serial Number ron_hickson Mandriva 7 08-16-2004 10:33 AM
Find Serial Number of Machine zael Programming 4 10-27-2003 12:39 PM
Reading the HDD serial number DJFauß Linux - Hardware 1 06-06-2002 01:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration