Drive letter assignment

Last updated

MS-DOS command prompt with drive letter C as part of the current working directory. StartingMsdos.png
MS-DOS command prompt with drive letter C as part of the current working directory.
File Manager displaying the contents of drive C. WinFile 10.0 Screen.PNG
File Manager displaying the contents of drive C.

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" (or, for non-hierarchical file systems, an independent list of files).

Contents

Origin

The concept of drive letters, as used today, presumably[ citation needed ] owes its origins to IBM's VM family of operating systems, dating back to CP/CMS in 1967 (and its research predecessor CP-40), by way of Digital Research's (DRI) CP/M. The concept evolved through several steps:

The important capability of hierarchical directories within each drive letter was initially absent from these systems. This was a major feature of UNIX and other similar operating systems, where hard disk drives held thousands (rather than tens or hundreds) of files. Increasing microcomputer storage capacities led to their introduction, eventually followed by long filenames. In file systems lacking such naming mechanisms, drive letter assignment proved a useful, simple organizing principle.

Operating systems that use drive letter assignment

Order of assignment

MS-DOS/PC DOS since version 5.0, and later operating systems, assigns drive letters according to the following algorithm: [4]

  1. 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.
  2. 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:.
  3. 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).
  4. 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.
  5. 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.
  6. DOS 5.0 and higher: Assign drive letters to all physical floppy drives beyond the second physical floppy drive.
  7. Assign subsequent drive letters to any block device drivers loaded in CONFIG.SYS via DEVICE statements, e.g. RAM disks.
  8. 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 (MSCDEX etc.), PCMCIA / PC Card drives, USB or Firewire drives, or network drives.

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 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 (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:

Case-specific drive letters:

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 LASTDRIVE=32 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, Volume Mount Points must be used. [11] 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 (i.e. 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. 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 (part of the Windows Resource Kit). 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:. [7] DR DOS 3.31 - 6.0 (up to the 1992-11 updates with BDOS 6.7 only) also supports this including drive letter L:. This feature is not available under DR DOS 6.0 (1992 upgrade), 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. [7] 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. (For similar reasons, the appendage to the environment block associated with loaded applications under DOS 3.0 (and higher) contains a reference to the load path of the executable as well, however, this consumes more resident memory, and to take advantage of it, support for it must be coded into the executable, whereas DRI's solution works with any kind of applications and is fully transparent to users as well.) 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 (e.g. SUBST B: C:\DIR) through the INSTALL[HIGH] / 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

Related Research Articles

<span class="mw-page-title-main">DR-DOS</span> MS-DOS-like operating system

DR-DOS is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-DOS.

AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file redirection.

Disk formatting is the process of preparing a data storage device such as a hard disk drive, solid-state drive, floppy disk, memory card or USB flash drive for initial use. In some cases, the formatting operation may also create one or more new file systems. The first part of the formatting process that performs basic medium preparation is often referred to as "low-level formatting". Partitioning is the common term for the second part of the process, dividing the device into several sub-devices and, in some cases, writing information to the device allowing an operating system to be booted from it. The third part of the process, usually termed "high-level formatting" most often refers to the process of generating a new file system. In some operating systems all or parts of these three processes can be combined or repeated at different levels and the term "format" is understood to mean an operation in which a new disk medium is fully prepared to store files. Some formatting utilities allow distinguishing between a quick format, which does not erase all existing data and a long option that does erase all existing data.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

<span class="mw-page-title-main">TRSDOS</span> Operating system for Tandy TRS-80 computers

TRSDOS is the operating system for the Tandy TRS-80 line of eight-bit Zilog Z80 microcomputers that were sold through Radio Shack from 1977 through 1991. Tandy's manuals recommended that it be pronounced triss-doss. TRSDOS should not be confused with Tandy DOS, a version of MS-DOS licensed from Microsoft for Tandy's x86 line of personal computers (PCs).

CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS during boot. CONFIG.SYS was introduced with DOS 2.0.

AUTOEXEC.BAT is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device. The name of the file is an abbreviation of "automatic execution", which describes its function in automatically executing commands on system startup; the filename was coined in response to the 8.3 filename limitations of the FAT file system family.

<span class="mw-page-title-main">IBMBIO.COM</span> System file (DOS BIOS) in PC DOS and DR-DOS

IBMBIO.COM is a system file in many DOS operating systems. It contains the system initialization code and all built-in device drivers. It also loads the DOS kernel (IBMDOS.COM) and optional pre-loadable system components, displays boot menus, processes configuration files and launches the shell.

<span class="mw-page-title-main">DOS Plus</span> Discontinued computer operating system for x86 processors

DOS Plus was the first operating system developed by Digital Research's OEM Support Group in Newbury, Berkshire, UK, first released in 1985. DOS Plus 1.0 was based on CP/M-86 Plus combined with the PCMODE emulator from Concurrent PC DOS 4.11. While CP/M-86 Plus and Concurrent DOS 4.1 still had been developed in the United States, Concurrent PC DOS 4.11 was an internationalized and bug-fixed version brought forward by Digital Research UK. Later DOS Plus 2.x issues were based on Concurrent PC DOS 5.0 instead. In the broader picture, DOS Plus can be seen as an intermediate step between Concurrent CP/M-86 and DR DOS.

In computer data storage, a volume or logical drive is a single accessible storage area with a single file system, typically resident on a single partition of a hard disk. Although a volume might be different from a physical disk drive, it can still be accessed with an operating system's logical interface. However, a volume differs from a partition.

A disk compression software utility increases the amount of information that can be stored on a hard disk drive of given size. Unlike a file compression utility, which compresses only specified files—and which requires the user to designate the files to be compressed—an on-the-fly disk compression utility works automatically through resident software without the user needing to be aware of its existence. On-the-fly disk compression is therefore also known as transparent, real-time or online disk compression.

In computing, SUBST is a command on the DOS, IBM OS/2, Microsoft Windows and ReactOS operating systems used for substituting paths on physical and logical drives as virtual drives.

Drive mapping is how MS-DOS and Microsoft Windows associate a local drive letter with a shared storage area to another computer over a network. After a drive has been mapped, a software application on a client's computer can read and write files from the shared storage area by accessing that drive, just as if that drive represented a local physical hard disk drive.

The partition type in a partition's entry in the partition table inside a master boot record (MBR) is a byte value intended to specify the file system the partition contains or to flag special access methods used to access these partitions.

<span class="mw-page-title-main">MSCDEX</span>

MSCDEX or Microsoft CD-ROM Extensions is a software program produced by Microsoft and included with MS-DOS 6.x and certain versions of Windows to provide CD-ROM support. Earlier versions of MSCDEX since 1986 were installable add-ons for MS-DOS 3.1 and higher.

FlexOS is a discontinued modular real-time multiuser multitasking operating system (RTOS) designed for computer-integrated manufacturing, laboratory, retail and financial markets. Developed by Digital Research's Flexible Automation Business Unit in Monterey, California, in 1985, the system was considered to become a successor of Digital Research's earlier Concurrent DOS, but with a new, modular, and considerably different system architecture and portability across several processor families. Still named Concurrent DOS 68K and Concurrent DOS 286, it was renamed into FlexOS on 1 October 1986 to better differentiate the target audiences. FlexOS was licensed by several OEMs who selected it as the basis for their own operating systems like 4680 OS, 4690 OS, S5-DOS/MT and others. Unrelated to FlexOS, the original Concurrent DOS system architecture found a continuation in successors like Concurrent DOS XM and Concurrent DOS 386 as well.

<span class="mw-page-title-main">MS-DOS</span> Microsofts discontinued operating system

MS-DOS is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few operating systems attempting to be compatible with MS-DOS, are sometimes referred to as "DOS". MS-DOS was the main operating system for IBM PC compatibles during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system.

<span class="mw-page-title-main">DOS</span> Group of closely related IBM PC-compatible operating systems

DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR-DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.

The FAT file system is a file system used on MS-DOS and Windows 9x family of operating systems. It continues to be used on mobile devices and embedded systems, and thus is a well suited file system for data exchange between computers and devices of almost any type and age from 1981 through the present.

References

  1. DuCharme, Bob (2001). "VM/CMS" (PDF). The Operating System Handbook, or, Fake Your Way Through Minis and Mainframes.
  2. Johnson, Herbert R. (2009-01-04). "CP/M and Digital Research Inc. (DRI) History". www.retrotechnology.com. Retrieved 2009-01-28.
  3. "GEOS".
  4. "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.
  5. "Change a drive letter". Microsoft . Retrieved 2019-03-04.
  6. 1 2 3 Concurrent DOS 386 - Multiuser/Multitasking Operating System - User Guide (PDF). Digital Research.
  7. 1 2 3 4 Concurrent DOS 386 - Multiuser/Multitasking Operating System - Reference Manual (PDF). Digital Research. 1987.
  8. "The drive U: in MagiC". 2016-03-28. Archived from the original on 2017-01-15. Retrieved 2017-01-09.
  9. "FreeMiNT-Portal - mint.doc". 2000-04-27. Archived from the original on 2017-01-15. Retrieved 2017-01-09.
  10. "Wine FAQ".
  11. "simple volumes". Microsoft TechNet. Archived from the original on 2007-03-26. Retrieved 2006-12-01.
  12. 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.
  13. Paul, Matthias R. (1997-07-30). "II.11.iii. Interne Kommandos und Optionen von COMMAND.COM - Hinweise zu internen Kommandos". NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. MPDOSTIP (in German) (3 ed.). Archived from the original on 2016-11-04. Retrieved 2014-08-06. (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and 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 the NWDOSTIP.TXT file.)
  14. Paul, Matthias R. (1997-05-27) [1996]. "SETENV v1.11". Archived from the original on 2009-02-15. Retrieved 2019-07-29.
  15. 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.