Drive letter assignment
In
Origin
The concept of drive letters, as used today, presumably[
- CP/CMS uses drive letters to identify minidisks attached to a user session.[1]A full file reference (pathname in today's parlance) consists of a filename, a filetype, and a disk letter called a filemode (e.g. A or B). Minidisks can correspond to physical disk drives, but more typically refer to logical drives, which are mapped automatically onto shared devices by the operating system as sets of virtual cylinders.
- CP/CMS inspired numerous other operating systems, including the CP/M microcomputer operating system, which uses a drive letter to specify a physical storage device. Early versions of CP/M (and other microcomputer operating systems) implemented a 8-inch floppy disks, where such small namespaces did not impose practical constraints.) This usage was influenced by the device prefixes used in Digital Equipment Corporation's (DEC) TOPS-10 operating system.[2]
- The drive letter syntax chosen for CP/M was inherited by logical volumeseventually appeared.
- Through their designated position as DOS successor, the concept of drive letters was also inherited by OS/2 and the Microsoft Windows family.
The important capability of
Operating systems that use drive letter assignment
- CP/M family
- S5-DOS, DOS Plus
- AMSDOS
- DOS family
- PC DOS
- OpenDOS
- ROM-DOS
- S/DOS
- FreeDOS
- PC-MOS/386
- SISNE plus
- EmuTOS
- Atari DOS family
- MSX-DOS
- ANDOS, CSI-DOS, MK-DOS
- GEOS[3]
- OS/2 (including eComStation and ArcaOS)
- Windows family
- Windows 9x family
- Windows NT family
- Xbox system software
- ReactOS
- Symbian OS
- Hobbyist operating systems
Order of assignment
This section needs additional citations for verification. (February 2011) |
MS-DOS/PC DOS since version 5.0, and later operating systems, assigns drive letters according to the following algorithm:[4]
- Assign the drive letter A: to the first floppy disk drive(drive 0), and B: to the second floppy disk drive (drive 1). If only one physical floppy is present, drive B: will be assigned to a phantom floppy drive mapped to the same physical drive and dynamically assigned to either A: or B: for easier floppy file operations. If no physical floppy drive is present, DOS 4.0 will assign both A: and B: to the non-existent drive, whereas DOS 5.0 and higher will invalidate these drive letters. If more than two physical floppy drives are present, DOS versions prior to 5.0 will assign subsequent drive letters, whereas DOS 5.0 and higher will remap these drives to higher drive letters at a later stage; see below.
- Assign a drive letter to the first active primary hard disk. DOS 5.0 and higher will ensure that it will become drive C:, so that the boot drive will either have drive A: or C:.
- Assign subsequent drive letters to the first primary partition upon each successive physical hard disk drive (DOS versions prior to 5.0 will probe for only two physical hard disks, whereas DOS 5.0 and higher support eight physical hard disks).
- Assign subsequent drive letters to every recognized logical partition present in the first extended partition, beginning with the first hard drive and proceeding through successive physical hard disk drives.
- DOS 5.0 and higher: Assign drive letters to all remaining primary partitions, beginning with the first hard drive and proceeding through successive physical hard disk drives.
- DOS 5.0 and higher: Assign drive letters to all physical floppy drives beyond the second physical floppy drive.
- Assign subsequent drive letters to any block device drivers loaded in RAM disks.
- Assign subsequent drive letters to any dynamically loaded drives via CONFIG.SYS network drives.
- Only partitions of recognized partition types are assigned letters. In particular, "hidden partitions" (those with their type ID changed to an unrecognized value, usually by adding
10h
) are not.
MS-DOS/PC DOS versions 4.0 and earlier assign letters to all of the floppy drives before considering hard drives, so a system with four floppy drives would call the first hard drive E:. Starting with DOS 5.0, the system ensures that drive C: is always a hard disk, even if the system has more than two physical floppy drives.
While without deliberate remapping, the drive letter assignments are typically fixed until the next reboot, however, Zenith MS-DOS 3.21 will update the drive letter assignments when resetting a drive. This may cause drive letters to change without reboot if the partitioning of the harddisk was changed.
MS-DOS on the Apricot PC assigns letters to hard drives, starting with A:, before considering floppy drives. A system with two of each drive would call the hard drives A: and B:, and the floppies C: and D:.
On the Japanese PC-98, if the system is booted from floppy disk, the dedicated version of MS-DOS assigns letters to all floppy drives before considering hard drives; it does the opposite if it is booted from a hard drive, that is, if the OS was installed on the hard drive, MS-DOS would assign this drive as drive "A:" and a potentially existing floppy as drive "B:". The Japanese version of the Windows 95 SETUP program supports a special option /AT to enforce that Windows will be on drive C:.
Some versions of DOS do not assign the drive letter, beginning with C:, to the first active primary partition recognized upon the first physical hard disk, but on the first primary partition recognized of the first hard disk, even if it is not set active.
If there is more than one extended partition in a partition table, only the logical drives in the first recognized extended partition type are processed.
Some late versions of the DR-DOS IBMBIO.COM provide a preboot config structure, holding bit flags to select (beside others) between various drive letter assignment strategies. These strategies can be preselected by a user or OEM or be changed by a boot loader on the fly when launching DR-DOS. Under these issues, the boot drive can be different from A: or C: as well.
The drive letter order can depend on whether a given disk is managed by a boot-time driver or by a dynamically loaded driver. For example, if the second or third hard disk is of SCSI type and, on DOS, requires drivers loaded through the CONFIG.SYS file (e.g. the controller card does not offer on-board BIOS or using this BIOS is not practical), then the first SCSI primary partition will appear after all the IDE partitions on DOS. Therefore, DOS and for example OS/2 could have different drive letters, as OS/2 loads the SCSI driver earlier. A solution was not to use primary partitions on such hard disks.
In
A common problem that occurs with the drive letter assignment is that the letter assigned to a network drive can interfere with the letter of a local volume (like a newly installed CD/DVD drive or a USB stick). For example, if the last local drive is drive D: and a network drive would have been assigned as E:, then a newly attached USB mass storage device would also be assigned drive E: causing loss of connectivity with either the network share or the USB device. Users with administrative privileges can assign drive letters manually to overcome this problem.[5] Another condition that can cause problems on Windows XP is when there are network drives defined, but in an error condition (as they would be on a laptop operating outside the network). Even when the unconnected network drive is not the next available drive letter, Windows XP may be unable to map a drive and this error may also prevent the mounting of the USB device.[citation needed]
Common assignments
Applying the scheme discussed above on a fairly modern Windows-based system typically results in the following drive letter assignments:
- A: — Floppy disk drives, 3+1⁄2″ or 5+1⁄4″, and possibly other types of disk drives, if present.
- B: — Reserved for a second floppy drive (that was present on many PCs).
- C: — First hard diskpartition.
- D: to Z: — Other disk partitions get labeled here. Windows assigns the next free drive letter to the next drive it encounters while enumerating the disk drives on the system. Drives can be partitioned, thereby creating more drive letters. This applies to MS-DOS, as well as all Windows operating systems. Windows offers other ways to change the drive letters, either through the Disk Management snap-in or
diskpart
. MS-DOS typically uses parameters on the line loading device drivers inside the CONFIG.SYS file.
Case-specific drive letters:
- F: — First network drive if using Novell NetWare.
- G: — "Google Drive File Stream" if using Google Drive.
- H: — "Home" directory on a network server.
- L: — Dynamically assigned
- M: — Drive letter for optionally memory drive MDISK under Concurrent DOS.[6]
- N:, O:, P: — Assignable
- Q: — Microsoft Office Click-to-Run virtualization.
- U: — Unix-like unified filesystem with virtual directory
\DEV
for - Z: — First network drive if using Banyan VINES, and the initial drive letter assignment for the virtual disk network in the DOSBox x86 emulator. It is also the first letter selected by Windows for network resources, as it automatically selects from Z: downwards. By default, Wine maps Z: to the root of the UNIX directory tree.[10]
When there is no second physical floppy drive, drive B: can be used as a "virtual" floppy drive mapped onto the physical drive A:, whereby the user would be prompted to switch floppies every time a read or write was required to whichever was the least recently used of A: or B:. This allows for much of the functionality of two floppy drives on a computer that has only one. This concept of multiple drive letters sharing a single physical device (optionally with different "views" of it) is not limited to the first floppy drive, but can be utilized for other drives as well by setting up additional block devices for them with the standard DOS DRIVER.SYS in CONFIG.SYS.
Network drives are often assigned letters towards the end of the alphabet. This is often done to differentiate them from local drives: by using letters towards the end, it reduces the risk of an assignment conflict. It is especially true when the assignment is done automatically across a network (usually by a logon script).
In most DOS systems, it is not possible to have more than 26 mounted drives. Atari GEMDOS supports 16 drive letters A: to P: only. The PalmDOS PCMCIA driver stack supports drive letters 0:, 1:, 2:, ... to address PCMCIA drive slots.
Some Novell network drivers for DOS support up to 32 drive letters under compatible DOS versions. In addition, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 genuinely support a CONFIG.SYS
directive in order to allocate up to 32 drive letters, named A: to Z:, [:, \:, ]:, ^:, _: and `:. (DR-DOS 7.02-7.07 also supports HILASTDRIVE
and LASTDRIVEHIGH
directives in order to relocate drive structures into upper memory.) Some DOS application programs do not expect drive letters beyond Z: and will not work with them, therefore it is recommended to use them for special purposes or search drives.
JP Software's 4DOS command line processor supports drive letters beyond Z: in general, but since some of the letters clash with syntactical extensions of this command line processor, they need to be escaped in order to use them as drive letters.
Windows 9x (MS-DOS 7.0/MS-DOS 7.1) added support for LASTDRIVE=32
and LASTDRIVEHIGH=32
as well.
If access to more filesystems than Z: is required under Windows NT,
SUBST
SUBST 1: C:\TEMP
), but it is not officially supported and may break programs that assume that all drives are letters A: to Z:.
ASSIGN, JOIN and SUBST in DOS and Windows
Drive letters are not the only way of accessing different volumes.
Many operating systems originating from Digital Research provide means to implicitly assign substitute drives, called floating drives in DRI terminology, by using the CD/CHDIR command in the following syntax:
CD N:=C:\SUBDIR
In a similar feature, Concurrent DOS, Multiuser DOS, System Manager and REAL/32 will dynamically assign a drive letter L: to the load path of a loaded application, thereby allowing applications to refer to files residing in their load directory under a standardized drive letter instead of under an absolute path.SUBST B: C:\DIR
) through the LOADHIGH
option /D[:loaddrive]
(for B:TSR.COM
instead of, say, C:\DIR\TSR.COM
). This can be used to minimize a driver's effective memory footprint, if the executable is located in a deep subdirectory and the resident driver happens to not need its load path after installation any more.[12][13][14][15]
See also
- Drive mapping
- Filename
- net (command) (A command in Microsoft Windows that can be used for viewing/controlling drive-letter assignments for network drives)
- Portable application
References
- ^ DuCharme, Bob (2001). "VM/CMS" (PDF). The Operating System Handbook, or, Fake Your Way Through Minis and Mainframes.
- ^ Johnson, Herbert R. (2009-01-04). "CP/M and Digital Research Inc. (DRI) History". www.retrotechnology.com. Retrieved 2009-01-28.
- ^ "GEOS".
- ^ "Order in Which MS-DOS and Windows Assign Drive Letters". Support Online from Microsoft Technical Support. Microsoft. 1996-04-17. Archived from the original on 1999-02-18. Retrieved 2021-01-06.
- ^ "Change a drive letter". Microsoft. Retrieved 2019-03-04.
- ^ a b c Concurrent DOS 386 - Multiuser/Multitasking Operating System - User Guide (PDF). Digital Research.
- ^ a b c d Concurrent DOS 386 - Multiuser/Multitasking Operating System - Reference Manual (PDF). Digital Research. 1987.
- ^ "The drive U: in MagiC". 2016-03-28. Archived from the original on 2017-01-15. Retrieved 2017-01-09.
- ^ "FreeMiNT-Portal - mint.doc". 2000-04-27. Archived from the original on 2017-01-15. Retrieved 2017-01-09.
- ^ "Wine FAQ".
- ^ "simple volumes". Microsoft TechNet. Archived from the original on 2007-03-26. Retrieved 2006-12-01.
- ^ Paul, Matthias R. (1997-10-02). "Caldera OpenDOS 7.01/7.02 Update Alpha 3 IBMBIO.COM README.TXT". Archived from the original on 2003-10-04. Retrieved 2009-03-29. [1]
- OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger
MPDOSTIP.ZIP
collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of theNWDOSTIP.TXT
file.) - ^ Paul, Matthias R. (1997-05-27) [1996]. "SETENV v1.11". Archived from the original on 2009-02-15. Retrieved 2019-07-29.
- ^ Paul, Matthias R. (2002-10-07). "Re: Run a COM file". alt.msdos.programmer. Archived from the original on 2017-09-03. Retrieved 2017-09-03. [2]