Question Inactive Partition keeps getting mounted ?

Hello,
I just hit a brick wall here, i made a usb enclosore bootable with Ventoy (Asus Rog Strix Arion case with a samsung 970 evo 1TB ssd inside), Ventoy creates 2 partitions, 1 for ISO files or other data to be copied and a 32MB partition for boot, the problem is that i cannot make the 32mb partition to be marked as not mountable. I already tried diskpart and mark the respective partition as inactive but the message is "The partition is already marked as inactive" but still getting mounted.

The current system is irrelevant because this happens on multiple devices (actually all windows machines) no matter if it is windows 7, windows 10 or windows 11. I kept searching for a few weeks now for a script to put inside in the autorun.inf to auto unmount the partition but no success.
Can someone help me in this regard?
Yours gratefully,
Dragos Manea.

EDIT: Forgot to mention that i would like to be marked as not mountable on any device i connect the enclosure to, new and old.
 

kanewolf

Titan
Moderator
Hello,
I just hit a brick wall here, i made a usb enclosore bootable with Ventoy (Asus Rog Strix Arion case with a samsung 970 evo 1TB ssd inside), Ventoy creates 2 partitions, 1 for ISO files or other data to be copied and a 32MB partition for boot, the problem is that i cannot make the 32mb partition to be marked as not mountable. I already tried diskpart and mark the respective partition as inactive but the message is "The partition is already marked as inactive" but still getting mounted. The current system is irrelevant because this happens on multiple devices (actually all windows machines) no matter if it is windows 7, windows 10 or windows 11. I kept searching for a few weeks now for a script to put inside in the autorun.inf to auto unmount the partition but no success.
Can someone help me in this regard?
Yours gratefully,
Dragos Manea.

EDIT: Forgot to mention that i would like to be marked as not mountable on any device i connect the enclosure to, new and old.
Windows is stupid. It attempts to mount all visible devices. I ran into this with a fiber channel RAID array shared between two workstations. Without masking on the hardware controller to hide specific partitions, the first machine that booted, mounted everything.
I never found a solution within the Windows arena.
 

Ralston18

Titan
Moderator
If I am following correctly just allow all three to be mounted and then use some script or cmdlet via autorun to unmount the 32 MB partition.

Powershell may prove useful.

FYI:

https://superuser.com/questions/182...ition-using-a-foreach-statement-in-powershell

https://www.geekfrost.com/remove-partition-on-windows-11/#method_4_using_powershell

Eject might be viable as well:

https://www.thewindowsclub.com/mount-unmount-iso-file-windows-8

https://answers.microsoft.com/en-us...led-task/a4886851-603f-4b4f-bc12-c84c06f950d3

As noted Task Scheduler could be used.

Detection/presence of the mounted drive could trigger unmounting.

= = = =

Just thinking out loud.....
 
If I am following correctly just allow all three to be mounted and then use some script or cmdlet via autorun to unmount the 32 MB partition.

Powershell may prove useful.

FYI:

https://superuser.com/questions/182...ition-using-a-foreach-statement-in-powershell

https://www.geekfrost.com/remove-partition-on-windows-11/#method_4_using_powershell

Eject might be viable as well:

https://www.thewindowsclub.com/mount-unmount-iso-file-windows-8

https://answers.microsoft.com/en-us...led-task/a4886851-603f-4b4f-bc12-c84c06f950d3

As noted Task Scheduler could be used.

Detection/presence of the mounted drive could trigger unmounting.

= = = =

Just thinking out loud.....
First two links, you must select disk number manually, there is no auto method, 3rd link cannot be applied, and 4th link is not viable for new notebook/pc which i connect the usb memory.
Thank you for your reply.
 

Ralston18

Titan
Moderator
You are welcome but that raises more questions in my mind.

Does the disk number change?

If the disk number is constant you should be able to create a an input script that mimics a keyboard manual entry/ selection for that disk number.

