Defer-Write infinite and no flush cache corrupts files problem.

FAQ, getting help, user experience about PrimoCache
krzyys1
Level 1
Level 1
Posts: 2
Joined: Tue May 07, 2024 8:36 pm

Defer-Write infinite and no flush cache corrupts files problem.

Post by krzyys1 »

Hello,
I tried using primocache with "Defer-Write - infinite" and "no flush cache on shutdown" options enabled
I set the cache this way, make a temporary pause and restart the system.
After starting the system and programs, nothing was saved on the disk, according to the information from Primocache.
I restart the system and thanks to the "no flush cache on shutdown" option, it should remain unchanged.
Unfortunately, after testing, it turns out that the Vivaldi browser and Total Uninstall profiles are damaged, which means that the files were saved with errors.
Why does this happen and is it possible to fix it?
Sorry for the errors with google translate.
Thanks
User avatar
Support
Support Team
Support Team
Posts: 3635
Joined: Sun Dec 21, 2008 2:42 am

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by Support »

If your cache space is not large enough to store all incoming write-data, "urgent write" will occur, forcing a certain amount of write-data to be written to disk. And you have also enabled "skip flush on shutdown", which will cause the other part of the write-data not to be written, thus corrupting the file system.

PrimoCache is not designed to protect data from being written. And the "Skip Flush on Shutdown" option is only for special scenarios like diskless systems.
krzyys1
Level 1
Level 1
Posts: 2
Joined: Tue May 07, 2024 8:36 pm

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by krzyys1 »

The cache was many times larger than the stored data, so there was no "urgent write". So why were the files corrupted? Theoretically, this shouldn't happen. I didn't notice any other damage and the system continued to work fine.
I remember that when I did this on Windows XP, I didn't have this problem.

I would like to use "Defer-Write - infinite" together with "Skip Flush on Shutdown" to shut down the system when necessary without saving any changes made to it. However, if I want to save the changes, I need to pause the cache and flush. I would really like such a mechanism.
But why do files get corrupted when they theoretically shouldn't?
Maybe there is something that could fix this problem?
User avatar
Support
Support Team
Support Team
Posts: 3635
Joined: Sun Dec 21, 2008 2:42 am

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by Support »

Could you please upload your cache configuration and stats for our reference by following the guidance in the link below?
https://kb.romexsoftware.com/en-us/2-pr ... leshooting

And what is your Windows OS version?
krzyys
Level 1
Level 1
Posts: 2
Joined: Sun May 05, 2013 2:46 pm

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by krzyys »

Windows 11 Pro 23H2
Attachments
PrimoCache No flush.png
PrimoCache No flush.png (72.69 KiB) Viewed 509 times
0liVer
Level 3
Level 3
Posts: 12
Joined: Sat Apr 29, 2017 5:13 pm

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by 0liVer »

@krzyys
On file level Windows is thinking the file was written but in real it was not. What is Windows internal doing with such information? I dont know :-(
User avatar
Support
Support Team
Support Team
Posts: 3635
Joined: Sun Dec 21, 2008 2:42 am

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by Support »

The cache configuration seems no problem. Are the Vivaldi browser and Total Uninstall profiles stored in the C drive? No other files related to Vivaldi browser and Total Uninstall are stored in other drives?
krzyys
Level 1
Level 1
Posts: 2
Joined: Sun May 05, 2013 2:46 pm

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by krzyys »

No, everything is on the C drive.
Additionally, Windows sometimes reports problems with starting after restarting, but after restarting it starts and everything seems to be fine, except for these two programs. However, it is not known whether other files were also damaged.
Therefore, it is difficult to trust and use such a configuration, and I would really like it.
Could I ask you to test this? Maybe you could find a solution to this problem, because I don't think it's just me.
User avatar
Support
Support Team
Support Team
Posts: 3635
Joined: Sun Dec 21, 2008 2:42 am

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by Support »

I have reported this issue to our R&D and we will arrange for further analysis and troubleshooting. However, due to the heavy workload recently, it may take some time. Sorry.
SnowReborn
Level 4
Level 4
Posts: 35
Joined: Sun Dec 02, 2012 3:13 am

Re: Defer-Write infinite and no flush cache corrupts files problem.

Post by SnowReborn »

I ran primocache for years, currently 4.3.0. I have enabled Defer write infinite on my OS (C:) drives for years without any issue; with the exception of BSOD or system crash. The only difference is I do not have "no flush on shutdown". I am not sure if primocache also caches and updates MFT(it suppose to). If MFT was modified and primocache did not "discard" the MFT, there will be a desync between actual file content with MFT hence the corruption. And depends on the level priority of primocache during the kernel load, some drivers / windows registers and so on might load earlier than primocache ; or during a restart, depending on if windows gets fully shutdown first or primocache, these kind scenario could also introduces inconsistency. While it is a wild and interesting way to "attempt" to use primocache this way, I don't think it's intended. On top of that, you will eventually ran into "urgent write" like support described if your cache ran out; which defeats your purpose. If you have very large RAM like 256GB to cache your OS partition to "avoid" urgent write, then mind as well just put your OS on a ramdisk. If you are looking for "freezing" your OS partition without ANY changes, there are other alternative software out there that might fit your need better. If i recall correctly i used to use a software called "deep freeze" which discard any changes to the drive you selected; BUT that was not fool proof, I have experienced once a virus was able to penetrate through that software. Another possibility if you are techie enough is to setup an ISCSI share via network and iPXE boot it, again mentioned by support with diskless setup, then having that ISCSI volume either set with disk deduplication or scripted snapshot reversal. This is really quick if you are in ZFS. Or just go with esxi and snapshot.There's alot of ways to go about this but I don't personally recommend doing it that. So yeah. think twice before you do this.
Post Reply