Hello,
I am working on an FSD. It is able to unmount the volumes via
FSCTL_DISMOUNT_VOLUME. However, after unmounting a volume, the device is
no longer accessible until the system is rebooted. I believe this is
because the device is not associated with a driver - either my FSD or RAW.
Is there anyway to reconnect the device to RAW such that it can be
reformatted or remounted? Or, am I misinterpreting the problem. My
background is UNIX, and I am trying to get a handle on Windows device
management.
Many thanks,
Steve S.
Corrent way of volume dismount:
- open an exclusive writeable handle to \.\D:, this imposes LOCK
- FSCTL_DISMOUNT_VOLUME
- close the handle
You can write the new filesystem before DISMOUNT, IIRC FORMAT does exactly
this.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Steve Soltis”
To: “Windows File Systems Devs Interest List”
Sent: Friday, November 21, 2003 2:42 AM
Subject: [ntfsd] Unmount/Re-mount question
> Hello,
>
> I am working on an FSD. It is able to unmount the volumes via
> FSCTL_DISMOUNT_VOLUME. However, after unmounting a volume, the device is
> no longer accessible until the system is rebooted. I believe this is
> because the device is not associated with a driver - either my FSD or RAW.
> Is there anyway to reconnect the device to RAW such that it can be
> reformatted or remounted? Or, am I misinterpreting the problem. My
> background is UNIX, and I am trying to get a handle on Windows device
> management.
>
> Many thanks,
>
> Steve S.
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
Probably FSCTL_DISMOUNT_VOLUME is not implemented properly in your file
system.
You don’t need to do something special to associate file system with the
device - first access to the device will trigger mount process if file
system released device in response to FSCTL_DISMOUNT_VOLUME.
If device is no longer accessible then it is likely that your file system is
still associated with the device and rejects all requests because it is in
some “bad” state.
After a “clean” dismount file system should delete the device object it
created during mount process, set Vpb->DeviceObject to NULL and clear
VPB_MOUNTED flag in Vpb. You need to verify that it actually happens. File
system should do this only when all files on the volume were closed, so one
probable source of problem is failure to initialize cache for some metadata
file objects during FSCTL_DISMOUNT_VOLUME.
The other way to force re-mount on the device is to return STATUS_REPARSE
with Information field set to IO_REMOUNT in response to a create request.
File system should perform this if dismount was not clean and some files are
still opened on the volume.
Alexei.
“Steve Soltis” wrote in message news:xxxxx@ntfsd…
>
> Hello,
>
> I am working on an FSD. It is able to unmount the volumes via
> FSCTL_DISMOUNT_VOLUME. However, after unmounting a volume, the device is
> no longer accessible until the system is rebooted. I believe this is
> because the device is not associated with a driver - either my FSD or RAW.
> Is there anyway to reconnect the device to RAW such that it can be
> reformatted or remounted? Or, am I misinterpreting the problem. My
> background is UNIX, and I am trying to get a handle on Windows device
> management.
>
> Many thanks,
>
> Steve S.
>
>
“Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
> system should do this only when all files on the volume were closed, so
one
> probable source of problem is failure to initialize cache for some
metadata
Oops, I meant unintialize cache
> file objects during FSCTL_DISMOUNT_VOLUME.
> If device is no longer accessible then it is likely that your file system is
still associated with the device and rejects all requests because it is in
some “bad” state.
Alexei & Maxim,
Thanks for the advice. It turns out that my driver was leaving the device
in a bad state. Actually, knowing that a remount is possible/automatic
was the most helpful piece of information.
Cheers,
Steve