19

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?

5 Answers 5

15

Try mountvol [drive:]path /d.

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

2
  • 4
    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, 2011 at 20:15
  • 2
    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 technet.microsoft.com/en-us/library/bb490934.aspx and technet.microsoft.com/en-us/library/cc772586.aspx Oct 3, 2014 at 1:31
9

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.

1
5
C:\Windows\system32\fsutil.exe volume dismount f:
3
  • 1
    Note this only works with NTFS
    – Zombo
    Jan 1, 2013 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: microsoft.com/resources/documentation/windows/xp/all/proddocs/… Oct 4, 2014 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 May 10, 2015 at 22:08
1

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.
ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID.
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.

1
  • 1
    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. Sep 8, 2014 at 19:15
1

Yes, there is a tool that can do that for you. It is far more powerful than the green windows "Safely Remove Hardware" feature.

The tool is called HotSwap!

Using this tool you can even unmount drives attached on SATA. And yes, it spins down the device.

Confirmed working on Windows 10 and Windows Server 2016.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .