Drive letter assignment
In computer data storage, drive letter assignment is the process of assigning alphabetical identifiers to volumes. Unlike the concept of UNIX mount points, where volumes are named and located arbitrarily in a single hierarchical namespace, drive letter assignment allows multiple highest-level namespaces. Drive letter assignment is thus a process of using letters to name the roots of the "forest" representing the file system; each volume holds an independent "tree".
Origin
The concept of drive letters, as used today, presumably owes its origins to IBM's VM family of operating systems, dating back to CP/CMS in 1967, by way of Digital Research's CP/M. The concept evolved through several steps:- CP/CMS uses drive letters to identify minidisks attached to a user session. A full file reference consists of a filename, a filetype, and a disk letter called a filemode. 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 implemented a flat file system on each disk drive, where a complete file reference consists of a drive letter, a colon, a filename and a filetype ; for instance
A:README.TXT
. This usage was influenced by the device prefixes used in Digital Equipment Corporation's TOPS-10 operating system. - The drive letter syntax chosen for CP/M was inherited by Microsoft for its operating system MS-DOS by way of Seattle Computer Products' 86-DOS, and thus also by IBM's OEM version PC DOS. Originally, drive letters always represented physical volumes, but support for logical volumes eventually appeared.
- Through their designated position as DOS successor, the concept of drive letters was also inherited by OS/2 and the Microsoft Windows family.
Operating systems that use drive letter assignment
- CP/M, MP/M, Concurrent CP/M, Concurrent DOS, FlexOS, 4680 OS, 4690 OS, S5-DOS/MT, Multiuser DOS, System Manager, REAL/32, REAL/NG, Personal CP/M, S5-DOS, DOS Plus, DR DOS, Novell DOS, PalmDOS, OpenDOS families
- AMSDOS
- 86-DOS, MS-DOS, PC DOS families
- PC-MOS/386
- PTS-DOS, S/DOS
- FreeDOS
- GEMDOS, TOS, MiNT, MagiC, MultiTOS
- Atari DOS family
- MSX-DOS
- ANDOS, CSI-DOS, MK-DOS
- GEOS
- SymbOS
- OS/2, eComStation
- Windows 10
- Windows 9x family
- Windows NT family
- Xbox video game console operating system
- ReactOS
- Symbian OS
- DexOS
- TempleOS
Order of assignment
- Assign the drive letter A: to the first floppy disk drive, and B: to the second floppy disk drive. 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 partition recognized upon the first physical 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.
- 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 CONFIG.SYS via DEVICE statements, e.g. RAM disks.
- Assign subsequent drive letters to any dynamically loaded drives via CONFIG.SYS INSTALL statements, in AUTOEXEC.BAT or later, i.e. additional optical disc drives, PCMCIA / PC Card drives, USB or Firewire drives, or network drives.
- Only partitions of recognized partition types are assigned letters. In particular, "hidden partitions" are not.
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:.
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 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, 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 Windows NT and OS/2, the operating system uses the aforementioned algorithm to automatically assign letters to floppy disk drives, optical disc drives, the boot disk, and other recognized volumes that are not otherwise created by an administrator within the operating system. Volumes that are created within the operating system are manually specified, and some of the automatic drive letters can be changed. Unrecognized volumes are not assigned letters, and are usually left untouched by the operating system.
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. 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.
Another condition that can cause problems on Windows XP is when there are network drives defined, but in an error condition. 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.
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, ″ or ″, and possibly other types of disk drives, if present.
- B: — Reserved for a second floppy drive.
- C: — First hard disk partition.
- 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.
- 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 load drive under Concurrent DOS, Multiuser DOS, System Manager and REAL/32.
- M: — Drive letter for optionally memory drive MDISK under Concurrent DOS.
- N:, O:, P: — Assignable floating drives under CP/M-86 4.x, Personal CP/M-86 2.x, DOS Plus 1.1-2.1, a concept later extended to any unused drive letters under Concurrent DOS, Multiuser DOS, System Manager, REAL/32 and DR DOS up to 6.0.
- Q: — Microsoft Office Click-to-Run virtualization.
- U: — Unix-like unified filesystem with virtual directory
\DEV
for device files under MiNT, MagiC, and MultiTOS. - 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.
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.
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
LASTDRIVE=32
directive in order to allocate up to 32 drive letters, named A: to Z:, :, ^:, _: and `:. 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 added support for
LASTDRIVE=32
and LASTDRIVEHIGH=32
as well.If access to more filesystems than Z: is required under Windows NT, Volume Mount Points must be used. However, it is possible to mount non-letter drives, such as 1:, 2:, or !: using the command line
SUBST
utility in Windows XP or later, 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. DOS offers a JOIN command that allows access to an assigned volume through an arbitrary directory, similar to the Unix mount command. It also offers a SUBST command which allows the assignment of a drive letter to a directory. One or both of these commands were removed in later systems like OS/2 or Windows NT, but starting with Windows 2000, both are again supported: The SUBST command exists as before, while JOIN's functionality is subsumed in LINKD. In Windows Vista, the new command MKLINK can be used for this purpose. Also, Windows 2000 and later support mount points, accessible from the Control Panel.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
DOS Plus supports this for drive letters N:, O:, and P:. This feature is also present in Concurrent DOS, Multiuser DOS, System Manager 7, and REAL/32, however, these systems extend the concept to all unused drive letters from A: to Z:, except for the reserved drive letter L:. DR DOS 3.31 - 6.0 also supports this including drive letter L:. This feature is not available under DR DOS 6.0, PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, DR-DOS 7.02 and higher. Floating drives are implemented in the BDOS kernel, not in the command line shell, thus they can be used and assigned also from within applications when they use the "change directory" system call. However, most DOS applications are not aware of this extension and will consequently discard such directory paths as invalid. JP Software's command line interpreter 4DOS supports floating drives on operating systems also supporting it.
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. This load drive feature makes it easier to move software installations on and across disks without having to adapt paths to overlays, configuration files or user data stored in the load directory or subsequent directories.
In some versions of DR-DOS, the load path contained in the appendage to the environment passed to drivers can be shortened to that of a temporary substitute drive through the
INSTALL |INSTALL
/LOADHIGH
option /D
. 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.