Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to mount/unmount a physical hard drive in Windows XP?

Ideally, I'd like to be able to do this from the command line so that I could have batch files to do it, ie: mount.cmd unmount.cmd

Also, if the drives can be unmounted, will they spin down?

share|improve this question
up vote 15 down vote accepted

Try mountvol [drive:]path /d.

For, info type mountvol /? (just mountvol) in cmd.exe.

share|improve this answer
Note to fellow googlers: it seems that this is not a good way force Windows to prepare your USB drives for safe removal; it works, but then if you reinsert the drive it won't get mounted anywhere at all. (If you have already done this, you can get it mounted again by first running mountvol with no arguments, finding the volumes listed with *** NO MOUNT POINTS ***, and then running a command like mountvol H: \\?\Volume{91a12b16-f469-11df-ad1c-00bdb269fc5}\ , except using your drive letter and volume path instead of mine.) – SamB May 3 '11 at 20:15
I strongly believe this is not the answer. under windows xp mountvol only manages mountpoints but do not actually UNMOUNTS the filesystem. only the /p parameter unmounts the filesystem and it is not available on XP. see and – Costin Gușă Oct 3 '14 at 1:31

There's a pretty good discussion courtesy of some crazy developer, a bit down and in brings you to:

Microsoft provides a utility called devcon for free download. It's a "Command Line Uility Alternative to Device Manager". It can actually do many things that I won't get into here, but removing a plug & play device is a simple operation once you know the unique name of the device you want to manipulate.

After you've downloaded devcon, run "devcon status *" in a command window. This will generate a list of all the devices on your system. Look for the line which describes your device. In my case for my external hard drive the (very cryptic) line looks like this:

SBP2\MAXTOR&ONETOUCH&LUN0\0010B9F700AFC279 That full line is a bit much but any substring that remains unique will do. I have another maxtor drive on my system but nothing else that has the phrase "sbp2\maxtor" so I'll use that. The command to safely remove my external drive then becomes:

devcon remove sbp2\maxtor* The "*" at the end is a wildcard and matches the rest of the string.

share|improve this answer
[download devcon] (…) – sactiw May 6 at 10:35
C:\Windows\system32\fsutil.exe volume dismount f:
share|improve this answer
Note this only works with NTFS – Steven Penny Jan 1 '13 at 18:30
I think it also works with FAT volumes since they are not journalled anyway. Microsoft says it works with FAT and NTFS:… – Costin Gușă Oct 4 '14 at 20:33
also the problem with fsutil is the the volume is re-mounted immediately on the next access to it's letter as the letter is not removed, so mountvol and devcon are the safe methods – Costin Gușă May 10 '15 at 22:08

Assuming it is not your primary drive, doing a 'chkdsk /f ' will prompt you to force a dismount.

C:\WINDOWS>chkdsk /f e:
The type of the file system is NTFS.

Chkdsk cannot run because the volume is in use by another
process.  Chkdsk may run if this volume is dismounted first.
Would you like to force a dismount on this volume? (Y/N) n

There may be more elegant ways of doing this, but this is quick and easy.

share|improve this answer
chkdsk /f: is not really forcing a dismount as it says. it only clears open handles and denies access until it finishes, THEN it remounts the filesystem. a command trying to use a path on that fs will get an "access denied" message during chkdsk, but then regain access after the chkdsk completes. devcon on the other hand REALLY removes the drive and only a plug-and-play rescan command (devcon rescan or from device manager - scan for plug and play devices) will have the filesystem mounted again. – Costin Gușă Sep 8 '14 at 19:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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