Does Locking and dismounting a filesystem flush out data

S

Shiju

Hi,
I asked a similar question before. But I still have some doubts on
"Protecting Multiple Volumes in a Hibernate Once/Resume Many
Configuration" mentioned in the site
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp.

I have a similar XPE system configuration with two partitions with HORM
setup, one ewf protected and the other not protected. I have an
application that always writes to the unprotected volume.At shutdown of
the system I have to lock and dismount the unprotected filesystem and
hibernate. Next time on booting to the system, I unlock the unprotected
filesystem and do write again to the unprotected partition. As before,
at the time of shutdown I have to lock and dismount the unprotected
filesystem and then do hibernation. If I don't follow this I will lose
the data written on to the unprotected volume. Is there anyway to
protect the data in unprotected partition without hibernating all the
time? I mean to flush the data to the unprotected fileystem by just
locking and dismounting or by any method other than hibernating each and
every time ?
Could someone help me on this.

Thanks & Regards,
Shiju
 
M

Mike Warren

S

Slobodan Brcin \(eMVP\)

Shiju,

What part of HORM do you not understand exactly?
Hibernate Once Resume Many.

After each resume you can do regular shutdown or restart and data integrity
will be ok as long as you have unmounted volumes before you hibernated. Only
this is important.

So just gracefully reboot and you will see that all your data are there and
ok.

Regards,
Slobodan
 
K

KM

To use HORM with unprotected volume it is not just a matter of flushing data to the unprotected partition but rather dismounting FS
on that volume. This is basically required so that there won't be any "system cache" for the FS on that volume in RAM.
Otherwise resumed RAM image from hiberfil.sys file may not (and won't) be in sync with the actual FS data on the volume. You may
damage the FS on the unprotected partition this way if you don't use the dismounting workaround.

KM
 
S

Shiju

Hi Slobodan,
The link I mentioned in the first mail is what makes me confusing.
As I have said I have a similar setup.But for me I have to hibernate
each and every time to protect the data written on to the unprotected
volume. Below is the procedure I follow.

1. After FBA, I enable ewf RAM Reg. and reboot
2. I have two volumes ;C and D. The unprotected volume is D:. I open
explorer and creates a directory and file.
3. Closes the explorer and in command prompt, I do lock and dismount the
D: volume
4. Do hibernation
5. Press the power button to boot the system. Unlock D:. Open explorer
to verify the directory and file created at step2 is present. I could
find it is present.
6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command prompt.
8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created at
step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files created
at step6 are present. I could find that the files and directories
created at step6 were not present.

But if I had done hibernation at step 8, then the data is preserved.So
I am doing hibernation every time to maintain data integrity. I use the
sample code in the site mentioned in my previous mail for doing locking,
dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?

Thanks,
Shiju
 
K

KM

Shiju,
Hi Slobodan,
The link I mentioned in the first mail is what makes me confusing.
As I have said I have a similar setup.But for me I have to hibernate each and every time to protect the data written on to the
unprotected volume. Below is the procedure I follow.

1. After FBA, I enable ewf RAM Reg. and reboot
2. I have two volumes ;C and D. The unprotected volume is D:. I open explorer and creates a directory and file.
3. Closes the explorer and in command prompt, I do lock and dismount the D: volume

Would you mind showing us how you do the disamount and unlock here?
4. Do hibernation

The same here, how do you do the hibernation?
5. Press the power button to boot the system. Unlock D:. Open explorer to verify the directory and file created at step2 is
present. I could find it is present.

The same here, unlock?

The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)
6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command prompt.

Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.
8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created at step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files created at step6 are present. I could find that the files and
directories created at step6 were not present.

But if I had done hibernation at step 8, then the data is preserved.So

This obviously would work since you just always update the hibernated RAM image.
But you lose HORM features.
I am doing hibernation every time to maintain data integrity. I use the sample code in the site mentioned in my previous mail for
doing locking, dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?

Most likely. But please provide us a little bit more info(see above).

KM
 
S

Shiju

Hi KM,
Please see my comments below below your comments for each step.

Thanks,
Shiju said:
Shiju,




Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp

