So Linux "mounts" a hard drive to perform some operation such as reading/writing. Does Windows "mount" in the same way?

Is it called something different in the context of Microsoft?

  • 9
    Windows mounts automatically, and therefore no explicit tool is exposed to regular users. Many Linux desktop environments do this as well by default. For the mounting concept, you could see the Wikipedia entry. In short, mounting a device exposes access to the file system that it contains. This has to be done to be able to access files through a file system, no matter what the OS is called. – Daniel Andersson May 14 '12 at 15:58

If you know Windows internals, do fix my errors, please.

"Mounting" consists of two primary parts, which are the same in both systems but their separation is somewhat different:

  1. accessing the filesystem on disk;
  2. assigning a path to the filesystem.

On Linux, the same mount() function does both jobs; a filesystem has to be mounted explicitly on a user-chosen path and remains opened as long as it is mounted on at least one path (possibly more). Once all paths to that filesystem are umount()ed, it is closed.

Windows mounts volumes automatically when the volume appears – it immediately opens the filesystem and assigns a drive letter and/or any other configured names to it.

A disk can be temporarily "dismounted" using the FSCTL_LOCK_VOLUME and/or FSCTL_DISMOUNT_VOLUME ioctl functions – for example, while running a chkdsk on it – but is automatically mounted again when the program unlocks it or exits. This behavior could be viewed as kind of opposite to Linux. Since dismounting a filesystem is temporary, it retains the assigned names even while dismounted. (The "Safely Remove" function dismounts the filesystem and disables the underlying device, to prevent Windows from seeing the filesystem and remounting it.)

A filesystem can have several names assigned to it:

  • Drive letters (A:, C:, [:) – automatically assigned to new disks and lost on reboot, although Windows remembers assignments configured by the user. In this way, they are similar to Unix mountpoints.

    (Drive letters can also be assigned to arbitrary devices, including network filesystems supported by Windows. You can see their targets at \GLOBAL??\ and \Sessions\<session>\DosDevices\<loginid>\ in WinObj.)

    Note: Drive letters are normally system-wide, but they can also be assigned session-wide using subst or DefineDosDevice(), and yes, it accepts [:. The session-wide assignments are never stored anywhere and vanish on reboot.

  • Folder mount points (C:\Disks\Music) – a filesystem can be mounted on any arbitrary directory, like in Unix; however, they are actually stored on the target disk, in the form of reparse points (a more powerful form of symlinks) which refer to the mounted disk by its volume name.

    (Different kinds of reparse points also exist; a few standard ones are mount points, symlinks, directory junctions.)

  • Volume GUID paths (\\?\Volume{710308c0-978e-11e1-95bc-806d6172696f}\) (at least that's how it seems to be called) – special paths in the Win32 namespace \\?\, containing an UUID that Windows assigns to that particular volume on this particular Windows system. They cannot be changed. They are listed by mountvol, or under \GLOBAL??\ in WinObj. Unlike drive letters, these are the same for all users.

  • Device interface paths \\?\STORAGE#Volume#<something>Signature<hex>Offset<hex>Length<hex>#<uuid>\ Unlike a volume GUID path, each volume has exactly one device interface path.

    • Volume device name \Device\HarddiskVolume23 - unlike all the previous ones, which are just symbolic links, this directly names the volume. You know this because it's in the \Device namespace, not the \\? namespace. That also means you can't use it with functions such as CreateFile.

diskmgmt.msc, mountvol and diskpart can manage both drive letters and mount points.

Even when a volume doesn't have any drive letters and isn't "mounted" on any folder, it remains open and its contents can still be accessed through its volume name; e.g.

  • 4
    [:..? Really? – Daniel Beck May 14 '12 at 16:23
  • 11
    @DanielBeck: Yes, DefineDosDevice() accepts practically anything, although you won't have much luck convincing most applications to accept it. Try subst [: C:\Users, then dir [: – user1686 May 14 '12 at 16:26
  • 4
    @Daniel: By giving all possible bytes to DefineDosDevice - which really accepts almost all of them. Turns out space is valid, too! – user1686 May 15 '12 at 7:02
  • 8
    If tween girls were tech savvy enough, they'd be all over setting their drive letters to [: – iglvzx May 15 '12 at 7:06
  • 5
    @psusi, LASTDRIVE went into config.sys. system.ini was Windows. – user May 15 '12 at 13:43

mountvol.exe is the Windows equivalent.

mountvol example output

  • +1 for concise answer in one line and the answer is at the top. AND you provide bonus example screenshot! – Trevor Boyd Smith May 16 '12 at 12:03
  • The screenshot is not copy/pasteable and takes a lot of room, more than the equivalent text, for the same amount of information. This is not a good idea I think. – Ludovic Kuty Sep 20 '12 at 8:27
  • @LudovicKuty: Yeah, I was aware of that issue when I posted this. It's just the example output of what mountvol prints on my machine. So it shouldn't be anything too hard to reproduce. If I put the plain text in here, it became harder to read because of the box with scrollbars :( If you want to edit the answer to improve it, go ahead :) – Der Hochstapler Sep 20 '12 at 8:47
  • No, in fact many people are happy with that :) I mostly commented about the "AND you provide bonus example screenshot". It helps people, that's good. – Ludovic Kuty Sep 20 '12 at 9:11

Yes, but in general, it is handled automatically (say, with a USB drive).

The Disk Management utility (part of Computer Mgmt), allows you to manipulate volumes and mount points. Explorer does the same for network shares. There are command-line versions (diskpart.exe in WIn 7) as well depending on the version of Windows you run.

  • 1
    Also, unmounting hotswappable drives is usually done through the Safely Remove Hardware menu. To re-mount those devices, unplug the connection cable (USB/FireWire/eSATA) and plug it back in, or disable the USB/FireWire/etc. device from Device Manager and re-enable it, and Windows will automatically re-mount it. – Lèse majesté May 14 '12 at 16:17
  • So it is with some Linux distributions, e.g., Ubuntu. – krlmlr May 14 '12 at 20:04

The shortest, most obvious answer to fill in your _ _ _ _ _ _ is "mount". Linux mounts (and unmounts) file systems and so does Windows.

They each automate this process to varying degree depending a slew of mixed factors I'm not capable of listing, but I think caching strategies, user style/preference, and patents are significant influences on the automation of this process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.