Re: ボリュームシリアル番号について
投稿者の自己フォローです。
Volume Serial Number でWebを検索すると,以下の情報が見つかりました。
ボリュームシリアル番号はMS社由来のものであるらしい。
(Pc_Unixのext2やufsのファイルシステムには,無い概念かもしれない?)
以下の文章からは,
ボリュームシリアル番号は,
1)Format, DiskCopy で生成される
2)その内容は,生成した日時を元に,作成される
ということから,結局,
ボリュームシリアル番号は,日時情報であった
ことが分かりました。
DosではInt21hを利用して,Readするようですが,
LinuxやFreeBSDで,できるのかしら?
- - - - -
FM: H.Shiozaki
E-Mail: sios_hs@yahoo.co.jp
URL: http://www.geocities.jp/sios_hp/
-----
29.1 VOLUME SERIAL NUMBER FORMAT
The volume serial number was introduced with DOS 4.0 as part of an extended
boot record and is created through you either FORMAT a disk or use DISKCOPY
to create another disk. The serial number is a function of the time/date
of the formatting or the diskcopying. Note that DISCOPY generates a new
volume serial number so a DISKCOPY is not an exact image of the source
diskette.
29.2 CALCULATING THE VOLUME SERIAL NUMBER
For example, say a disk was formatted on 26 Dec 95 at 9:55 PM and 41.94
seconds. DOS takes the date and time just before it writes it to the disk.
Low order word is calculated: Volume Serial Number is:
Month & Day 12/26 0c1ah
Sec & Hundrenths 41:94 295eh 3578:1d02
-----
3578h
High order word is calculated:
Hours & Minutes 21:55 1537h
Year 1995 07cbh
-----
1d02h
Note that DOS interrupt 21h Functions 2ah, Get DOS Date, and 2ch, Get DOS
Time, are particularily suited to getting the date and time for calculating
the Volume Serial Number.
29.3 READING AND SETTING THE VOLUME SERIAL NUMBER
To read the Volume Serial Number, use the IOCTL call, int 21h function
440dh Minor Code 66h, Get Media ID. To write the Volume Serial Number, use
the IOCTL call, int 21h function 440dh Minor Code 46h, Set Media ID.
WARNING! These IOCTL calls use a structure that also contain the volume
label and file system type. So that you do not create errors with these
values, I recommend that you always Minor Code 66h to initialize the
structure before setting the Volume Serial Number to a new value and
writing it back to the disk.
Contributor: Raymond Moon, raymoon@moonware.dgsys.com
Last changed: 17 Feb 96
------------------------------
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735