LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-06-2005, 02:46 PM   #1
nvbauer
LQ Newbie
 
Registered: Feb 2005
Posts: 11

Rep: Reputation: 0
edit volume serial number (VSN) on floppy disk


OK, I have Googled till my fingers nearly fell off. I need to change the VSN on a floppy disk (not to be confused with the Volume Label). Does anyone have a clue as to how I can go about this?

Thanks,

Norm
 
Old 07-08-2005, 09:05 AM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Interesting problem, I did some Googling too ...

http://www.pcbuyerbeware.co.uk/Produ...tion.htm#oempa has some interesting background info. 11

If you're willing to use a free ($0) M$ based program, look into VolumeID from SysInternals: http://www.sysinternals.com/Utilities/VolumeId.html
There are several flaws to this:
* No source
* Access to an actual M$ box
* Use dosemu
* Use WINE

However, there is a GNU/Linux solution too. The key is to find out exactly where on the floppy the VSN is stored. I know it's somewhere in the boot record (BR) (the 1st sector), but which of the 512 bytes. I finally found the answer here: http://www.geocities.com/thestarman3/DOS/bd98/SD2.htm, look at the 2nd illustration (http://www.geocities.com/thestarman3...FAT12BRhex.gif). The site has bandwidth limits & sometimes is hard to display; but don't worry, I will duplicate it below.

Here is a list of the tools you will need:
* dd
* hd (hexdump)
* head
* hexedit
* mdir, from mtools -- semi-optional

Overview of the steps in the process:
* Prepare
* Examine
* Verify
* Extract
* Edit
* "Install"
* Verify


Prepare
---------
Read the rest of these instructions.
Install the tools you lack.
RTFM for the ones you are not familiar with.
My apologies if this seems too obvious to mention, I mean no insult.


Examine
---------
Code:
$ dd if=/dev/floppy bs=512 count=1 skip=0  | hd  | head -3
1+0 records in
1+0 records out
512 bytes transferred in 0.875321 seconds (585 bytes/sec)
00000000  eb 3e 90 2a 7a 58 2f 55  49 48 43 00 02 01 01 00  |ë>.*zX/UIHC.....|
00000010  02 e0 00 40 0b f0 09 00  12 00 02 00 00 00 00 00  |.à.@.ð..........|
00000020  00 00 00 00 00 00 29 14  23 07 1b 4e 4f 20 4e 41  |......).#..NO NA|
Here is the prize "secret": the VSN is bytes 0000002A - 00000027. Notice that I show the locations backwards, that's because the order in the BR is reversed.

The raw VSN for my target floppy is 14 23 07 1b.


Verify
---------
Code:
$ mdir A:  | head -2
 Volume in drive A has no label
 Volume Serial Number is 1B07-2314
Notice that 1B07-2314 == 14 23 07 1b; except for order, case, & punctuation.


Extract
---------
Code:
$ dd if=/dev/floppy bs=1 count=4 skip=39  | hd
4+0 records in
4+0 records out
4 bytes transferred in 0.792846 seconds (5 bytes/sec)
00000000  14 23 07 1b                                       |.#..|
00000004

$ dd if=/dev/floppy bs=1 count=4 skip=39  > floppy.vsn
4+0 records in
4+0 records out
4 bytes transferred in 0.876638 seconds (5 bytes/sec)
What I did here was narrow the focus of my 'dd' command to just the VSN & put it in a file for editing. The 1st block of code is to verify that my new 'dd' parameters are doing what I intend. Obviously (again, no insult intended) 'floppy.vsn' is an arbitrary filename; you can use anything that makes sense to you.


Edit
---------
Code:
hexedit floppy.vsn
Edit away, here is a condensed view of the hexedit screen:
Code:
00000000   14 23 07 1B                                         .#..
00000010
		[snip/]  # empty rows omitted
00000190
000001A0
---  floppy.vsn       --0x0/0x4------------------------------------------------
The instructions for hexedit, although new to me, are fairly simply -- you shouldn't have any difficulty with this. One warning don't change the length of the file. If your new VSN is longer than the old, you will overwrite important data in the BR of your floppy in the next step.


"Install"
---------
(If someone has a better name for this step, please let me know.)
Code:
$ dd of=/dev/floppy bs=1 count=4 skip=39  < floppy.vsn
This is just the reverse of the Extract step: We output to, instead of input from, the floppy (if => of); & we redirect from (<) instead of into (>) our edit file.


Verify
---------
Code:
$ mdir A:  | head -2
You should now see your new VSN in place.


