Jump to content











Photo
- - - - -

ImDisk & Win10 b10565/10576 : error defining letter drive


  • Please log in to reply
18 replies to this topic

#1 pupoul

pupoul
  • Members
  • 5 posts
  •  
    France

Posted 30 October 2015 - 04:40 PM

Hello,

 

I'm trying to create multi-boot external hard drive with easy2boot.

 

Some part of the tutorial to add Openelec Installer to easy2boot involves imdisk, but this is not working on my system , here the contents of  the dos box :

 

Running: imdisk -a -s 255m -m U: -f "c:\temp\essai.imgPTN" -x 63 -y 255 -p "/FS:FAT32 /Q /Y"
Error defining drive letter: Descripteur non valide
Creating device...
Created device 0: U: -> c:\temp\essai.imgPTN
ImDisk operation failed to mount "c:\temp\essai.imgPTN"
Appuyez sur une touche pour continuer...
 
So, imdisk seems unable to create letter drive U:
 
If i type
subst u: c:\
U: is defined, and
subst u: /d
u: did not exist. So i'm sure U: is not defined when imdisk try to define it.
 
I try everything i could : stop A/V, disable UAC, permission everyone/eveything, then type the same command in an admin dos box : same error.
 
The error appears again if i right click on a drive and choose "Save disk contents in image file".
 
If i try to create it with control panel, i can, U: is created, Windows says it needs to be formatted. But when i want to remove it imdisk says "cannot lock the device. The device may be used by another process or you may not have permission to lock it.". I click ok and i can remove it.
 
My system is Windows 10 x64, b10565 & b10576, 16GB RAM, 128GB System + 2 TB +2TB external (Easy2Boot prepared) +1 TB HDD + many drives from USB card reader. imdisk V2.0.6, tried imdisk V1.9.4 whith same result.
 
Any idea ?


#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1339 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 30 October 2015 - 04:53 PM

I have got a few reports about this and I have been able to verify it. The -p option does not work with 10565 build and later. If Microsoft actually keeps this change for final release I have to make a change that could have side effects on older Windows versions, so I won't do that until I have seen it in final release.

Meanwhile using technical preview versions, you could work around the problem by removing your -p switch and instead call format manually afterwards.

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 30 October 2015 - 10:52 PM

imdisk -a -o cd -f "%USBDRIVE%%MYISO%" -m %ISOLETTER%

 

This is the command that is failing in Easy2Boot.



#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1339 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 31 October 2015 - 07:47 AM

imdisk -a -o cd -f "%USBDRIVE%%MYISO%" -m %ISOLETTER%

 

This is the command that is failing in Easy2Boot.

 

Is this %ISOLETTER% a drive letter that already exists but being redefined here to point to an ImDisk drive? In that case, that's the problem. Beginning with build 10565 it is no longer possible to create a drive letter assignment for a drive letter that already exists. The only workaround I have found for that is to use for instance dosdev.exe to remove the original drive letter definition first:

dosdev -d D:

dosdev -d Global\D:

 

I have asked Microsoft whether this is an intentional change to the API or if it is just an unexpected side effect of some other change, but got no answer so far. I guess we need to wait for final release to see how it works there. The error message is the rather strange "the handle is invalid", which makes me suspect that this change to the API might have happened unintentionally. There is no such error return documented for DefineDosDevice API and since not many applications use that API these days it could happen that nobody at Microsoft noticed.



#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 31 October 2015 - 09:31 AM

The ISOLETTER does not already exist.

Actually I am booting from the Install ISO  boot.wim file to install WIndows,  and so it is WinPE environment.

Some versions are OK and work, some (e.g. Enterprise 10565) report an error.

P.S. Just retested this and I don't see the problem with the latest version of ImDisk on 10565. I will test with 10576 and report back!



#6 pupoul

pupoul
  • Members
  • 5 posts
  •  
    France

Posted 31 October 2015 - 09:35 AM

Hello, I confess, I did not understand Steve6375 post, because this is not the line is not working on my PC. Maybe another problem ?

Olof, the -p is the cause of the bug as you said. I modified batch file of Easy2Boot to delete -p switch and add somes lines to format drive just added, with parameters of -p switch, like this (yes, you right, this is ugly :D)

 

 

REM Modification for suppress Windows 10 build 10565&10576 error
REM Following 3 lines had been commented, then following 5 lines had been added
 
REM --------------------Commented------------------------
REM echo Running: imdisk -a -s %MYSIZE%m -m %SPAREVOL% -f !MYIMG! -x 63 -y 255 -p "/FS:%MYFMT% /Q /Y"
REM               imdisk -a -s %MYSIZE%m -m %SPAREVOL% -f !MYIMG! -x 63 -y 255 -p "/FS:%MYFMT% /Q /Y" > imdisk.log
REM      if errorlevel 1 type imdisk.log & echo ImDisk operation failed to mount !MYIMG!! & pause & goto :unmount
REM ----------------End of commented---------------------
 
REM ----------------------Added--------------------------
echo Running: imdisk -a -s %MYSIZE%m -m %SPAREVOL% -f !MYIMG! -x 63 -y 255 then only if no error FORMAT %SPAREVOL% /FS:%MYFMT% /Q /Y
 imdisk -a -s %MYSIZE%m -m %SPAREVOL% -f !MYIMG! -x 63 -y 255 >imdisk.log
 if errorlevel 1 type imdisk.log & echo ImDisk operation failed to mount !MYIMG!! & pause & goto :unmount
              format %SPAREVOL% /FS:%MYFMT% /Q /Y >>imdisk.log
