PPRuNe Forums - View Single Post - How do I clone a drive?
View Single Post
Old 25th November 2002 | 19:18
  #6 (permalink)  
Mac the Knife

Plastic PPRuNer
25 Anniversary
 
Joined: Sep 2000
Posts: 1,902
Likes: 0
From: Rochechouart, France
Well, this IS interesting! After a bit of Googling, a follow-up for fellow-nerds.

There seem to be FOUR ways of identifying the HDD for the OS.

Volume label - soft coded - read/write - non-unique
VolumeID or format serial number - soft coded - read/(write) - "unique"
Drive Model number - hard coded?(where?) - read only (non-unique)
Drive serial number - hard coded? (where?) - read only (unique?)

First, the volume LABEL - the label is used for rudimentary checking that the volume is the correct/expected one but this is only reliable on closed CD type volumes and isn't a solid security check, just a quick is-it-the-right-one? glance. A volume doesn't HAVE to have a label.

Second, the Volume ID (or format serial number) - this is the 32bit xxxx-xxxx Hex number that you see under the label name when you type VOL <enter> at a command(DOS) window. It can be accessed by a GetVolumeInformation call. All volumes will have a VolumeID and it cannot normally be changed - here is some history.

"The volume [or format] serial number [or Volume ID] was added to the standard format for IBM PC-compatible disks in 1987, when Microsoft and IBM were co-developing OS/2. They wanted the system to operate like the Macintosh, which automatically recognized which diskette (or removable disk cartridge) had been inserted in a drive.

But there was a problem. Up to that point, the only identifying information on an IBM-compatible disk was its volume label -- a name given to the disk by the user. If the user declined to assign names to disks, or gave more than one disk the same name, there was no way to tell them apart. (I scrambled many a disk in those days when I inserted the wrong one at the wrong moment.)

So, the two companies decided to change the disk formats for both MS-DOS and OS/2 to include a four-byte number called the "volume serial number." When a disk was formatted, it would be stamped with this number, which was constructed from the exact date and time the format operation was performed. (The odds of two disks getting the same number were virtually nil on the same machine, and were still small even if users exchanged disks with one another.) When a diskette was reproduced by the operating system's disk copying program (DISKCOPY), the program would make a faithful copy of every byte on the entire disk except for the volume serial number, which would be changed to something different than the one on the original diskette.

This scheme worked well, but it wasn't long before some enterprising software vendors noticed that they could use the volume serial number to enforce a weak form of copy protection. They created programs that simply refused to run if the current disk had a volume serial number that was different from the number of the floppy disk on which the program was shipped -- or the hard disk on which it was first installed. Users who upgraded their systems, or who restored from backups after a disk crashed or was reformatted, found that the software wouldn't work."

FAT32 disks are structured differently from those formatted under earlier file systems, and the VSN is in a different place. NTFS is different too, so old FAT-16 utilities either won't work or will ferk the drive. Some cloning software MAY copy the Volume ID to the target disk, but there doesn't seem be any consistency across the board. AFAIK most don't. If you absolutely MUST have the same volume ID then use a disk sector editor (careful!) or VOLUMEID mentioned previously. Win9x may record the HDD volume ID somewhere, but it isn't in the Registry. But Win9x/XP and installable apps probably use this as part of install-from-CD security schemes.

Thirdly, the drive Model number such as WDC WD300BB-00CCB0 - this is hard-coded somewhere on the drive, probably in the IDE ROM. This is readable and, Win9x records this and it is listed in the Registry under the HKEY_LOCAL_MACHINE\enum\SCSI\ key as Manufacturer=WDC WD30 and ProductID=0BB-00CCBO. Not all disks have a ProductID and Win9x probably does not use this as a hard ID code since this seems to be common for all identical models (though XP might).

Fourthly, the drive serial number, again this is hard-coded somewhere on the drive, probably in the IDE ROM. I don't know how standardised this is among drive makers. Win9x does not appear to record this, though XP may well track it as an antipiracy measure.

Lynn McGuire has writen a neat 32bit console app. [diskID32] that will read all these numbers for you. See http://www.codeguru.com/system/DiskId32.shtml.

Example output of diskid32:

Primary Controller - Master drive

Drive Model Number________________: WDC WD300BB-00CCB0
Drive Serial Number_______________: WD-WMA9U1340730
Drive Controller Revision Number__: 22.04A22
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Physical Geometry: 16383 Cylinders 16 Heads 63 sectors per track

Computer ID_______________________: 195487034
Mac the Knife is offline