Avoid writing temporary pack files to disk?

From the documentation:

Note that larger pack files increase the chance that the temporary pack files are written to disk. An operating system usually caches file write operations in memory and writes them to disk after a short delay. As larger pack files take longer to upload, this increases the chance of these files being written to disk. This can increase disk wear for SSDs.

I back up drives from Windows 10 to a local REST Server. I use the option --pack-size 64 but it’s the same with the default. The pack files are written to disk. I have plenty of free RAM available. I confirmed that they are written to disk by checking the total host writes on the SSD. Is this normal? Can I avoid this? I feel like it’s a waste.

You could try to use a memory-based filesystem for your temporary files. I don’t know how to setup this on windows, however…

I also would like to mention that A restic client written in rust doesn’t write temporary packfiles, but keeps all data in memory until writing directly to the backend.

1 Like

I like the features that rustic adds but I can’t backup my Windows drive with it because VSS in not yet implemented.

From what I read, restic already fixed this, but for some reason Windows still writes the files to disk.

Improve handling of temporary files on windows #3610

In addition, the flag FILE_ATTRIBUTE_TEMPORARY is added to avoid unnecessary writes of the temporary files to disk.

@nifi Please open an issue on Github. I really wonder why Windows seems to ignore the documented behavior of the FILE_ATTRIBUTE_TEMPORARY flag.

1 Like