REM modified to comply with Steve post
if errorlevel 1 type imdisk.log & echo ImDisk operation failed to mount !MYIMG!! & pause & goto :unmount
REM ------------------End of added-----------------------
 

 

I tried this, and the imgPTN as been created without error, then the letter added had been dismount, as expected.

 

I will post this in easy2boot forum if you do not see any danger (I tried to prevent format of a drive already present...) in this, not for modification, but to let people with same problem to modify the batch, waiting a real fix.

 

Thank you very much, have a good day.


Edited by pupoul, 31 October 2015 - 09:55 AM.


#7 pupoul

pupoul
  • Members
  • 5 posts
  •  
    France

Posted 31 October 2015 - 09:36 AM

EDIT : double post ,sorry


Edited by pupoul, 31 October 2015 - 09:36 AM.


#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 31 October 2015 - 09:44 AM

if not errorlevel 0    - means it will never fail  (if not 0 or greater than 0)

 

try

if errorlevel 1 

instead



#9 pupoul

pupoul
  • Members
  • 5 posts
  •  
    France

Posted 31 October 2015 - 09:53 AM

Thanks for your help Steve, I modified this.



#10 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1339 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 31 October 2015 - 08:30 PM

@steve6375
What is the exact error message you get? Is it the same "the handle is invalid" as in the original problem discussed in this thread, or do you get some other message? Just so that I could try to investigate further what happens in your case.

#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 31 October 2015 - 08:36 PM

I was using July 2014 version of ImDisk and Enterprise 10565.

I cannot reproduce this now with the latest version of ImDisk. 

Forget about it for now.



#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 15 November 2015 - 12:54 AM

Threshold 2 new release version still has the original /p issue. :boo:

http://rmprepusb.blo...windows-10.html



#13 v77

v77

    Silver Member

  • Team Reboot
  • 521 posts
  •  
    France

Posted 15 November 2015 - 12:39 PM

Beginning with build 10565 it is no longer possible to create a drive letter assignment for a drive letter that already exists.

 

Olof, what do you mean by that? As you already use GetLogicalDrives to know what are the drive letters in use, there should not be any problem... (even if we are supposed to be able to define a drive letter several times)



#14 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1339 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 15 November 2015 - 12:50 PM

Olof, what do you mean by that? As you already use GetLogicalDrives to know what are the drive letters in use, there should not be any problem... (even if we are supposed to be able to define a drive letter several times)


Just to make sure that we really format the correct drive, imdisk.exe creates a new drive letter link with DefineDosDevice before calling format.com. This has nothing to do with finding free drive letters, which is another thing and like you say not a problem here.

The problem is rather when someone wants to create an ImDisk drive with a drive letter that is already in use. I have got many reports over the years from people who have got the original drive formatted rather than the new one they have created with ImDisk, so the extra DefineDosDevice before calling format.com was more or less there to make absolutely sure that this would not happen.

But with the latest builds of Windows 10, it is no longer possible to call DefineDosDevice to create a drive letter that is already in use. This causes DefineDosDevice before calling format.com to fail, because the drive letter is already defined, either by ImDisk driver when virtual disk is created in kernel mode or defined by some other drive in the system. To be safe, imdisk.exe then quits without formatting anything.

I plan to fix this by calling QueryDosDevice first and check whether drive letter already points to the correct ImDisk drive. Only if it does not, it will redefine the drive letter to point to the newly created ImDisk drive. This will make things still work correctly on older versions of Windows, but will fail on later Windows 10 builds if user attempts to use a drive letter that is already in use by something else. This will still be the most safe approach I guess, and pretty much the best we can do right now. It also has the advantage that if DefineDosDevice behaviour change back to the old some time with future updates, it will automatically start to work again with imdisk.exe as well.

#15 v77

v77

    Silver Member

  • Team Reboot
  • 521 posts
  •  
    France

Posted 15 November 2015 - 01:16 PM

Just to make sure that we really format the correct drive, imdisk.exe creates a new drive letter link with DefineDosDevice before calling format.com.

 
Ah yes sorry, I forgot the change you made about that some times ago.

I now understand better the bug described here, and fully agree with your new approach.


  • Olof Lagerkvist likes this

#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 6597 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 17 November 2015 - 12:29 PM

New version http://reboot.pro/to...e-5#entry196360

seems to work OK for me...  :1st:


  • Olof Lagerkvist likes this

#17 pupoul

pupoul
  • Members
  • 5 posts
  •  
    France

Posted 17 November 2015 - 09:07 PM

Hello,

 

I can confirm new version work like a charm !

Many thanks !


  • Olof Lagerkvist likes this

#18 eberge

eberge
  • Members
  • 1 posts
  •  
    United States

Posted 03 March 2016 - 08:33 PM

I am a file system developer for Quantum and ran into this as well (DefineDosDevice) failing.

 

However, the March 1, 2016 update to Windows 10 appears to have fixed this from what I can see, so you might want to check this again without your workaround.


  • Olof Lagerkvist likes this

#19 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1339 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 03 March 2016 - 08:58 PM

I am a file system developer for Quantum and ran into this as well (DefineDosDevice) failing.

 

However, the March 1, 2016 update to Windows 10 appears to have fixed this from what I can see, so you might want to check this again without your workaround.

 

Thanks for sharing this information. After a quick test I can confirm that redefining an existing drive letter is possible again after this update to Windows 10. There is no change needed to ImDisk since I implemented the fix for this in such a way that it would automatically start to work again if OS behaviour would change back to the former, which now apparently has happened.


  • steve6375 likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users