MS-DOS 6.22 Volume Label Changes on Logical Drives
In MS-DOS 6.22, changing the volume label of an active logical drive
is handled via the external LABEL utility, which modifies
specific metadata structures within the FAT12 or FAT16 file systems
without requiring an unmount or system reboot. The operating system
executes these modifications by searching and updating a special
directory entry with a volume attribute in the root directory while
concurrently updating the volume label field within the partition's
Extended BIOS Parameter Block (EBPB) in the boot sector. Because MS-DOS
6.22 operates as a single-tasking operating system, it writes these
changes directly to disk and flushes associated disk caches to ensure
volume integrity.
The Role of the LABEL Command
MS-DOS 6.22 does not allow native internal commands (such as
DIR or VOL) to alter a volume label; it relies
entirely on the external utility LABEL.EXE. When invoked
using the syntax LABEL [drive:][new_label], the utility
first verifies whether the target logical drive is a valid, writable
local volume. If no label is specified in the command arguments, MS-DOS
displays the current label, serial number, and prompts the user to enter
an 11-character string or delete the existing one.
Dual-Location Metadata Updates
When modifying the label on an active FAT partition, MS-DOS 6.22 updates two separate locations to maintain backward and forward compatibility:
The Root Directory Entry:
The primary storage location for the volume label is an entry in the partition’s root directory table. MS-DOS searches the root directory for an entry where the file attribute byte is set to0x08(ATTR_VOLUME_ID).- If a volume entry already exists, MS-DOS updates the 11-byte name field with the new user-defined string.
- If the user chooses to delete the label, the first byte of this
entry is marked with
0xE5to signify a deleted entry. - If no volume entry exists, MS-DOS allocates the first available
entry in the root directory, writes the label string, and sets the
attribute flag to
0x08.
The Extended BIOS Parameter Block (EBPB):
The boot sector (Logical Sector 0 of the partition) contains an EBPB structure introduced with DOS 4.0. At offset0x2B, an 11-byte field stores the volume label string. WhenLABEL.EXEexecutes, MS-DOS issues low-level absolute disk read and write interrupts (typicallyINT 25handINT 26hor DOS generic IOCTLINT 21h, Function 440Dh) to read the boot sector into memory, alter the 11 bytes at offset0x2Bto mirror the new root directory entry, and rewrite the boot sector to disk.
Single-Tasking State and Partition Activity
Because MS-DOS 6.22 is a single-tasking, non-preemptive environment,
an "active" logical drive merely indicates that the partition is mapped
to a drive letter and available for file input/output operations. There
is no active filesystem locking mechanism by default unless
SHARE.EXE is loaded.
- Drive Access: Changing a volume label on an active
drive does not disrupt active working directories. A user can reside
inside a subdirectory on
D:\(for example,D:\GAMES) and executeLABEL D: MYDRIVEwithout causing errors or changing the current working directory path. - Cache Management: If the SMARTDrive disk-caching
utility (
SMARTDRV.EXE) is running, MS-DOS ensures that the modified root directory sectors and boot sector are marked dirty and committed directly to the physical storage device, preventing discrepancies between cache and disk.
Restrictions and Error Handling
MS-DOS 6.22 applies specific operational checks before committing volume label changes on logical partitions:
- Character Restrictions: Labels are limited to 11
characters conforming to the FAT 8.3 character set rules (spaces are
permitted, but control characters and symbols like
*,?,/,\,|, and.are rejected). - Write Protection: If the underlying physical media is write-protected or marked read-only, MS-DOS aborts the operation and returns a write-fault error.
- Network and Substituted Drives: The
LABELcommand refuses to modify active drives created viaSUBSTor network shares redirected using the Microsoft Network Client, returning an error that the operation is unsupported on the specified drive.