Jump to content

Help? How do I UNDO a mountvol /p in Win11 (Can't automount the disk anymore). Thanks!


Recommended Posts

jeffw_00
Posted

Hi - I had just updated my PC to Windows 11.  I found that an old exe I used for dismounting drives in scripts no longer worked.  Following some bad instructions on the web I did a mountvol /p on a drive.  Somehow this made it so this drive would never automount (i.e. if I unmount it (mountvol /D), and disconnect it, and later connect it, it doesn't show up as a drive with a letter, I need to do a mountvol  <letter>: <label>  where the <label> is a long descriptor like \\?\Volume{long hex string>\.)  I appear to have either done something permanent to the drive, marking it "don't automount me", or (more likely) made some permanent entry in some table in Windows marking this drive by label as "don't mount automatically".

 

Does anyone know how to undo this? (the effect of a mountvol /p?)

 

For reference see below. yes this was a dumb thing to do without reading the below twice.

 

mountvol

  /P          Removes the volume mount point from the specified directory,
                dismounts the volume, and makes the volume not mountable.
                You can make the volume mountable again by creating a volume
                mount point.

 

I assume the "creating a volume mount point" is the mountvol command I now have to use to mount it.  Using it does not cause the drive to later automount without giving that command.  

 

Thank You!

/j

goretsky
Posted

Hello,

I have mostly used DiskPart for volume management, but between looking at https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mountvol and https://www.tenforums.com/tutorials/117336-enable-disable-automount-new-disks-drives-windows.html it seems the command to re-enable the automatic mounting of disk volumes is mountvol /e from an elevated Command Prompt.

Regards,

Aryeh Goretsky
 

jeffw_00
Posted

Thanks goretsky -  But that command does not take a specific disk as an argument - it was one of the first things I tried, and it didn't help with this drive.  Any other ideas? 

Thanks! 

Bookmem
Posted
6 hours ago, jeffw_00 said:

Thanks goretsky -  But that command does not take a specific disk as an argument - it was one of the first things I tried, and it didn't help with this drive.  Any other ideas? 

Thanks! 

Have you tried using "Disk management" to assign the drive a drive letter?

  • Like 1
goretsky
Posted
16 hours ago, jeffw_00 said:

Thanks goretsky -  But that command does not take a specific disk as an argument - it was one of the first things I tried, and it didn't help with this drive.  Any other ideas? 

Thanks! 

 

Hello,

Have you restarted the system since performing the mountvol /e command?  Does the volume show up, either in the Windows Explorer or Disk Management?

Regards,

Aryeh Goretsky
 

jeffw_00
Posted (edited)

Goretsky - yes, several times 

 

Let me explain in more detail.  I have an external USB drive that is usually powered down.  Before I did something stupid (mountvol /p <drive letter>), whenever I powered it up the drive just appeared in file manager.  After I did the stupid thing, the drive does not appear automatically, I have to mount it using some manual method. This is true after several reboots.  Either the drive is somehow marked "don't mount me", or the PC has noted not to mount the drive automatically, and there doesn't seem to be a way to undo the stupid thing.  :-(.   TIA for any other suggestions for me to try.  

/j

Edited by jeffw_00
goretsky
Posted

Hello,

 

Did @Bookmem's suggestion to assign the drive a new letter via Disk Management (filename DISKMGMT.MSC) make any difference?

Regards,

Aryeh Goretsky
 

jeffw_00
Posted

Sorry -everything I try doesn't stick - next time I power up the drive I have to mount it (assign drive letter) manually 😞 

Bookmem
Posted
4 hours ago, jeffw_00 said:

Sorry -everything I try doesn't stick - next time I power up the drive I have to mount it (assign drive letter) manually 😞 

You didn't answer the question. Did you use Disk Management to assign a drive letter?

Posted

"automount enable" from DiskPart didn't work?

Quote

 

DISKPART> help automount

    Enables or disables the automount feature.

Syntax:  AUTOMOUNT [ENABLE] [DISABLE] [SCRUB] [NOERR]

    ENABLE      Enables Windows to automatically assign drive letters
                to volumes that are added to the system.

    DISABLE     Prevents Windows from automatically assigning drive letters
                to volumes that are added to the system.

    SCRUB       Removes mounted folder pathnames, drive letters, mounted
                folder directories, and registry settings, for volumes that
                are no longer in the system. This prevents volumes that were
                previously in the system from being automatically assigned
                their former drive letters and mounted folder pathnames when
                they are reintroduced to the system.

    NOERR       For scripting only. When an error is encountered, DiskPart
                continues to process commands as if the error did not occur.
                Without the NOERR parameter, an error causes DiskPart to exit
                with an error code.

    When the AutoMount feature is enabled (the default on some versions
    of Windows Server), Windows automatically brings the volume online,
    and, assigns a drive letter and a volume GUID pathname to the volume,
    when the volume is added to the system. In storage area network (SAN)
    configurations, disabling AutoMount prevents Windows from automatically
    onlining the volume and assigning drive letters or volume GUID pathnames
    to any new volumes that are visible to the system.

    Note that the AutoMount feature could only be applied to basic disk
    volumes on Windows versions released prior to Windows Vista. Starting
    with Windows Vista, the AutoMount feature can be applied to both basic
    and dynamic disk volumes.

Example:

    AUTOMOUNT
    AUTOMOUNT ENABLE
    AUTOMOUNT DISABLE

 

 

jeffw_00
Posted

@BOOKMEM,  Yes, I used Disk Management to assign a drive letter, more than once.  It did not help.

Bookmem
Posted (edited)
2 hours ago, jeffw_00 said:

@BOOKMEM,  Yes, I used Disk Management to assign a drive letter, more than once.  It did not help.

Do you have another computer you can use to test the drive? If not, what I would do would be to download a Linux distro you can flash to USB stick and boot to it. Then use gparted to clear all of the flags.

Edited by Bookmem
jeffw_00
Posted (edited)

Thanks everyone for their help.

Diskpart -> AUTOMOUNT ENABLE  didn't change things

I ran gparted - the only flag on the partition, which was "msft<something>", was the same flag that was set for my partitions on all my other drives.  nothing to see there, I think.   I guess I need to see if it comes up automatically connected to a different PC - will get to that soon.  (and if it does, then somehow my PC has it marked as "don't automount" 😞 )

/j

 

Edited by jeffw_00
Posted

Back up your files (not clone the drive). Repartition (delete/create new) and reformat your external drive. Remove and reconnect the drive. If it automounts, copy back your files.

jeffw_00
Posted

Hi - I attached the external drive to another PC and when it powered up it automounted just fine.

 

I suppose it's possible that if I wipe the drive, and reformat it, that will fix the problem, but it's a lot to do for a solution that isn't certain (the drive will still have the same physical ID).  

It really seems like I have to find (in the registry), the place where it has this drive marked "never mount" and clear the info.   Anyone know where to look?

Thanks!

/j

Bookmem
Posted
On 4/19/2025 at 6:33 PM, jeffw_00 said:

Thanks everyone for their help.

Diskpart -> AUTOMOUNT ENABLE  didn't change things

I ran gparted - the only flag on the partition, which was "msft<something>", was the same flag that was set for my partitions on all my other drives.  nothing to see there, I think.   I guess I need to see if it comes up automatically connected to a different PC - will get to that soon.  (and if it does, then somehow my PC has it marked as "don't automount" 😞 )

/j

 

That is because you have fastboot enabled in windows. That means when you shutdown, you are leaving some files open as if you were 'hibernating" instead of a full shutdown. Disable fastboot and those flags will disappear.

  • Like 1
jeffw_00
Posted (edited)

@Bookmem  - good idea - but it didn't work.  I disabled Fast Boot, and tried booting a few times (even shutdown/powerup a couple of times) - no difference.  Sorry.    I still think it's a registry thing...

Edited by jeffw_00
goretsky
Posted

Hello,

It's definitely a setting that is specific to the PC.  It's even possible it is a bug that is preventing auto-mounting from being re-enabled.

Out of curiosity, have you tried marking the partition as ACTIVE using DiskPart?  That will not change anything other than telling the computer it is a bootable partition.  Another thing to try might be removing the all entries related to the drive from the Device Manager and let it be re-detected the next time it is plugged in. 

 

Neither of the above are options which should affect drives from being automatically mounting, so I am kind of guessing at this point.

 

Regards,

Aryeh Goretsky
 

Posted

What is nuts to me is that I've had and seen the reverse problem. Never saw anyone having this issue.

What does the registry key HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices show , with the drive in and with it out?

Bookmem
Posted (edited)
On 4/26/2025 at 12:18 PM, jeffw_00 said:

@Bookmem  - good idea - but it didn't work.  I disabled Fast Boot, and tried booting a few times (even shutdown/powerup a couple of times) - no difference.  Sorry.    I still think it's a registry thing...

I didn't mean that disabling fastboot would cure your problem. I meant that it would remove the flags so that gparted could modify the drive. But that is ONLY if the problem is with the drive and not Windows. Did you ever get to test the drive with another computer? You might want to try resetting Windows while keeping files and apps.

Edited by Bookmem
jeffw_00
Posted (edited)

@Bookmem - as I posted above- drive works great with another PC - automounts without issue.  It's something with this PC - maybe a registry setting that needs to be changed...

 

@Goretsky, @crp - will try these ideas later this week.  Thanks!   

- I can try attaching the drive, removing from device manager and rebooting. 

- I can look at the registry flags, although I would expect the registry flag to reflect what I see in disk management - I can see when a letter is assigned and when it isn't. 

 

Thanks!
/j

Edited by jeffw_00
jeffw_00
Posted

Nothing interesting in the registry that I saw.

However.. With the drive mounted, I uninstalled it from Device Manager (and it disappeared from the mounted drives in File Explorer as I would expect).  I then did a reboot, and the system did automount the drive!    However, after I unmounted it with the mountvol /D command,  and powered it off.  When I powered it on a bit later it would not automount,  I needed to do the mountvol <letter> <label> command as I have been doing to work around this issue.

 

Thanks anyway guys - I guess I'll just stick with the workaround.  

/j

Bookmem
Posted
5 hours ago, jeffw_00 said:

Nothing interesting in the registry that I saw.

However.. With the drive mounted, I uninstalled it from Device Manager (and it disappeared from the mounted drives in File Explorer as I would expect).  I then did a reboot, and the system did automount the drive!    However, after I unmounted it with the mountvol /D command,  and powered it off.  When I powered it on a bit later it would not automount,  I needed to do the mountvol <letter> <label> command as I have been doing to work around this issue.

 

Thanks anyway guys - I guess I'll just stick with the workaround.  

/j

Why did you run that command again when it gave you so much trouble the first time? Why not just use the "Safely remove hardware and Eject Media" from the task bar?

jeffw_00
Posted

@Bookmem- it was mountvol /P that gave me problems, not mountvol /D.  I need to have a way to script the mount/dismount (that's how it all started).  

Bookmem
Posted
3 hours ago, jeffw_00 said:

@Bookmem- it was mountvol /P that gave me problems, not mountvol /D.  I need to have a way to script the mount/dismount (that's how it all started).  

If you need to script, you should be using Linux.🤣

jeffw_00
Posted

Perl works quite well in windows 🙂

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...