Re:Someone dropped the source code for Far Cry 1 on archive.org
by scraft on Tuesday July 04, 2023 @12:12PM
(#36588615)
> if i am not writing or editing a file, just doing nothing, then why FS breaks?
For a few reasons, but the most common is that when you write a file, you 'fwrite' operation doesn't typically immediately write blocks to the disk, instead it gets written to caches that will be written to disk in due course. Changes to the disk, tables with crucial data, etc again are just updated in memory, and written to the disk at a 'sensible' time. It's possible that you aren't actively performing operations to modify the disk, but various previous changes are sitting in memory waiting to be synced. If you kill the power then these changes aren't flushed so you can end up with corruption/filesystem problems. The main reason things work this way is for performance.
I have a similar experience as well. I have a pi server and I was trying to use an ntfs external hdd. For some reason it breaks the file system if I remove hdd or shutdown pi unexpectedly. I am not expecting there to be no data loss if i am not writing or editing a file, just doing nothing, then why FS breaks?
When that happens, I connect hdd to Windows and it is able to repair it but there is no such option in ubuntu