problems with FS caching ($Mft)

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there is an error during dismount of NTFS image that is currently using, saying:
“Windows was unable to save all data for the \Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

Thanks,

Best regards, Alex
mailto:xxxxx@StrongDisk.com

Hi,

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there
=
is an error during dismount of NTFS image that is currently using, =
saying:
“Windows was unable to save all data for the =
\Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

You do not need to send IRP_MJ_FLUSH buffers, FSCTL_DISMOUNT_VOLUME will
flush everything if volume is locked. Underlying device should be
accessible during dismount, you need to mark it inaccessible after
dismount finished but before you closed handle that was used to lock
volume to avoid subsequent mount by concurrent access to the volume.

send LOCK_VOLUME
send FSCTL_DISMOUNT_VOLUME
DISASSOCIATE LOGICAL DRIVE
close handle

Alexei.

I forgot, of course i’m using FSCTL_DISMOUNT_VOLUME also.

Using this

send LOCK_VOLUME
send FSCTL_DISMOUNT_VOLUME
DISASSOCIATE LOGICAL DRIVE
DISMOUNT VIRTUAL FS.

the problem have appeared also.

----- Original Message -----
From: “Alexei Jelvis”
To: “File Systems Developers”
Sent: Tuesday, April 16, 2002 6:28 PM
Subject: [ntfsd] Re: problems with FS caching ($Mft)

> Hi,
>
> >Hello all,
> >I’m writing a driver that emulating disk media in file. Sometimes, there
> =
> >is an error during dismount of NTFS image that is currently using, =
> >saying:
> >“Windows was unable to save all data for the =
> >\Device\DriverNameZ00003$Mft. The data has been lost. …”
> >
> >It means that $Mft WAS NOT saved correctly during cache flushing…
> >
> >
> >How should I dismount dynamic volumes correctly? Is it way correct ?
> >
> >send LOCK_VOLUME
> >send IRP_MJ_FLUSH_BUFFERS
> >DISASSOCIATE LOGICAL DRIVE
> >send IRP_MJ_FLUSH_BUFFERS
> >DISMOUNT VIRTUAL FS.
>
> You do not need to send IRP_MJ_FLUSH buffers, FSCTL_DISMOUNT_VOLUME will
> flush everything if volume is locked. Underlying device should be
> accessible during dismount, you need to mark it inaccessible after
> dismount finished but before you closed handle that was used to lock
> volume to avoid subsequent mount by concurrent access to the volume.
>
> send LOCK_VOLUME
> send FSCTL_DISMOUNT_VOLUME
> DISASSOCIATE LOGICAL DRIVE
> close handle
>
> Alexei.
>
> —
> You are currently subscribed to ntfsd as: xxxxx@7ka.mipt.ru
> To unsubscribe send a blank email to %%email.unsub%%
>

No need in calling flush, the FSD will do this automatically.

So:

  • disassociate logical drive
  • lock volume
  • dismount volume
  • unlock volume (this tears away the NTFS’s structures for a volume).

Max

----- Original Message -----
From: Alexander Bilichenko
To: File Systems Developers
Sent: Tuesday, April 16, 2002 5:30 PM
Subject: [ntfsd] problems with FS caching ($Mft)

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there is an error during dismount of NTFS image that is currently using, saying:
“Windows was unable to save all data for the \Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

Thanks,

Best regards, Alex
mailto:xxxxx@StrongDisk.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

  • Open the volume for read attributes only!
  • Lock volume (lock performs flush for you)
  • Dismount
  • Unlock volume
  • Close

If you open the volume for anything other than read attributes access,
the next volume command after the dismount (unlock in this case) will
cause the volume to remount.

If the lock or dismount fails, you can not do a pseudo eject of the
virtual disk; you must wait until all files on the volume are closed.
Same hold true for Zip and Jaz drives.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alexander
Bilichenko
Sent: Tuesday, April 16, 2002 6:31 AM
To: File Systems Developers
Subject: [ntfsd] problems with FS caching ($Mft)

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there
is an error during dismount of NTFS image that is currently using,
saying:
“Windows was unable to save all data for the
\Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

Thanks,

Best regards, Alex
mailto:xxxxx@StrongDisk.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

MessageAlso - if the volume is opened via “read attributes”, then FASTFAT will fail dismount from this handle.
NTFS works fine.

Max

----- Original Message -----
From: Jamey Kirby
To: File Systems Developers
Sent: Wednesday, April 17, 2002 12:10 AM
Subject: [ntfsd] RE: problems with FS caching ($Mft)

  • Open the volume for read attributes only!
  • Lock volume (lock performs flush for you)
  • Dismount
  • Unlock volume
  • Close

