Digg this topic Add to my del.icio.us Submit to SlashDot  
Reply to this topicStart new topic
> Force unmount option for imdisk, control panel has it, commandline does not :o
slothman
post Jul 2 2007, 10:25 PM
Post #1


Newbie
*

Group: Members
Posts: 5
Joined: 30-June 07
Member No.: 9,247


United States


Hello Olof,

I was wondering if you would consider adding a force unmount option to the command line imdisk. The control panel lets you do this if it tries to unmount and is not successful. The problem is the control panel only seems to pop up with the force unmount for certain errors. For drive not ready, it doesn't pop up.
Go to the top of the page
 
+Quote Post
Olof Lagerkvist
post Jul 2 2007, 11:04 PM
Post #2


Advanced Member
***

Group: Developer
Posts: 120
Joined: 27-April 07
From: Borås, Sweden
Member No.: 6,234


Sweden


QUOTE (slothman @ Jul 3 2007, 12:25 AM) *
I was wondering if you would consider adding a force unmount option to the command line imdisk. The control panel lets you do this if it tries to unmount and is not successful.

You can download my devioctl tool: http://www.ltr-data.se/files/devioctl.zip
It will let you dismount any drive forcefully, example:
CODE
devioctl forcedismount F:
imdisk -d -m F:

This will be exactly equivalent to selecting force dismount in the Control Panel applet.
QUOTE (slothman @ Jul 3 2007, 12:25 AM) *
The problem is the control panel only seems to pop up with the force unmount for certain errors. For drive not ready, it doesn't pop up.

The only case an ImDisk drive is "not ready" is when it has been deleted and there are still references to it, for example it may be waiting for another driver to release the last reference to the drive. This means that if the drive is "not ready" it is already dismounted so in that case it must be some other problem.

In which case do you see not-ready ImDisk drives? Do you really see them in the Control Panel applet in this case (even if you click Refresh)? Can you give me a hint on how to reproduce this scenario so that I can check what is really happening?
Go to the top of the page
 
+Quote Post
slothman
post Jul 3 2007, 01:05 AM
Post #3


Newbie
*

Group: Members
Posts: 5
Joined: 30-June 07
Member No.: 9,247


United States


QUOTE (Olof Lagerkvist @ Jul 2 2007, 06:04 PM) *
You can download my devioctl tool: http://www.ltr-data.se/files/devioctl.zip
It will let you dismount any drive forcefully, example:
CODE
devioctl forcedismount F:
imdisk -d -m F:


This will be exactly equivalent to selecting force dismount in the Control Panel applet.


Ahh, I didn't think I could do this with imdisk because I thought imdisk had to do that itself. Otherwise it wouldn't be able to free the drive properly. Apparently I was mistaken.

QUOTE (Olof Lagerkvist @ Jul 2 2007, 06:04 PM) *
The only case an ImDisk drive is "not ready" is when it has been deleted and there are still references to it, for example it may be waiting for another driver to release the last reference to the drive. This means that if the drive is "not ready" it is already dismounted so in that case it must be some other problem.

In which case do you see not-ready ImDisk drives? Do you really see them in the Control Panel applet in this case (even if you click Refresh)? Can you give me a hint on how to reproduce this scenario so that I can check what is really happening?


Well the only case I was able to make it happen was when I was using devio to remotely mount a small (10mb) ntfs partition. The connection was thru a virtual machine, and it dropped while I was in the middle of something. Can't remember exactly what I was doing when it happened. And yes I still see it in the control panel.

When I try to forcedismount with devioctl it says incorrect function. I think I see why though. The netstat table shows a CLOSE_WAIT on the connection. So the OS is waiting for imdisksvc to close the connection, but for some reason imdisksvc it is holding it open. I could dump the memory of imdisksvc with windbg if you want.
Go to the top of the page
 
+Quote Post
Olof Lagerkvist
post Jul 3 2007, 09:29 AM
Post #4


Advanced Member
***

Group: Developer
Posts: 120
Joined: 27-April 07
From: Borås, Sweden
Member No.: 6,234


Sweden


QUOTE (slothman @ Jul 3 2007, 03:05 AM) *
Ahh, I didn't think I could do this with imdisk because I thought imdisk had to do that itself. Otherwise it wouldn't be able to free the drive properly. Apparently I was mistaken.

I think the confusing thing is the difference between dismounting a filesystem on a drive and deleting the drive itself. Filesystems are dismounted by the filesystem driver (for example NTFS), not the disk driver (in this case imdisk.sys). In order to delete a drive the filesystem must be dismounted first, basically all other kind of references to the drive also need to be freed as well. So "devioctl forcedismount" will dismount the filesystem so that ImDisk later can remove the drive.
QUOTE (slothman @ Jul 3 2007, 03:05 AM) *
Well the only case I was able to make it happen was when I was using devio to remotely mount a small (10mb) ntfs partition. The connection was thru a virtual machine, and it dropped while I was in the middle of something. Can't remember exactly what I was doing when it happened. And yes I still see it in the control panel.

When I try to forcedismount with devioctl it says incorrect function.

Yes that is correct, you cannot dismount the filesystem of a drive that is "not ready" as there by definition is no filesystem mounted on a drive that is "not ready"... That is also the reason why the "force dismount" box does not show in the Control Panel applet, there is no filesystem to dismount on the drive. The reason the drive does not go away but is left in "not-ready" state is that there is something else holding a reference to it somewhere. I don't know what that could be though, the only thing we can know for sure is that it is not the filesystem driver in this case.
QUOTE (slothman @ Jul 3 2007, 03:05 AM) *
I think I see why though. The netstat table shows a CLOSE_WAIT on the connection. So the OS is waiting for imdisksvc to close the connection, but for some reason imdisksvc it is holding it open. I could dump the memory of imdisksvc with windbg if you want.

Thanks a lot for trying to help but I don't think this would help because of the communication technique behind this. The connections are initialized and kept up by the service but the communication itself is done directly by the driver. If any communication is hung somewhere it must be in the driver code.
Go to the top of the page
 
+Quote Post
« Next Oldest · ImDisk · Next Newest »
 

Fast ReplyReply to this topicStart new topic

Members Who Viewed Topic Today ()

 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

RSS Lo-Fi Version Time is now: 27th February 2008 - 12:13 PM

MKPortal ©2003-2006 mkportal.it