September 27

Windows: MOUNTVOL – Command line volume control

MOUNTVOL (Windows 2000/2003/Server 2008)

Link volumes without requiring a drive letter. Create, delete or list a volume mount point. NTFS junction mount points can only be used with local NTFS directories, (unlike DFS junction points which will target a network share). MOUNTVOL can be found on the Windows CD i386 folder.

Syntax
      MOUNTVOL [drive:]path option

Options

    path     : An existing NTFS folder where the mount point will reside.

    VolName  : The volume name that is the target of the mount point.
               In the form \?Volume{GUID}, where {GUID} is a globally unique identifier
               e.g.   \?Volume{2eca078d-5cbc-43d3-aff8-7e8511f60d0e}

    /D       : Remove the volume mount point from the specified folder.

    /E       : Re-enable automatic mounting of new basic volumes (2003 and above).

    /L       : List the mounted volume name for the specified folder.

    /s       : Itanium-based computers only. Mount the EFI System Partition on the specified drive.

    /p       : Remove the volume mount point from the specified directory,
	            dismount the basic volume, and take the basic volume offline,
               making it unmountable. (Server 2008)

    /r       : Remove volume mount point directories and registry settings for
               volumes that are no longer in the system,this prevents them from
               being automatically mounted and given their former volume mount
               point(s) when added back to the system.(Server 2008)

    /n       : Disable automatic mounting of new basic volumes.(Server 2008)
               New volumes are not mounted automatically when added to the system.

The GUID is used to identify a unique volume even if the drive letter changes.

If other processes are using the volume, mountvol closes any open handles before dismounting the volume.

Volumes that are dismounted by using /p are listed in the volumes list as “NOT MOUNTED UNTIL A VOLUME MOUNT POINT IS CREATED.”
If the volume has more than one mount point, use /d to remove the additional mount points before using /p. You can make the basic volume mountable again by assigning a volume mount point.

If you need to expand your volume space without reformatting or replacing a hard drive, you can add a mount path to another volume. The benefit of using one volume with several mount paths is that you can access all local volumes by using a single drive letter (such as C:). You do not need to remember which volume corresponds to which drive letter—although you can still mount local volumes and assign them drive letters.

When using junction points:
• Use NTFS ACLs to protect junction points from inadvertent deletion.
• Use NTFS ACLs to protect files and directories that are targeted by junction points from inadvertent deletion or other file system operations.
• Never delete a junction point by using Explorer, a del /s command, or other file system utilities that walk recursively into directory trees. These utilities affect the target directory and all subdirectories.
• Use caution when you apply ACLs or change file compression in a directory tree that includes NTFS junction points.
• Do not create namespace cycles with NTFS or DFS junction points.
• Put all your junction points in a secure location in a namespace where you can test them out in safety, and where other users will not mistakenly delete them or walk through them.

Examples

List the available volumes on your system (this will list the GUIDs)

C:> mountvol

Create a mount point called ss64

C:> md ss64
C:> mountvol ss64 \?Volume{2eca078d-5cbc-43d3-aff8-7e8511f60d0e}

Delete the mount point

C:> mountvol \?Volume{2eca078d-5cbc-43d3-aff8-7e8511f60d0e} /d


Copyright 2021. All rights reserved.

Posted September 27, 2011 by Timothy Conrad in category "Windows

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B