Most people know that disk volumes using the FAT file system under DOS and its
derivative operating systems are accessed using drive letters, such as C:, D: and so on.
However, it can be a bit confusing figuring out how these letters are determined. Of
course, as you use more disks (and other devices) and more partitions, this can get even
more difficult to understand. A common confusion encountered by someone upgrading their PC
is adding a hard disk to it and finding that suddenly some their files have moved from D:,
say, to E:. This happens because DOS assigns drive letters using a specific sequence when
the PC is booted. Drive letters are not permanently assigned to the drive, and so adding
new hard disk volumes can interrupt the previous order.
Drive letters A: and B: are reserved for floppy disks. The first disk, as determined by
the physical and/or BIOS configuration of the drives is A:, and the second disk is B:.
Even if there is only one floppy disk in the system, B: is still reserved for use by
floppies and cannot be used for any other purpose.
Hard disks are lettered starting from C:, with each partition getting a separate
letter. It is essential to realize that DOS will first assign a letter to all primary DOS
partitions on all hard disks in the system, before it will assign any letters to any
logical DOS volumes (in extended DOS partitions) on any hard disk. This is the primary
reason why adding a hard disk to an existing system can cause drive letters to shift.
Let's take an example system that contains a single 1.2 GB hard disk broken into three
partitions. The first partition is the DOS primary, and then an extended partition is
defined containing the other two partitions as logical volumes. The primary partition will
be C:, and the other two D: and E:. Now let's say we add a second hard disk that has two
partitions itself, one primary and the other logical (extended). When the system is booted
up with the new hard disk in it, the first hard disk's primary partition will still be C:,
but the primary partition in the second hard disk will grab D:. Then the extended
partitions will be assigned letters. The result is that the logical partitions on the
first hard disk will have their letters shift:
Partition |
Before |
After |
Hard Disk 1: Primary
Partition |
C: |
C: |
Hard Disk 1: Logical
Partitions |
D:, E: |
E:, F: |
Hard Disk 2: Primary
Partition |
-- |
D: |
Hard Disk 2: Logical
Partitions |
-- |
G: |
Having drive letters change is not only confusing, it can cause programs to
malfunction, because many programs record what disk and directory they are in and expect
that they will remain stationary (which stinks, but hey, that's life.)
There is one relatively simple way to avoid having this happen: don't create a primary
partition on any hard disks in the system other than the first one. It is perfectly legal
to only create an extended partition on a hard disk, and put all of the partitions in it.
The only place that a primary partition is absolutely needed is on the first hard disk,
because it is required to boot the operating system. You cannot normally boot from an
extended partition volume anyway (although some motherboards will apparently let you).
Note: One other minor
consideration is that you lose a small amount of disk space if you create only extended
partitions on a disk. The extended partition will begin using (logical) cylinder 1 of the
disk, and therefore you lose the space in cylinder 0. This will generally cost you a
handful of megabytes of storage, but is pretty much unavoidable if you want your
partitions in a sensible order.
So in the example above, if our second hard disk had its two partitions both defined as
logicals, then they would have been assigned F: and G:, and the partitions on the first
disk would have been unchanged. This is in fact the way you will normally want to
partition second and third hard disks in a system. What if you are adding a hard disk from
another system that has already been set up with a primary partition? Unless you don't
care about the second hard disk's primary partition being assigned D:, you have to delete
the primary partition (after copying any data from it of course!) and expand the size of
the extended partition to take its place. For a job of this sort, a utility like Partition Magic is indispensable. Otherwise you will basically have
to wipe the second disk clean and start over.
Once all of the hard disk partitions have been assigned drive letters, the system will
allocate letters for other devices that are operated using drivers. Devices like CD-ROMs,
Zip drives, etc. are operated through software drivers that present the device to the
operating system as if they were a disk, and then they are assigned a drive letter so they
can be accessed. Normally, these devices are assigned a letter immediately after the last
one used by hard disks, but this can be changed by using different parameters for the
driver software. For example, the drive letter for a CD-ROM drive under Windows 95 can be
set in software using the Device Manager.
Finally, some software programs can change drive letters. A very common example is the
use of disk compression agents such as DriveSpace. These will
often take a hard disk, say D:, change its letter to something out of the way like R:,
create a compressed volume on R:, and then map the compressed volume back to D:. The net
result is that the disk is compressed while appearing to still be uncompressed.
Next: Disk
Partitioning and Formatting Programs