Managing Drive Letters and Mount Points

 < Day Day Up > 



After partitioning a drive, you can assign each partition a drive letter or mount point and then format the partition so that it is ready to store data. Generally, the drive letters E through Z are available for use, with drive letters A to D reserved or already in use in most cases. On many systems, drive letter A is for the system’s floppy, drive letter B is reserved for a removable disk drive, drive letter C is the primary disk drive, and drive letter D is for the CD-ROM or DVD drive.

If you need additional partitions, you can create them using mount points, which allow you to mount disks to a file system path, such as C:\Data. The only restriction for drive paths is that you must mount them to empty folders on NT File System (NTFS) drives.

Assigning Drive Letters or Mount Points

To assign a drive letter or mount point, follow these steps:

  1. Invoke DiskPart by typing diskpart at the command prompt.

  2. List the volumes on the computer and check the current assignments by typing list volume.

    Note

    Only the LIST VOLUME command shows drive letter and mount point assignments, and it does so for all partitions, logical drives, and volumes on the computer. That’s why you use this command instead of the LIST PARTITION command. Seems illogical, but that’s how it works. The good news is that you use this same technique when assigning drive letters and mount points to volumes on dynamic disks.

  3. Assign the drive letter or mount point as follows:

    • To assign a drive letter, type assign letter=x where x is the drive letter to use, such as

    DISKPART> assign letter=f 
    • To assign a mount point, type assign mount=Path where Path is the path to the empty NTFS folder to use as the mount point, such as

    DISKPART> assign mount=c:\data 

Changing Drive Letters or Mount Points

The ASSIGN command can also be used to change an existing drive letter or mount point assignment. Simply select the partition to work with and use ASSIGN to set the new drive letter or mount point. DiskPart will change the drive letter and report that you must reboot the computer before the changes take effect:

DiskPart assigned the drive letter, but your computer needs to be 
rebooted before the changes take effect.

With a mount point, DiskPart will report that it made the requested change without requiring a reboot:

DiskPart successfully assigned the drive letter or mount point.

Removing Drive Letters or Mount Points

You can remove a drive letter or mount point from a partition that has focus by using the REMOVE command. Follow these steps:

  1. Invoke DiskPart by typing diskpart at the command prompt.

  2. List the volumes on the computer by typing list volume, and check the current assignments. Remember, only the LIST VOLUME command shows drive letter and mount point assignments, and it does so for all partitions, logical drives, and volumes on the computer.

  3. Select the partition you want to work with by typing select volume followed by the number of the volume representing the desired partition. Again, it seems illogical to do this with partitions, but this is the easiest way.

  4. Remove the current drive letter or mount point assignment from the select partition by typing remove.

When entered without any parameters, this command removes the first drive letter or mount point it encounters and reports:

DiskPart successfully removed the drive letter or mount point.

This technique is fine when the partition only has a single drive letter or mount point. If a partition has multiple drive letters or mount points, you’ll want to specify the drive letter to remove by typing the parameter letter=x or the mount point to remove by typing the parameter mount=Path, such as

DISKPART> remove letter=d

or

DISKPART> remove mount=D:\Data 

You can also specify that all drive letters and mount points should be removed and that DiskPart should close all open handles to the volume and then dismount it after removing the drive letter or mount point. To do this, you use the All and Dismount parameters, as shown in these examples:

Remove all drive letters and mount points:

DISKPART> remove all

Remove all drive letters and mount points and then dismount the related volumes:

DISKPART> remove all

Remove the volume mounted as d: and dismount it:

DISKPART> remove letter=d dismount
Note

On MBR disks, you cannot remove the drive letter from the system or boot partition, or any partition that contains the active paging file or crash dump (memory dump). On GPT disks, you cannot remove the drive letter for any EFI, OEM, unrecognized, or non-data partition. You can, however, use this command to remove the drive letter from a removable drive.



 < Day Day Up > 



Microsoft Windows Command-Line Administrator's Pocket Consultant
MicrosoftВ® WindowsВ® Command-Line Administrators Pocket Consultant
ISBN: 0735620385
EAN: 2147483647
Year: 2004
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net