Jump to content











Photo
- - - - -

Mounting large image file in ramdisk. When can we know when the drive is ready?

imdisk ramdisk

Best Answer Olof Lagerkvist , 30 October 2015 - 05:26 PM

Hi,

First, I would like to say that Imdisk is an awesome tool and I use it every day. Thanks!


Thanks! :)
 

Second, my problem :) I have actually two problems. I'm using Windows 7.
I have a script to mount a ramdisk with a 4gb disk image file
 

 imdisk -a -t vm -f file.img -m Z:
The script is running fast but in fact the mounting process (and copying I guess) is not finished and the drive is not accessible on windows. I have to wait around 5 minutes to access it (which is normal because you have to read/copy 4gb in the RAm). In my script I would like to use the drive Z: after the mounting but I can't because Imdisk is releasing before the drive is ready.
So I was wondering if there is a way to know when the drive is ready in command-line or force imdisk to wait until the drive is ready ?

 


Simply do anything that triggers filesystem mounting. That would wait until the drive is ready. For instance, dir Z: or similar.
 

My second problem has been already raised in the forum but I didn't find the right answer. I never manage to unmount a drive without using -D option.
I mount my image using:

    imdisk -a -f file.img -m Z:
and if I unmount (with administrator privilege) using:
    imdisk -d -m Z:
I always get "Z: access is denied".
I checked with handle.exe and process explorer but couldn't find any locked files.
With:
    handle.exe -a | find "Z:"
I get the following answer:
 BDC: File <--->   Z:\
15F8: File <--->   Z:\

I don't know what is it.

 


Probably some application that has Z:\ opened as current directory or something like that. But you don't know which process it is since you filter the output with "find" which filters out the process name headers in the output. I would guess that your best option is to use Process Explorer and search not only for Z: but also for things like ImDisk in case something has the device opened directly without using drive letter. It should be possible to find out in one way or another what happens here!

 

:cheers:

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 PierrePierre

PierrePierre
  • Members
  • 2 posts
  •  
    France

Posted 30 October 2015 - 12:07 PM

Hi,

First, I would like to say that Imdisk is an awesome tool and I use it every day. Thanks!

Second, my problem :) I have actually two problems. I'm using Windows 7.
I have a script to mount a ramdisk with a 4gb disk image file
 

 imdisk -a -t vm -f file.img -m Z:

The script is running fast but in fact the mounting process (and copying I guess) is not finished and the drive is not accessible on windows. I have to wait around 5 minutes to access it (which is normal because you have to read/copy 4gb in the RAm). In my script I would like to use the drive Z: after the mounting but I can't because Imdisk is releasing before the drive is ready.
So I was wondering if there is a way to know when the drive is ready in command-line or force imdisk to wait until the drive is ready ?


My second problem has been already raised in the forum but I didn't find the right answer. I never manage to unmount a drive without using -D option.
I mount my image using:

    imdisk -a -f file.img -m Z:

and if I unmount (with administrator privilege) using:

    imdisk -d -m Z:

I always get "Z: access is denied".
I checked with handle.exe and process explorer but couldn't find any locked files.
With:

    handle.exe -a | find "Z:"

I get the following answer:
 BDC: File <--->   Z:\
15F8: File <--->   Z:\

I don't know what is it.

and FYI, I have no antivirus and I use truecrypt for other drives (don't know if it could interfere?).

If someone has any tips it would be great :D Thanks!
 



#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 30 October 2015 - 05:26 PM   Best Answer

Hi,

First, I would like to say that Imdisk is an awesome tool and I use it every day. Thanks!


Thanks! :)
 

Second, my problem :) I have actually two problems. I'm using Windows 7.
I have a script to mount a ramdisk with a 4gb disk image file
 

 imdisk -a -t vm -f file.img -m Z:
The script is running fast but in fact the mounting process (and copying I guess) is not finished and the drive is not accessible on windows. I have to wait around 5 minutes to access it (which is normal because you have to read/copy 4gb in the RAm). In my script I would like to use the drive Z: after the mounting but I can't because Imdisk is releasing before the drive is ready.
So I was wondering if there is a way to know when the drive is ready in command-line or force imdisk to wait until the drive is ready ?

 


Simply do anything that triggers filesystem mounting. That would wait until the drive is ready. For instance, dir Z: or similar.
 

My second problem has been already raised in the forum but I didn't find the right answer. I never manage to unmount a drive without using -D option.
I mount my image using:

    imdisk -a -f file.img -m Z:
and if I unmount (with administrator privilege) using:
    imdisk -d -m Z:
I always get "Z: access is denied".
I checked with handle.exe and process explorer but couldn't find any locked files.
With:
    handle.exe -a | find "Z:"
I get the following answer:
 BDC: File <--->   Z:\
15F8: File <--->   Z:\

I don't know what is it.

 


Probably some application that has Z:\ opened as current directory or something like that. But you don't know which process it is since you filter the output with "find" which filters out the process name headers in the output. I would guess that your best option is to use Process Explorer and search not only for Z: but also for things like ImDisk in case something has the device opened directly without using drive letter. It should be possible to find out in one way or another what happens here!

 

:cheers:



#3 PierrePierre

PierrePierre
  • Members
  • 2 posts
  •  
    France

Posted 01 November 2015 - 12:14 AM

Hi Olof,

 

Thanks! Indeed dir Z: is working nicely to check if / wait when the drive is ready.

 

For the other problem, I found out that the explorer is creating a Z: handle each time I have a window opened even if I'm not pointing on Z:

If I close all the windows, I can unmount normally.


  • Olof Lagerkvist likes this





Also tagged with one or more of these keywords: imdisk, ramdisk

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users