Or if the disk number changes then some script to discover the disk number and store that in a variable. per Then reference the variable in the input script....

The third link URL references Windows 8 but the link itself is Windows 10/11. Your post is in Windows 11 - is Windows 11 the laptop's OS?

What sort of "new laptop" /"usb memory".

My suggestion is to open the Disk Management window and expand so all can be seen. Take a screenshot and post the screenshot here via imgur (www.imgur.com).

Include some additional details about the overall requirements.
 
You are welcome but that raises more questions in my mind.

Does the disk number change?

If the disk number is constant you should be able to create a an input script that mimics a keyboard manual entry/ selection for that disk number.

Or if the disk number changes then some script to discover the disk number and store that in a variable. per Then reference the variable in the input script....

The third link URL references Windows 8 but the link itself is Windows 10/11. Your post is in Windows 11 - is Windows 11 the laptop's OS?

What sort of "new laptop" /"usb memory".

My suggestion is to open the Disk Management window and expand so all can be seen. Take a screenshot and post the screenshot here via imgur (www.imgur.com).

Include some additional details about the overall requirements.
The use case is this, i work in a university enviroment, i keep using my drive on a lot of computers (and of course the drive number changes depending on the notebook i connect to it), i want that no matter what PC/Notebook i connect my USB enclosure to, the 32mb partition to not be mounted, many of the notebooks i connect my drive to will be the first time i connect to it and only time.
I hope i managed to explain my self, english is my 2nd language.
 

USAFRet

Titan
Moderator
The use case is this, i work in a university enviroment, i keep using my drive on a lot of computers (and of course the drive number changes depending on the notebook i connect to it), i want that no matter what PC/Notebook i connect my USB enclosure to, the 32mb partition to not be mounted, many of the notebooks i connect my drive to will be the first time i connect to it and only time.
I hope i managed to explain my self, english is my 2nd language.
1. I don't think you can preemptively prevent a random host system from mounting that partition.

2. Why does it matter if it is mounted?
 
I already tried diskpart and mark the respective partition as inactive but the message is "The partition is already marked as inactive" but still getting mounted.
Inactive - means volume can not be booted from. It has nothing to do with mounting.

You can set volume to be hidden and/or read only in diskpart.
attributes volume set readonly
attributes volume set hidden
 
  • Like
Reactions: Dragos Manea
Inactive - means volume can not be booted from. It has nothing to do with mounting.

You can set volume to be hidden and/or read only in diskpart.
attributes volume set readonly
attributes volume set hidden
This is something you must run manually, i wanted something to run as soon as i plug in the USB. Also my disk is MBR and it must remain MBR, the attributes on MBR disks will pe applied on both partitions
 
Last edited:
Attributes get assigned to selected volume only.
You run those commands single time only.

There's no need to repeat this each time on a different computer.
Just test it, yes on a MBR device it applies to both partition because MBR format does not have attributes to each partition but only for the entire disk, if i apply to one of them it auto-applies to the 2nd partition, anyway gonna try and make it GPT, it should fix the issue, thnak you for your suggestion. Lets see if it works the way i want in GPT format.
 

Ralston18

Titan
Moderator
@Dragos Manea

Before attempting to make the disk GPT be sure that all important data is backed up.

Also I am still not sure about why (as has been asked) not allowing the 32 GB partition to mount is important?

Consider that not having that partiton mounted may cause some other issue or problem.

I.e., the "Law of Unintended Consequences"....
 
@Dragos Manea

Before attempting to make the disk GPT be sure that all important data is backed up.

Also I am still not sure about why (as has been asked) not allowing the 32 GB partition to mount is important?

Consider that not having that partiton mounted may cause some other issue or problem.

I.e., the "Law of Unintended Consequences"....
Thank you for the warning!

Disk is converted to GPT and it seems to work with the attributes (readonly and hidden).
 

TRENDING THREADS