Warning
---------
All of the code except the last 2 steps was copied from the terminal window(s) where I tested/developed it. I did NOT actually go through with changing the VSN on my target floppy -- it has important data on it & was write protected throughout the process. However, I think I have enough experience with 'dd' to believe that it will work as intended. I suggest you play with this on a "throw-down" floppy, perhaps several times, before you risk an important one. As always, a backup is strongly recommended. Again, as always: "If it breaks, you get to keep the pieces."

Copyright (c) 2005 F. A. Archibald III, All rights reserved
 
Old 07-08-2005, 05:01 PM   #3
vimico
Member
 
Registered: Jan 2004
Distribution: Debian, Ubuntu
Posts: 118

Rep: Reputation: 15
Just for your information:

If you needn't preserve the content of the floppy, you can set the volume-id during formatting using the option -i of mkdosfs .
 
Old 07-08-2005, 06:46 PM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Thanks. I didn't know that. Of course, I assume when someone says "edit" ...
 
Old 08-01-2005, 12:13 PM   #5
ubuntu-norm
LQ Newbie
 
Registered: Jul 2005
Posts: 14

Rep: Reputation: 0
Thanks

archtoad6

I just wanted to thank you for posting this. It was great. I did try it, though I was insuccessfull at updateing the MBR When I got to

Code:
dd of=/dev/fd0 bs=1 count=4 skip=39 < floppy.vsa

It did not update the VSN in the MBR. That being said, it introduced a lot of new concepts that are just too cool. I again thank you for your time. I am still looking for the right answer and you have lead me down that direction.

Best regards,

Norm

PS: I had to start a new account. I used to be nvbauer and before that Norman-drake9.

I am not a
 
Old 08-03-2005, 08:04 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Damn, right where I didn't dare do a live test.

I assume your floppy wasn't write protected.

Was there any interesting output? or did it just fail the verify step?
 
Old 08-03-2005, 08:18 AM   #7
ubuntu-norm
LQ Newbie
 
Registered: Jul 2005
Posts: 14

Rep: Reputation: 0
Quote:
Originally posted by archtoad6
Damn, right where I didn't dare do a live test.

I assume your floppy wasn't write protected.

Was there any interesting output? or did it just fail the verify step?
You are correct. It is not write protected. And it did not give any errors, it just did not work. Acted like it worked, but when I verified it, same old VSN.
 
Old 08-03-2005, 08:38 AM   #8
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Any chance of a failure in the edit of "floppy.vsa"?

I notice that you show "floppy.vsa", where I had "floppy.vsn"; any chance the problem is a typo?
 
Old 08-03-2005, 08:48 AM   #9
ubuntu-norm
LQ Newbie
 
Registered: Jul 2005
Posts: 14

Rep: Reputation: 0
Quote:
Originally posted by archtoad6
Any chance of a failure in the edit of "floppy.vsa"?

I notice that you show "floppy.vsa", where I had "floppy.vsn"; any chance the problem is a typo?
No, I actualy used just "vsn" as the file. As what to name the file really does not matter, the shorter the better.
 
Old 08-03-2005, 09:13 AM   #10
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
I'm going to a Linux workshop tonight, I'll try to remember to ask there.
 
Old 08-11-2005, 03:19 PM   #11
ubuntu-norm
LQ Newbie
 
Registered: Jul 2005
Posts: 14

Rep: Reputation: 0
Interstingly enough. I googled the heck out of this and ran across a nice little utility that is 1. Open Source 2. written in C++ 3. written for MS of alll things. Its called VolumeSerial.exe http://www.codeproject.com/system/change_drive_sn.asp its a great little tutoruial if your into C++ .

It worked like a charm. Except that I still can't fool the application that I was trying to fool, into believeing that it's the real master disk. Which I'm not entirely sure why not yet. I now have a bit by bit duplicate, right down to the VSN.

Something else I dont understand. The master disk in which the license key came on can not even be seen under Windows. Acts as though the floppy has not been formated. How ever I can mount the FS in Linux and everything is there.

Can anyone 'splain that one. And even better how to reair the original disk????

Norm
 
Old 08-12-2005, 07:44 AM   #12
ubuntu-norm
LQ Newbie
 
Registered: Jul 2005
Posts: 14

Rep: Reputation: 0
Forgot to mention that I get a Cyclical Redundency Check error in Windows. I did my searching on that as well, so I know what it is, but don't know how to correct it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
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
VMware - Mandrake 9.2 -Serial Number ron_hickson Mandriva 7 08-16-2004 10:33 AM
how do you edit your virtual console number? (or VT number 3) jjorloff1 Linux - General 2 04-03-2004 07:21 PM
Find Serial Number of Machine zael Programming 4 10-27-2003 12:39 PM
Floppy serial number k__ Linux - General 1 06-29-2002 10:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:33 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