agFM not being installed, tiny PTN2 partition being left over
Quote from Deleted user on 2021-12-29, 5:34 PMThis 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"
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"
Quote from SteveSi on 2021-12-29, 5:39 PMThanks 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?
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?
Quote from Deleted user on 2021-12-29, 6:17 PMHi 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?
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?