Aracılığıyla paylaş


Assign, change, or remove a drive letter

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

To assign, change, or remove a drive letter

  • Using the Windows interface

  • Using a command line

Using the Windows interface

  1. Open Computer Management (Local).

  2. In the console tree, click Computer Management (Local), click Storage, and then click Disk Management.

  3. Right-click a partition, logical drive, or volume, and then click Change Drive Letter and Paths.

  4. Do one of the following:

    • To assign a drive letter, click Add, click the drive letter you want to use, and then click OK.

    • To modify a drive letter, click it, click Change, click the drive letter you want to use, and then click OK.

    • To remove a drive letter, click it, and then click Remove.

Important

  • Be careful when making drive-letter assignments because many MS-DOS and Windows programs make references to a specific drive letter. For example, the path environment variable shows specific drive letters in conjunction with program names.

Notes

  • To perform this procedure on a local computer, you must be a member of the Backup Operators group or Administrators group on the local computer, or you must have been delegated the appropriate authority. To perform this procedure remotely, you must be a member of the Backup Operators group or Administrators group on the remote computer. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open Computer Management, click Start, click Control Panel, double-click Administrative Tools, and then double-click Computer Management.

  • A computer can use up to 26 drive letters. Drive letters A and B are typically reserved for a floppy disk drives. If the computer does not have a floppy disk drive, you can assign drive letters A and B to removable drives, hard disk drives, or mapped network drives. Hard disk drives are typically assigned drive letters C through Z, while mapped network drives are assigned drive letters in reverse order (Z through C).

  • You cannot change the drive letter of the system volume or boot volume.

  • An error message may appear when you attempt to assign a letter to a volume, CD-ROM drive, or other removable media device, possibly because it is in use by a program in the system. If this happens, close the program accessing the volume or drive, and then click the Change Drive Letter and Paths command again.

  • You can also mount a local drive at an empty folder on an NTFS volume using a drive path instead of a drive letter. For more information, see Related Topics.

Using a command line

  1. Open Command Prompt.

  2. Type:

    diskpart

  3. At the DISKPART prompt, type:

    list volume

    Make note of the number of the simple volume whose drive letter you want to assign, change, or remove.

  4. At the DISKPART prompt, type:

    select volume n

    Select the volume, where n is the volume's number, whose drive letter you want to assign, change, or remove.

  5. At the DISKPART prompt, type one of the following:

    • **assign letter=**L

      Where L is the drive letter you want to assign or change.

    • **remove letter=**L

      Where L is the drive letter you want to remove.

Value Description

list volume

Displays a list of basic and dynamic volumes on all disks.

select volume

Selects the specified volume, where n is the volume number, and gives it focus. If no volume is specified, the select command lists the current volume with focus. You can specify the volume by number, drive letter, or mount point path. On a basic disk, selecting a volume also gives the corresponding partition focus.

assign letter=L

Assigns a drive letter, L, to the volume with focus. If no drive letter is specified, then the next available drive letter is assigned. If the drive letter is already in use, an error is generated.

remove letter=L

Removes the drive letter, L, from the volume with focus. If no drive letter or mount point is specified, then DiskPart removes the first drive letter or mount point it encounters.

The remove command can be used to change the drive letter associated with a removable drive. You cannot remove the drive letters on system, boot, or paging volumes. In addition, you cannot remove the drive letter for an OEM partition, any GPT partition with an unrecognized GUID, or any of the special, non-data, GPT partitions such as the EFI system partition.

Notes

  • To perform this procedure on a local computer, you must be a member of the Backup Operators group, Administrators group, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.

  • A computer can use up to 26 drive letters. Drive letters A and B are typically reserved for a floppy disk drives. If the computer does not have a floppy disk drive, you can assign drive letters A and B to removable drives, hard disk drives, or mapped network drives. Hard disk drives are typically assigned drive letters C through Z, while mapped network drives are assigned drive letters in reverse order (Z through C).

  • You cannot change the drive letter of the system volume or boot volume.

  • An error message may appear when you attempt to assign a letter to a volume, CD-ROM drive, or other removable media device, possibly because it is in use by a program in the system. If this happens, close the program accessing the volume or drive, and then click the Change Drive Letter and Paths command again.

  • You can also mount a local drive at an empty folder on an NTFS volume using a drive path instead of a drive letter. For more information, see Related Topics.

  • For more information about DiskPart, see Related Topics.

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Concepts

Create a mounted drive
Using NTFS mounted drives
Working with MMC console files
DiskPart