On Windows with NTFS, is it safe to defragment files that are currently being written to and read from other processes?
I believe I may be hitting into an issue with an extremely fragmented large SQLite database. So I'm thinking of possible solutions once I confirm that that's the issue. I was thinking of periodically running Contig from Sysinternals, but the file is huge so it takes ages to complete.
However, assuming it's safe to do so, I could just run Contig in the background, while the database is being used.
Unless there is an error on the drive, it is unlikely that defragmenting will cause any problems while files are being read and written.
My personal preference is to close open apps & programs and let defrag run overnight.
If that will not work for you, you can try: https://docs.microsoft.com/en-us/windows/win32/fileio/defragmenting-files which is a more hands-on approach.