Home » Blog
date 11.Mar.2018

■ Create a link to a specific external hard disk using volume mount points


xplorer² supports folder junctions, which are effectively folder shortcuts "mounted" on an empty folder and redirecting to another part of the filesystem, local or remote. (UNC junctions used to have problems once upon a time but they seem to work ok for windows 10). Things get interesting when linking to external removable media. When you connect a USB stick or a USB external hard drive, a junction to a folder on the external device will use the assigned drive letter — which may change over time.

Windows Disk Management tries its best to assign the same drive letter each time you connect your external filesystem media. Each new device attached gets a unique volume name (e.g. a funny GUID like \\?\Volume{ecf3326c-0000-0000-0080-000000000000}\), and next time it is reattached the same drive letter is likely assigned as windows discovers the same volume name. But there are no guarantees; you may simply run out of drive letters or have two devices fighting for the same drive letter.

Volume mount points are special reparse points like folder junctions, used for reaching particular external drives by their unique GUID, bypassing the problem of drive letter uniqueness and availability. One way to manage volume mount points is the DOS command mountvol, but creating a new volume mount point requires some explanation.

Let's say you connect some external hard disk and it usually gets the drive letter G:\ how do you create a volume mount point to it? Which translates to, how do you discover the unique GUID assigned to it? We need to open an elevated command console (from Start menu type CMD then right click on the Command prompt icon and choose Run as administrator from the menu). Then execute a series of commands:

  1. Connect the USB device
  2. Get the volume name assigned to the drive letter
  3. Create a new (empty) folder that will become the volume mount point
  4. Use mountvol to create the reparse point

Or equivalently in the command prompt window you type:

DOS> mountvol G:\ /L
    \\?\Volume{ecf3326c-0000-0000-0080-000000000000}\
DOS> mkdir samsung
DOS> mountvol samsung \\?\Volume{ecf3326c-0000-0000-0080-000000000000}\

Note we are using mountvol twice, once to get the volume name associated to G:\ drive, and once to create the connection.

Now each time you connect the same device, you still get a drive letter, but you don't care if it is the same or not. You can use the new volume mount point folder as the target of a backup operation or whatever else you need to do with the volume — that's drive letter independent backup.

The only down-side I found is the error message you get if you try to use the volume mount point while the external hard disk is disconnected. I would have preferred to see "please connect volume XXX" instead of this generic location not available error:

volume mount point not connected error

But this "problem" is easily solved: just name your folder after the name of the device (SAMSUNG in our example) so you know which one you need to connect.

Post a comment on this topic »

Share |

©2002-2018 ZABKAT LTD, all rights reserved | Privacy policy | Sitemap