Hi,
I have developed a filter driver in which I’m replicating a WRITE request and diverting newly created request to the other volume to perform WRITE operation. When I wrote something on 1st volume, it requires a reboot to take effect. Only after a reboot I am able to see the same contents on 2nd volume.
Why is it so? Is it a case that data didn’t get flushed immediately? If so, how much time I should wait to see the changes?
Thanks in advance!
Hi
It depends on how much data you wrote ? Did cache got flushed ?
Rather than waiting, develop a utility that will flush cache for 1st volume and 2nd volume. FlushFileBuffers() is the API you can use.
xxxxx@hotmail.com wrote: Hi,
I have developed a filter driver in which I’m replicating a WRITE request and diverting newly created request to the other volume to perform WRITE operation. When I wrote something on 1st volume, it requires a reboot to take effect. Only after a reboot I am able to see the same contents on 2nd volume.
Why is it so? Is it a case that data didn’t get flushed immediately? If so, how much time I should wait to see the changes?
Thanks in advance!
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Get the freedom to save as many mails as you wish. Click here to know how.
xxxxx@hotmail.com wrote:
Hi,
I have developed a filter driver in which I’m replicating a WRITE request and diverting newly created request to the other volume to perform WRITE operation. When I wrote something on 1st volume, it requires a reboot to take effect. Only after a reboot I am able to see the same contents on 2nd volume.
Why is it so? Is it a case that data didn’t get flushed immediately? If so, how much time I should wait to see the changes?
Thanks in advance!
Hi,
Could you tell me how you *diverting newly created request to the other
volume to perform WRITE operation*?
Maybe we have the same problem.
Thanks~
wrote in message news:xxxxx@ntdev…
> Hi,
>
> I have developed a filter driver in which I’m replicating a WRITE request
> and diverting newly created request to the other volume to perform WRITE
> operation. When I wrote something on 1st volume, it requires a reboot to
> take effect. Only after a reboot I am able to see the same contents on
> 2nd volume.
> Why is it so? Is it a case that data didn’t get flushed immediately? If
> so, how much time I should wait to see the changes?
>
How are you installing this, and how are you writing to the second volume?
Is this thing a disk filter? Are you doing IRP writes to the second
volumne?
You have not given us any useful information so all I can sya if YOU DID
SOMETHING WRONG.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
> It depends on how much data you wrote ? Did cache got flushed ?
Rather than waiting, develop a utility that will flush cache for 1st
volume and 2nd volume. FlushFileBuffers() is the API you can use.
Pankaj, thanks for reply! I’ll try to develop that ‘flush’ utility.
How are you installing this, and how are you writing to the second volume?
Is this thing a disk filter? Are you doing IRP writes to the second
volumne?
You have not given us any useful information so all I can sya if YOU DID
SOMETHING WRONG.
Don,
Yes, I’m doing IRP writes to the second volume. Its a volume filter driver. I also wrote INF file for the installation of the same. After rebooting I am getting the data on second volume what I have written to the first one, thus I also agree with Pankaj’s opinion. What do you think?
Thanks for reply!
If you are writing to the disk and not the file system “Pankaj’s opinion”
is totally wrong. Caching is done at the file system layer in Windows and
if you remain below this for both the filter and the writes worrying about
flushing files is useless. Note: you really want to stay below if
possible, because flushing files is also a ton of work.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
wrote in message news:xxxxx@ntdev…
>> It depends on how much data you wrote ? Did cache got flushed ?
>>
>> Rather than waiting, develop a utility that will flush cache for 1st
>> volume and 2nd volume. FlushFileBuffers() is the API you can use.
>
> Pankaj, thanks for reply! I’ll try to develop that ‘flush’ utility.
>
>
>> How are you installing this, and how are you writing to the second
>> volume?
>> Is this thing a disk filter? Are you doing IRP writes to the second
>> volumne?
>>
>> You have not given us any useful information so all I can sya if YOU DID
>> SOMETHING WRONG.
>>
>
> Don,
> Yes, I’m doing IRP writes to the second volume. Its a volume filter
> driver. I also wrote INF file for the installation of the same. After
> rebooting I am getting the data on second volume what I have written to
> the first one, thus I also agree with Pankaj’s opinion. What do you
> think?
> Thanks for reply!
>
>
Lets see,
You configure your driver (volume filter) to monitor writes on Vol A and
in your driver you mirror those writes to Vol B.
Is that right ?
If yes, then you need to exclusively lock and unmount vol2 before you
start mirroring vol1 writes into it.
Presentation of vol2(with valid FS!) as a mirror of vol1 is tricky. You
have to keep vol2 submerged (locked and unmounted!) while you are
mirroring into it. When you do want to “surface” vol2, you issue flush
on top of vol1 and then unlock vol2. System will peek at vol2 and try to
“mount” the FS on it.
Your product has to have a notion of discreet(on demand!) “surface”
requests.
Harish
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-296543-
xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Monday, August 06, 2007 6:05 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Why reboot needed?
If you are writing to the disk and not the file system “Pankaj’s
opinion”
is totally wrong. Caching is done at the file system layer in Windows
and
if you remain below this for both the filter and the writes worrying
about
flushing files is useless. Note: you really want to stay below if
possible, because flushing files is also a ton of work.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
wrote in message news:xxxxx@ntdev…
> >> It depends on how much data you wrote ? Did cache got flushed ?
> >>
> >> Rather than waiting, develop a utility that will flush cache for
1st
> >> volume and 2nd volume. FlushFileBuffers() is the API you can use.
> >
> > Pankaj, thanks for reply! I’ll try to develop that ‘flush’ utility.
> >
> >
> >> How are you installing this, and how are you writing to the second
> >> volume?
> >> Is this thing a disk filter? Are you doing IRP writes to the
second
> >> volumne?
> >>
> >> You have not given us any useful information so all I can sya if
YOU
> DID
> >> SOMETHING WRONG.
> >>
> >
> > Don,
> > Yes, I’m doing IRP writes to the second volume. Its a volume filter
> > driver. I also wrote INF file for the installation of the same.
After
> > rebooting I am getting the data on second volume what I have written
> to
> > the first one, thus I also agree with Pankaj’s opinion. What do you
> > think?
> > Thanks for reply!
> >
> >
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
Hold up here, you are jumping on an implementation when the OP has not
specified what he is after. For instance one could:
- Do it at the disk level hiding the second disk with a filter.
- Use logging to a partition to record the changes in the monitored
volume
- Present the volume as a partition type foreign to Windows, and only
convert it to the correct type when needed.
I am sure there are a ton more. One of the reasons consultants like OSR
charge what they do is to offer options to the clients. We have to know
the OP’s needs before you jump into details.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
“Harish Arora” wrote in message
news:xxxxx@ntdev…
Lets see,
You configure your driver (volume filter) to monitor writes on Vol A and
in your driver you mirror those writes to Vol B.
Is that right ?
If yes, then you need to exclusively lock and unmount vol2 before you
start mirroring vol1 writes into it.
Presentation of vol2(with valid FS!) as a mirror of vol1 is tricky. You
have to keep vol2 submerged (locked and unmounted!) while you are
mirroring into it. When you do want to “surface” vol2, you issue flush
on top of vol1 and then unlock vol2. System will peek at vol2 and try to
“mount” the FS on it.
Your product has to have a notion of discreet(on demand!) “surface”
requests.
Harish
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-296543-
> xxxxx@lists.osr.com] On Behalf Of Don Burn
> Sent: Monday, August 06, 2007 6:05 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Why reboot needed?
>
> If you are writing to the disk and not the file system “Pankaj’s
> opinion”
> is totally wrong. Caching is done at the file system layer in Windows
> and
> if you remain below this for both the filter and the writes worrying
> about
> flushing files is useless. Note: you really want to stay below if
> possible, because flushing files is also a ton of work.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
> wrote in message news:xxxxx@ntdev…
> >> It depends on how much data you wrote ? Did cache got flushed ?
> >>
> >> Rather than waiting, develop a utility that will flush cache for
1st
> >> volume and 2nd volume. FlushFileBuffers() is the API you can use.
> >
> > Pankaj, thanks for reply! I’ll try to develop that ‘flush’ utility.
> >
> >
> >> How are you installing this, and how are you writing to the second
> >> volume?
> >> Is this thing a disk filter? Are you doing IRP writes to the
second
> >> volumne?
> >>
> >> You have not given us any useful information so all I can sya if
YOU
> DID
> >> SOMETHING WRONG.
> >>
> >
> > Don,
> > Yes, I’m doing IRP writes to the second volume. Its a volume filter
> > driver. I also wrote INF file for the installation of the same.
After
> > rebooting I am getting the data on second volume what I have written
> to
> > the first one, thus I also agree with Pankaj’s opinion. What do you
> > think?
> > Thanks for reply!
> >
> >
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
Hi Don, Harish,
Thanks for reply!
This is not a product nor do I belong to any IT industry. I’m a student and developing this project for knowledge purpose.
Harish, you are right, I’m doing the things exactly as you mentioned. My volume filter driver sits exactly below the File system. How to unmount & mount the volumes? Could you give a hint?
Lets see,
You configure your driver (volume filter) to monitor writes on Vol A and
in your driver you mirror those writes to Vol B.
Is that right ?
Don, you are right, the ‘flush’ utility didn’t work for me
as you mentioned in your last reply. I’m not residing at disk level rather I’m at volume layer below the file system. I thought of implementing disk mirror driver but shifted to volume mirror as things look easy at that time for volume mirror. Things that you mentioned are from disk mirror point of view & will not be applicable at volume level. Is that right? Could you please suggest something to proceed further?
- Do it at the disk level hiding the second disk with a filter.
- Use logging to a partition to record the changes in the monitored
volume
- Present the volume as a partition type foreign to Windows, and only
convert it to the correct type when needed.
Please let me know your thoughts. Thanks!
If you are writing something to the mounted FS volume bypassing the FS -
then yes, the FS will see the updates only on next mount.
Anyway this is a dirty trick. The reason is that FS can do cache flushes or
other writes to the volume, and, in combination with your writes, this can
create broken FS structure on the volume.
So, remount the FS after each such write, or - even better - write “during
remount”, LOCK/DISMOUNT/write/UNLOCK/CloseHandle. This is what CHKDSK /F does.
Writing this way without remounts will require the cluster FS, and Windows
is shipped without them.
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> Hi,
>
> I have developed a filter driver in which I’m replicating a WRITE request and
diverting newly created request to the other volume to perform WRITE operation.
When I wrote something on 1st volume, it requires a reboot to take effect. Only
after a reboot I am able to see the same contents on 2nd volume.
> Why is it so? Is it a case that data didn’t get flushed immediately? If so,
how much time I should wait to see the changes?
>
> Thanks in advance!
>
Thanks Maxim and thank you all
Remounting FS solved my problem. Now, I’m able to see the contains of 1st Volume to 2nd one.
Maxim, as you mentioned, I know its a dirty trick. I’ll try to improve my algo to log write requests and write them to second volume in bunch.
Thanks again 
-Jhon
Maxim wrote:
If you are writing something to the mounted FS volume bypassing the FS -
then yes, the FS will see the updates only on next mount.
Anyway this is a dirty trick. The reason is that FS can do cache flushes or
other writes to the volume, and, in combination with your writes, this can
create broken FS structure on the volume.
So, remount the FS after each such write, or - even better - write “during
remount”, LOCK/DISMOUNT/write/UNLOCK/CloseHandle. This is what CHKDSK /F does.
Writing this way without remounts will require the cluster FS, and Windows
is shipped without them.