If you open the volume for anything other than read attributes access, the next volume command after the dismount (unlock in this case) will cause the volume to remount.

If the lock or dismount fails, you can not do a pseudo eject of the virtual disk; you must wait until all files on the volume are closed. Same hold true for Zip and Jaz drives.

Jamey
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Alexander Bilichenko
Sent: Tuesday, April 16, 2002 6:31 AM
To: File Systems Developers
Subject: [ntfsd] problems with FS caching ($Mft)

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there is an error during dismount of NTFS image that is currently using, saying:
“Windows was unable to save all data for the \Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

Thanks,

Best regards, Alex
mailto:xxxxx@StrongDisk.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

MessageSo, should i check FS before dismounting and open volume via “read attributes” only for NTFS ?
----- Original Message -----
From: Maxim S. Shatskih
To: File Systems Developers
Sent: Wednesday, April 17, 2002 12:48 AM
Subject: [ntfsd] RE: problems with FS caching ($Mft)

Also - if the volume is opened via “read attributes”, then FASTFAT will fail dismount from this handle.
NTFS works fine.

Max

----- Original Message -----
From: Jamey Kirby
To: File Systems Developers
Sent: Wednesday, April 17, 2002 12:10 AM
Subject: [ntfsd] RE: problems with FS caching ($Mft)

  • Open the volume for read attributes only!
  • Lock volume (lock performs flush for you)
  • Dismount
  • Unlock volume
  • Close

If you open the volume for anything other than read attributes access, the next volume command after the dismount (unlock in this case) will cause the volume to remount.

If the lock or dismount fails, you can not do a pseudo eject of the virtual disk; you must wait until all files on the volume are closed. Same hold true for Zip and Jaz drives.

Jamey
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Alexander Bilichenko
Sent: Tuesday, April 16, 2002 6:31 AM
To: File Systems Developers
Subject: [ntfsd] problems with FS caching ($Mft)

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there is an error during dismount of NTFS image that is currently using, saying:
“Windows was unable to save all data for the \Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

Thanks,

Best regards, Alex
mailto:xxxxx@StrongDisk.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntfsd as: xxxxx@7ka.mipt.ru
To unsubscribe send a blank email to %%email.unsub%%

MessageCan be a good idea.
----- Original Message -----
From: Alexander Bilichenko
To: File Systems Developers
Sent: Wednesday, April 17, 2002 2:55 PM
Subject: [ntfsd] RE: problems with FS caching ($Mft)

So, should i check FS before dismounting and open volume via “read attributes” only for NTFS ?
----- Original Message -----
From: Maxim S. Shatskih
To: File Systems Developers
Sent: Wednesday, April 17, 2002 12:48 AM
Subject: [ntfsd] RE: problems with FS caching ($Mft)

Also - if the volume is opened via “read attributes”, then FASTFAT will fail dismount from this handle.
NTFS works fine.

Max

----- Original Message -----
From: Jamey Kirby
To: File Systems Developers
Sent: Wednesday, April 17, 2002 12:10 AM
Subject: [ntfsd] RE: problems with FS caching ($Mft)

  • Open the volume for read attributes only!
  • Lock volume (lock performs flush for you)
  • Dismount
  • Unlock volume
  • Close

If you open the volume for anything other than read attributes access, the next volume command after the dismount (unlock in this case) will cause the volume to remount.

If the lock or dismount fails, you can not do a pseudo eject of the virtual disk; you must wait until all files on the volume are closed. Same hold true for Zip and Jaz drives.

Jamey
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Alexander Bilichenko
Sent: Tuesday, April 16, 2002 6:31 AM
To: File Systems Developers
Subject: [ntfsd] problems with FS caching ($Mft)

Hello all,
I’m writing a driver that emulating disk media in file. Sometimes, there is an error during dismount of NTFS image that is currently using, saying:
“Windows was unable to save all data for the \Device\DriverNameZ00003$Mft. The data has been lost. …”

It means that $Mft WAS NOT saved correctly during cache flushing…

How should I dismount dynamic volumes correctly? Is it way correct ?

send LOCK_VOLUME
send IRP_MJ_FLUSH_BUFFERS
DISASSOCIATE LOGICAL DRIVE
send IRP_MJ_FLUSH_BUFFERS
DISMOUNT VIRTUAL FS.

Thanks,

Best regards, Alex
mailto:xxxxx@StrongDisk.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntfsd as: xxxxx@7ka.mipt.ru
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%