I removed the hibernation and unlock section from this samsple code.
The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate
The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and
kept only the unlocking code in the program.
The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)




Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.
 
M

Mike Warren

Hi Konstantin,
To use HORM with unprotected volume it is not just a matter of
flushing data to the unprotected partition but rather dismounting FS
on that volume. This is basically required so that there won't be any
"system cache" for the FS on that volume in RAM. Otherwise resumed RAM image from hiberfil.sys
file may not (and
won't) be in sync with the actual FS data on the volume. You may
damage the FS on the unprotected partition this way if you don't use
the dismounting workaround.

I understand that. I guess I misunderstood what Shiju wanted

-Mike
 
K

KM

Shiju,

I don't understand how you could take out parts of the solid code from the article, call the parts differently and expect it to work
the same way?!

Please read about the Lock here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/fsctl_lock_volume.asp

Basically you Lock the volume from your code (just before the dismounting) for two purposes:
- to know whether any file is open on the volume (lock would fails if any file open)
- to have an exclusive access to a volume for a period of time while you do the dismount and hibernate until unlock.

Please keep in mind that as soon as you application exists (even if you didn't do the Unlock explicelty) the handle to the device
(the unprotected volume) would be closed and no exclusive access to it would be maintatined (basically, auto unlock). This is why it
is important to maintain the the procedure in one applicaiton code as follows:
- Lock
- Dismount
- Hibernate

Does this make a sense?

KM

PS. Unfortunately, the important links to FSCTL codes on MSDN are broken in that article you mentioned and this probably makes it
"buggy" from the presenting the idea point of view.
Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
I removed the hibernation and unlock section from this samsple code.
The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate
The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and kept only the unlocking code in the program.
The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)




Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.
This obviously would work since you just always update the hibernated RAM image.
But you lose HORM features.
RF


Most likely. But please provide us a little bit more info(see above).

KM
 
S

Shiju

Thanks KM. I was struggling with this issue for quite some time. Now it
works fine. Only once I need to do lock->dismount->hibernate->unlock.
From next shutdown the data is protected even if I did no lock and
dismount the unprotected volume. Is this okay or is it safe to do lock
and dismount each time just before shutdown?

Thanks,
SHiju said:
Shiju,

I don't understand how you could take out parts of the solid code from the article, call the parts differently and expect it to work
the same way?!

Please read about the Lock here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/fsctl_lock_volume.asp

Basically you Lock the volume from your code (just before the dismounting) for two purposes:
- to know whether any file is open on the volume (lock would fails if any file open)
- to have an exclusive access to a volume for a period of time while you do the dismount and hibernate until unlock.

Please keep in mind that as soon as you application exists (even if you didn't do the Unlock explicelty) the handle to the device
(the unprotected volume) would be closed and no exclusive access to it would be maintatined (basically, auto unlock). This is why it
is important to maintain the the procedure in one applicaiton code as follows:
- Lock
- Dismount
- Hibernate

Does this make a sense?

KM

PS. Unfortunately, the important links to FSCTL codes on MSDN are broken in that article you mentioned and this probably makes it
"buggy" from the presenting the idea point of view.

3. Closes the explorer and in command prompt, I do lock and dismount the D: volume

Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
I removed the hibernation and unlock section from this samsple code.

4. Do hibernation


The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate
5. Press the power button to boot the system. Unlock D:. Open explorer to verify the directory and file created at step2 is
present. I could find it is present.


The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and kept only the unlocking code in the program.

The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)



6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command prompt.


Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.
8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created at step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files created at step6 are present. I could find that the files and
directories created at step6 were not present.

But if I had done hibernation at step 8, then the data is preserved.So


This obviously would work since you just always update the hibernated RAM image.
But you lose HORM features.
RF

I am doing hibernation every time to maintain data integrity. I use the sample code in the site mentioned in my previous mail for
doing locking, dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?


Most likely. But please provide us a little bit more info(see above).

KM



Thanks,
Shiju

Slobodan Brcin (eMVP) wrote:


Shiju,

What part of HORM do you not understand exactly?
Hibernate Once Resume Many.

After each resume you can do regular shutdown or restart and data integrity will be ok as long as you have unmounted volumes
before you hibernated. Only this is important.

So just gracefully reboot and you will see that all your data are there and ok.

Regards,
Slobodan




Hi,
I asked a similar question before. But I still have some doubts on "Protecting Multiple Volumes in a Hibernate Once/Resume Many
Configuration" mentioned in the site
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp.
I have a similar XPE system configuration with two partitions with HORM setup, one ewf protected and the other not protected. I
have an application that always writes to the unprotected volume.At shutdown of the system I have to lock and dismount the
unprotected filesystem and hibernate. Next time on booting to the system, I unlock the unprotected filesystem and do write
again to the unprotected partition. As before, at the time of shutdown I have to lock and dismount the unprotected filesystem
and then do hibernation. If I don't follow this I will lose the data written on to the unprotected volume. Is there anyway to
protect the data in unprotected partition without hibernating all the time? I mean to flush the data to the unprotected
fileystem by just locking and dismounting or by any method other than hibernating each and every time ?
Could someone help me on this.

Thanks & Regards,
Shiju
 
S

Shiju

Thanks KM. I was struggling with this issue for quite some time. Now it
works fine. Only once I need to do lock->dismount->hibernate->unlock.
From next shutdown the data is protected even if I did not lock and
dismount the unprotected volume. Is this okay or is it safe to do lock
and dismount each time just before shutdown?

Thanks,
SHiju said:
Shiju,

I don't understand how you could take out parts of the solid code from the article, call the parts differently and expect it to work
the same way?!

Please read about the Lock here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/fsctl_lock_volume.asp

Basically you Lock the volume from your code (just before the dismounting) for two purposes:
- to know whether any file is open on the volume (lock would fails if any file open)
- to have an exclusive access to a volume for a period of time while you do the dismount and hibernate until unlock.

Please keep in mind that as soon as you application exists (even if you didn't do the Unlock explicelty) the handle to the device
(the unprotected volume) would be closed and no exclusive access to it would be maintatined (basically, auto unlock). This is why it
is important to maintain the the procedure in one applicaiton code as follows:
- Lock
- Dismount
- Hibernate

Does this make a sense?

KM

PS. Unfortunately, the important links to FSCTL codes on MSDN are broken in that article you mentioned and this probably makes it
"buggy" from the presenting the idea point of view.

3. Closes the explorer and in command prompt, I do lock and dismount the D: volume

Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
I removed the hibernation and unlock section from this samsple code.

4. Do hibernation


The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate
5. Press the power button to boot the system. Unlock D:. Open explorer to verify the directory and file created at step2 is
present. I could find it is present.


The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and kept only the unlocking code in the program.

The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)



6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command prompt.


Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.
8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created at step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files created at step6 are present. I could find that the files and
directories created at step6 were not present.

But if I had done hibernation at step 8, then the data is preserved.So


This obviously would work since you just always update the hibernated RAM image.
But you lose HORM features.
RF

I am doing hibernation every time to maintain data integrity. I use the sample code in the site mentioned in my previous mail for
doing locking, dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?


Most likely. But please provide us a little bit more info(see above).

KM



Thanks,
Shiju

Slobodan Brcin (eMVP) wrote:


Shiju,

What part of HORM do you not understand exactly?
Hibernate Once Resume Many.

After each resume you can do regular shutdown or restart and data integrity will be ok as long as you have unmounted volumes
before you hibernated. Only this is important.

So just gracefully reboot and you will see that all your data are there and ok.

Regards,
Slobodan




Hi,
I asked a similar question before. But I still have some doubts on "Protecting Multiple Volumes in a Hibernate Once/Resume Many
Configuration" mentioned in the site
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp.
I have a similar XPE system configuration with two partitions with HORM setup, one ewf protected and the other not protected. I
have an application that always writes to the unprotected volume.At shutdown of the system I have to lock and dismount the
unprotected filesystem and hibernate. Next time on booting to the system, I unlock the unprotected filesystem and do write
again to the unprotected partition. As before, at the time of shutdown I have to lock and dismount the unprotected filesystem
and then do hibernation. If I don't follow this I will lose the data written on to the unprotected volume. Is there anyway to
protect the data in unprotected partition without hibernating all the time? I mean to flush the data to the unprotected
fileystem by just locking and dismounting or by any method other than hibernating each and every time ?
Could someone help me on this.

Thanks & Regards,
Shiju
 
K

KM

Shiju,
Thanks KM. I was struggling with this issue for quite some time. Now it works fine. Only once I need to do
lock->dismount->hibernate->unlock. From next shutdown the data is protected even if I did not lock and dismount the unprotected
volume. Is this okay or is it safe to do lock and dismount each time just before shutdown?

It is certainly safe but there is just no reason in doing so before the graceful shutdown.

KM
Thanks,
SHiju said:
Shiju,

I don't understand how you could take out parts of the solid code from the article, call the parts differently and expect it to
work the same way?!

Please read about the Lock here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/fsctl_lock_volume.asp

Basically you Lock the volume from your code (just before the dismounting) for two purposes:
- to know whether any file is open on the volume (lock would fails if any file open)
- to have an exclusive access to a volume for a period of time while you do the dismount and hibernate until unlock.

Please keep in mind that as soon as you application exists (even if you didn't do the Unlock explicelty) the handle to the device
(the unprotected volume) would be closed and no exclusive access to it would be maintatined (basically, auto unlock). This is why
it is important to maintain the the procedure in one applicaiton code as follows:
- Lock
- Dismount
- Hibernate

Does this make a sense?

KM

PS. Unfortunately, the important links to FSCTL codes on MSDN are broken in that article you mentioned and this probably makes it
"buggy" from the presenting the idea point of view.

3. Closes the explorer and in command prompt, I do lock and dismount the D: volume

Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
I removed the hibernation and unlock section from this samsple code.



4. Do hibernation


The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate


5. Press the power button to boot the system. Unlock D:. Open explorer to verify the directory and file created at step2 is
present. I could find it is present.


The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and kept only the unlocking code in the program.


The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)



6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command prompt.


Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.


8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created at step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files created at step6 are present. I could find that the files and
directories created at step6 were not present.

But if I had done hibernation at step 8, then the data is preserved.So


This obviously would work since you just always update the hibernated RAM image.
But you lose HORM features.
RF

I am doing hibernation every time to maintain data integrity. I use the sample code in the site mentioned in my previous mail
for doing locking, dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?


Most likely. But please provide us a little bit more info(see above).

KM



Thanks,
Shiju

Slobodan Brcin (eMVP) wrote:


Shiju,

What part of HORM do you not understand exactly?
Hibernate Once Resume Many.

After each resume you can do regular shutdown or restart and data integrity will be ok as long as you have unmounted volumes
before you hibernated. Only this is important.

So just gracefully reboot and you will see that all your data are there and ok.

Regards,
Slobodan




Hi,
I asked a similar question before. But I still have some doubts on "Protecting Multiple Volumes in a Hibernate Once/Resume
Many Configuration" mentioned in the site
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp.
I have a similar XPE system configuration with two partitions with HORM setup, one ewf protected and the other not protected.
I have an application that always writes to the unprotected volume.At shutdown of the system I have to lock and dismount the
unprotected filesystem and hibernate. Next time on booting to the system, I unlock the unprotected filesystem and do write
again to the unprotected partition. As before, at the time of shutdown I have to lock and dismount the unprotected filesystem
and then do hibernation. If I don't follow this I will lose the data written on to the unprotected volume. Is there anyway to
protect the data in unprotected partition without hibernating all the time? I mean to flush the data to the unprotected
fileystem by just locking and dismounting or by any method other than hibernating each and every time ?
Could someone help me on this.

Thanks & Regards,
Shiju
 
S

Shiju

Hi KM,
Thanks for all you replies and now I have a clear picture of protecting
volumes under HORM.

Thanks,
Shiju
Shiju,

Thanks KM. I was struggling with this issue for quite some time. Now it works fine. Only once I need to do
lock->dismount->hibernate->unlock. From next shutdown the data is protected even if I did not lock and dismount the unprotected
volume. Is this okay or is it safe to do lock and dismount each time just before shutdown?


It is certainly safe but there is just no reason in doing so before the graceful shutdown.

KM

Thanks,
SHiju said:
Shiju,

I don't understand how you could take out parts of the solid code from the article, call the parts differently and expect it to
work the same way?!

Please read about the Lock here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/fsctl_lock_volume.asp

Basically you Lock the volume from your code (just before the dismounting) for two purposes:
- to know whether any file is open on the volume (lock would fails if any file open)
- to have an exclusive access to a volume for a period of time while you do the dismount and hibernate until unlock.

Please keep in mind that as soon as you application exists (even if you didn't do the Unlock explicelty) the handle to the device
(the unprotected volume) would be closed and no exclusive access to it would be maintatined (basically, auto unlock). This is why
it is important to maintain the the procedure in one applicaiton code as follows:
- Lock
- Dismount
- Hibernate

Does this make a sense?

KM

PS. Unfortunately, the important links to FSCTL codes on MSDN are broken in that article you mentioned and this probably makes it
"buggy" from the presenting the idea point of view.



3. Closes the explorer and in command prompt, I do lock and dismount the D: volume

Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
I removed the hibernation and unlock section from this samsple code.



4. Do hibernation


The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate


5. Press the power button to boot the system. Unlock D:. Open explorer to verify the directory and file created at step2 is
present. I could find it is present.


The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and kept only the unlocking code in the program.



The reason we need that info is that it would be important on how you do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)




6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command prompt.


Since the next step is Shutdown, you don't need to explicetly lock and dismount volume here.
But this step of yours leads me to believe you don't do the Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.


8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created at step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files created at step6 are present. I could find that the files and
directories created at step6 were not present.

But if I had done hibernation at step 8, then the data is preserved.So


This obviously would work since you just always update the hibernated RAM image.
But you lose HORM features.
RF


I am doing hibernation every time to maintain data integrity. I use the sample code in the site mentioned in my previous mail
for doing locking, dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?


Most likely. But please provide us a little bit more info(see above).

KM




Thanks,
Shiju

Slobodan Brcin (eMVP) wrote:



Shiju,

What part of HORM do you not understand exactly?
Hibernate Once Resume Many.

After each resume you can do regular shutdown or restart and data integrity will be ok as long as you have unmounted volumes
before you hibernated. Only this is important.

So just gracefully reboot and you will see that all your data are there and ok.

Regards,
Slobodan





Hi,
I asked a similar question before. But I still have some doubts on "Protecting Multiple Volumes in a Hibernate Once/Resume
Many Configuration" mentioned in the site
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp.
I have a similar XPE system configuration with two partitions with HORM setup, one ewf protected and the other not protected.
I have an application that always writes to the unprotected volume.At shutdown of the system I have to lock and dismount the
unprotected filesystem and hibernate. Next time on booting to the system, I unlock the unprotected filesystem and do write
again to the unprotected partition. As before, at the time of shutdown I have to lock and dismount the unprotected filesystem
and then do hibernation. If I don't follow this I will lose the data written on to the unprotected volume. Is there anyway to
protect the data in unprotected partition without hibernating all the time? I mean to flush the data to the unprotected
fileystem by just locking and dismounting or by any method other than hibernating each and every time ?
Could someone help me on this.

Thanks & Regards,
Shiju
 
S

Slobodan Brcin \(eMVP\)

Shiju,

If you only followed our sugestions before or good MS link that you gave us
you would not have problems :-( (Konstantin link is working).

What can I say it was your time wasted, I'm sorry that we did not asked you
before about exact procedures that you used.

Regards,
Slobodan




Shiju said:
Hi KM,
Thanks for all you replies and now I have a clear picture of protecting
volumes under HORM.

Thanks,
Shiju
Shiju,

Thanks KM. I was struggling with this issue for quite some time. Now it
works fine. Only once I need to do lock->dismount->hibernate->unlock.
From next shutdown the data is protected even if I did not lock and
dismount the unprotected volume. Is this okay or is it safe to do lock
and dismount each time just before shutdown?


It is certainly safe but there is just no reason in doing so before the
graceful shutdown.

KM

Thanks,
SHiju
KM wrote:

Shiju,

I don't understand how you could take out parts of the solid code from
the article, call the parts differently and expect it to work the same
way?!

Please read about the Lock here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/fsctl_lock_volume.asp

Basically you Lock the volume from your code (just before the
dismounting) for two purposes:
- to know whether any file is open on the volume (lock would fails
if any file open)
- to have an exclusive access to a volume for a period of time while
you do the dismount and hibernate until unlock.

Please keep in mind that as soon as you application exists (even if you
didn't do the Unlock explicelty) the handle to the device (the
unprotected volume) would be closed and no exclusive access to it would
be maintatined (basically, auto unlock). This is why it is important to
maintain the the procedure in one applicaiton code as follows:
- Lock
- Dismount
- Hibernate

Does this make a sense?

KM

PS. Unfortunately, the important links to FSCTL codes on MSDN are broken
in that article you mentioned and this probably makes it "buggy" from
the presenting the idea point of view.



3. Closes the explorer and in command prompt, I do lock and dismount
the D: volume

Would you mind showing us how you do the disamount and unlock here?

[Shiju] I use the sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
I removed the hibernation and unlock section from this samsple code.



4. Do hibernation


The same here, how do you do the hibernation?

[Shiju] From Start->Turn off computer->Hibernate


5. Press the power button to boot the system. Unlock D:. Open
explorer to verify the directory and file created at step2 is
present. I could find it is present.


The same here, unlock?

[Shiju] The same sample code from
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp
Here I removed the locking, dismount and hibernation from the code and
kept only the unlocking code in the program.



The reason we need that info is that it would be important on how you
do that.
It should be implemented within your application code:
- Lock
- Dismount
- Hibernate
- Unlock (optional but good to have in your app code anyway)




6. I created two more directories and files in d:
7. Close the explorer. Lock and dismount the d: volume from command
prompt.


Since the next step is Shutdown, you don't need to explicetly lock and
dismount volume here.
But this step of yours leads me to believe you don't do the
Lock/Dismount from your app code that does the hibernation.

[Shiju] Same as in step 3.


8. Gracefully shutdown.
9. Boot to system. The system picks up the hibernation file created
at step4 to boot.
10. Unlock d:. Open explorer to verify the directories and files
created at step6 are present. I could find that the files and
directories created at step6 were not present.

But if I had done hibernation at step 8, then the data is
preserved.So


This obviously would work since you just always update the hibernated
RAM image.
But you lose HORM features.
RF


I am doing hibernation every time to maintain data integrity. I use
the sample code in the site mentioned in my previous mail for doing
locking, dismount and unlocking of filesystem.
Is there anything wrong in the above procedure?


Most likely. But please provide us a little bit more info(see above).

KM




Thanks,
Shiju

Slobodan Brcin (eMVP) wrote:



Shiju,

What part of HORM do you not understand exactly?
Hibernate Once Resume Many.

After each resume you can do regular shutdown or restart and data
integrity will be ok as long as you have unmounted volumes before
you hibernated. Only this is important.

So just gracefully reboot and you will see that all your data are
there and ok.

Regards,
Slobodan





Hi,
I asked a similar question before. But I still have some doubts on
"Protecting Multiple Volumes in a Hibernate Once/Resume Many
Configuration" mentioned in the site
http://msdn.microsoft.com/library/d...mesInHibernateOnceResumeManyConfiguration.asp.
I have a similar XPE system configuration with two partitions with
HORM setup, one ewf protected and the other not protected. I have
an application that always writes to the unprotected volume.At
shutdown of the system I have to lock and dismount the unprotected
filesystem and hibernate. Next time on booting to the system, I
unlock the unprotected filesystem and do write again to the
unprotected partition. As before, at the time of shutdown I have to
lock and dismount the unprotected filesystem and then do
hibernation. If I don't follow this I will lose the data written on
to the unprotected volume. Is there anyway to protect the data in
unprotected partition without hibernating all the time? I mean to
flush the data to the unprotected fileystem by just locking and
dismounting or by any method other than hibernating each and every
time ?
Could someone help me on this.

Thanks & Regards,
Shiju
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top