How to undo "remove all dismount" in Diskpart?

2

1

I made a boo boo! I executed the following commands in cmd:

diskpart
list volume
select volume 13
remove all dismount
exit

I have one of those dual-slot card readers with one slot for SD and one slot for CF cards.

The volume 13 was drive letter P for the SD cards. I also had drive letter N for the CF cards. I still have the N drive for CF cards and it works properly. But I have lost drive P for the SD cards. I tried unplugging the card reader and then plugging it back in. The result of it was that I could see both the P and N drive in Explorer, but only the N drive worked properly. Inserting an SD card in the reader and trying to open P drive resulted in some error message saying something like "there is no disk inserted".

diskpart did say that I needed to reboot after the remove all dismount command.

DiskPart successfully removed the drive letter, but your computer needs to be rebooted before the changes take effect. Diskpart successfully dismounted the volume.

So I rebooted but the problem remains. Now I only see the N drive. There is no P drive letter whatsoever in Explorer.

How do I correct this mistake? What's the opposite command of remove all dismount?

I just checked Device Manager. I can see the reader there, and the SD slot has been assigned drive letter O but there is an exclamation mark, and this drive letter is not appearing in Explorer.

device manager

Properties dialog states the following:

This device cannot start. (Code 10)

Click 'Check for solutions' to send data about this device to Microsoft and to see if there is a solution available.

If I click that it says it could not load driver software, and allows me to check online for a solution, which it doesn't find.

could not load driver

Samir

Posted 2013-05-25T23:19:23.977

Reputation: 17 919

I didn't expect this Diskpart operation to be persistent. I expected it to be restored after a simple reboot. I was actually looking for a way to eject a removable media (such as SD cards) from the cmd. I later found FreeEject which is a free tool that can be used for this purpose.

– Samir – 2013-05-26T13:02:02.043

Answers

1

List mount point:

mountvol

alternative:

mountvol /L | findstr "\ ***"

Output:

\\?\Volume{093d583c-a043-11e1-b420-806e6f6e6963}\
    N:\
\\?\Volume{093d583d-a043-11e1-b420-806e6f6e6963}\
    C:\
\\?\Volume{093d583e-a043-11e1-b420-806e6f6e6963}\
    O:\
\\?\Volume{093d583f-a043-11e1-b420-806e6f6e6963}\
    R:\

\\?\Volume{31f40cd1-4088-11e2-b0f4-806e6f6e6963}\

        *** NO MOUNT POINTS ***
\\?\Volume{31f40cd2-4088-11e2-b0f4-806e6f6e6963}\
    I:\
\\?\Volume{093d5841-a043-11e1-b420-806e6f6e6963}\
    D:\

Mount logical disk P:

mountvol P:  \\?\Volume{31f40cd1-4088-11e2-b0f4-806e6f6e6963}\

Dismount logical disk P:

Warring! Delete logical disk letter!

mountvol P: /D

Run USB-device panel:

RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

STTR

Posted 2013-05-25T23:19:23.977

Reputation: 6 180

Thanks! Yeah, mountvol pretty much does the trick. Immediately after the P letter appeared in Explorer and I could mount an SD card and read it. To get rid of the exclamation mark in Device Manager a reboot was required. It's all good now. – Samir – 2013-05-26T10:50:36.347

@Sammy I am very glad that you are all well. If you still have problems on this issue, please provide them. – STTR – 2013-05-26T11:09:50.017

I think you should remove the mountvol p: /d above. That switch removes the volume mount point, which is not desired here. This is supposed to be instruction on how to add it, not how to remove it. But we have it in the comment now anyway, so it's safe to remove. – Samir – 2013-05-26T11:30:07.217

Also I think you should remove the RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll because that makes no sense. I know it shows the Safely Remove Hardware dialog. I have seen that in another post. For the sake of the question this is not needed. – Samir – 2013-05-26T11:31:48.130

@Sammy rundll32 ... After disconnecting the drive letter maybe is important to turn off the device itself. Otherwise, you can burn unit. This team is still important. Thank you for your comment! – STTR – 2013-05-26T11:57:23.330

Are you saying that after mountvol P: \\?\Volume{31f40cd1-4088-11e2-b0f4-806e6f6e6963} you are using RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll to show the Safely Remove Hardware dialog to safely stop the device and then you disconnect it? I didn't do that. After mounting P drive I rebooted, and then it all worked. I didn't disconnect anything. – Samir – 2013-05-26T12:33:05.417

@Sammy Part my work with various damaged media device. Some of them are kind of Flash or USB drive or SD-card. When I disable such devices across mountvol P: /D for example, such a device is energized. Accordingly, it is desirable to properly deactivate it. RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll - do it. Yes, there is a software-hardware complex designed for data recovery. But here it is about the simple case of damage to the file system table and marking the zero sector. Your job is a little different. You do not need to turn off the device completely. This is important. – STTR – 2013-05-26T12:45:55.167

Okay. Well, your solution worked for me. I thank you for that! The mountvol command is the right answer. My own answer works too, using Disk Management, for those users not comfortable with command line tools. – Samir – 2013-05-26T12:56:12.600

@Sammy In this I agree with you. – STTR – 2013-05-26T13:07:35.073

2

Its very simple to undo"remove all dismount" in diskpart........

Path:

  1. press Win+R ,then write "cmd"

  2. write “ diskpart ” and then select “yes”.

  3. write “ list volume ”

  4. write “ select volume f ‘’(which you want to mount)

  5. then write “assign letter=f”

  6. exit

satish chaurasia

Posted 2013-05-25T23:19:23.977

Reputation: 21

This seems to work well. Simple and does not require a reboot, at least with Server 2016 Core. – Dave Ruske – 2017-10-16T20:43:21.387

1

This solution might be easier for some users.

I found a Technet reference to this command. This is what it says about the parameters all and dismount.

all

Removes all current drive letters and mount points.

dismount

Dismounts the basic volume, when all drive letters and mount points have been removed from the volume, and takes the basic volume offline, making it unmountable. If other processes are using the volume, DiskPart closes any open files in use by an application before dismounting the volume. You can make the volume mountable again by assigning it a driver letter or by creating a mount point path to the volume. Dismount will fail if used on a volume that has any remaining drive letters or mount points. For scripting, using remove all dismount is recommended.

Note th part where it says you can make the volume mountable again by assigning it a driver letter or by creating a mount point path to the volume.

So go ahead and assign it a drive letter. Here follows a short how-to.

  1. Click Start button.
  2. Right click Computer.
  3. Click Manage. This should bring up the Computer Management window. Click Continue if prompted by UAC.
  4. Click on Disk Management.
  5. Locate the disk with missing drive letter on the left side and right click on it.
  6. Click Change Drive Letter and Paths.
  7. Click the Add button and follow the instructions to assign a new drive letter.

Here are some screenshots.

start menu

computer management

disk management

Samir

Posted 2013-05-25T23:19:23.977

Reputation: 17 919