Forum

Please or Register to create posts and topics.

agFM not being installed, tiny PTN2 partition being left over

This bug report is for version 2.11_DPMS. I'm using MAKE_E2B_USB_DRIVE.cmd with 64GB USB drive on Windows 10, and I was getting a 12KB FAT partition with label PTN2, both in expert and non-expert mode. agFM and Ventoy were not being installed. It appeared that the small 2nd partition that was made by RMPartUSB - it was not getting deleted.

I saw that when diskpart was running "DEL PART" command, it was getting an error:

Virtual Disk Service error:
The device is in use.

The selected volume or partition is in use.
To continue with the operation use the OVERRIDE parameter.

I got it to work by replacing "DEL PART" command with "DEL PART OVERRIDE" command, both in expert and non-expert mode.

My patch (added OVERRIDE param in comments also for completeness):

--- MAKE_E2B_USB_DRIVE.orig.cmd 2021-11-24 09:06:26.000000000 -0600
+++ MAKE_E2B_USB_DRIVE.cmd 2021-12-29 11:23:02.284526900 -0600
@@ -438,7 +438,7 @@
echo SELECT DISK %DD% >> "%temp%\diskpart.scr"
echo LIST DISK >> "%temp%\diskpart.scr"
echo SEL PART 2 >> "%temp%\diskpart.scr"
-echo DEL PART >> "%temp%\diskpart.scr"
+echo DEL PART OVERRIDE >> "%temp%\diskpart.scr"
echo EXIT >> "%temp%\diskpart.scr"
:: check script selects correct disk
%WINDIR%\system32\find.exe /i "SELECT DISK %DD%" "%temp%\diskpart.scr" > nul || goto :skip_p2
@@ -453,7 +453,7 @@
echo SELECT DISK %DD% >> "%temp%\diskpart.scr"
echo LIST DISK >> "%temp%\diskpart.scr"
::echo SEL PART 2 >> "%temp%\diskpart.scr"
-::echo DEL PART >> "%temp%\diskpart.scr"
+::echo DEL PART OVERRIDE >> "%temp%\diskpart.scr"
if not "%P2SIZE%"=="0" if not "%P2SIZE%"=="MAX" set /A PS2=%P2SIZE% * 1024
if not "%P2SIZE%"=="0" if not "%P2SIZE%"=="MAX" echo CREATE PART PRI SIZE=%PS2% >> "%temp%\diskpart.scr"
if "%P2SIZE%"=="MAX" echo CREATE PART PRI >> "%temp%\diskpart.scr"
@@ -552,7 +552,7 @@
echo SELECT DISK %DD% >> "%temp%\diskpart.scr"
echo LIST DISK >> "%temp%\diskpart.scr"
echo SEL PART 2 >> "%temp%\diskpart.scr"
-echo DEL PART >> "%temp%\diskpart.scr"
+echo DEL PART OVERRIDE >> "%temp%\diskpart.scr"
echo EXIT >> "%temp%\diskpart.scr"
:: check script selects correct disk
%WINDIR%\system32\find.exe /i "SELECT DISK %DD%" "%temp%\diskpart.scr" > nul || goto :skip_p2
@@ -571,7 +571,7 @@
echo SELECT DISK %DD% >> "%temp%\diskpart.scr"
echo LIST DISK >> "%temp%\diskpart.scr"
::echo SEL PART 2 >> "%temp%\diskpart.scr"
-::echo DEL PART >> "%temp%\diskpart.scr"
+::echo DEL PART OVERRIDE >> "%temp%\diskpart.scr"
echo CREATE PART PRI >> "%temp%\diskpart.scr"
echo SEL PART 2 >> "%temp%\diskpart.scr"
echo FORMAT %FS% LABEL="E2B_PTN2" QUICK >> "%temp%\diskpart.scr"

Thanks for report

The script works for most people and no one else has reported the same issue.

Why would your system be any different from everyone else?

Hi Steve,

Calling Sysinternals handle.exe right before running diskpart script with DEL PART yields only this handle open for PTN2 volume:

SearchIndexer.exe pid: 7312 type: File 1710: \Device\HarddiskVolume125\

I also have multiple antiviruses installed on the machine: Cybereason, Malwarebytes Endpoint, Symantec Endpoint.

At 1st glance looks like a race condition, a new volume being scanned by daemon(s) after creation, possibly exacerbated by slow USB controller. Perhaps a more appropriate fix would be to check whether PTN2 is busy and wait for it for ~10 sec until it becomes available?... or atomically create-and-delete PTN2, or change RMPartUSB to avoid creating PTN2 in the 1st place, or some such?

Multi-buy discount 10%

eBooks (in PDF format)

Easy-to-read eBooks are available in PDF format (each eBook is over 100 pages) – rated 4.5/5 stars.
Learn the secrets of Legacy and UEFI USB booting and then make your perfect multiboot USB drive.
E2B eBook #1 includes instructions on how to remove the E2B 5-second start-up delay blue screen.

E2B is unique in that it uses partition images which allows you to directly boot from Secure Boot images (no need to disable Secure Boot or run MOK manager or modify your UEFI BIOS).

Most eBooks are over 100 pages long, contain original content (not AI generated!) and step-by-step exercises which are suitable for both the beginner or the more experienced user.
Customer reviews are located at bottom of each eBook product page and multi-buy discounts are available when you buy more than one eBook. Please also visit RMPrepUSB.com and the E2B Forum.
Subscribe to my blog for the latest news, tips, USB boot articles and free eBook updates.