What can be the reasons for a partition to become damaged if an external disk is unplugged while simply reading data?
Could it be damage to the suddenly turned off media, or are there other things in the background that operating systems use to write anyway even if we are just reading data, not writing files?
What is the role of journaling in these cases? Are read operations logged by journaling or not normally?
Partition damage by unplugging while reading
Partition damage by unplugging while reading
YouTube:
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
http://youtube.com/@AltComp126
My x86 OS/software:
https://sourceforge.net/projects/api-simple-completa/
Donate to get more food/programming resources/computers:
https://www.paypal.com/donate/?hosted_b ... QS2YTW3V64
Re: Partition damage by unplugging while reading
Damaged in what way? What do you base your assertion that it's damaged on?
You said partition, you mean FS? If so, what FS?
I would expect reading to not create journaling, but how are you sure there was no other background write-op happening?
You said partition, you mean FS? If so, what FS?
I would expect reading to not create journaling, but how are you sure there was no other background write-op happening?
Re: Partition damage by unplugging while reading
The OS may want to update access times.
Re: Partition damage by unplugging while reading
With exception to files opened in unbuffered mode or requests followed by flush, writes are lazy. The contents are only marked dirty in the fs cache and repeated or incremental updates to the same block are combined there.
Reads for files opened in unbuffered mode flush and discard the corresponding cache pages and thus cause writes. Furthermore, writes can result from memory pressure, which can be the result of anything, including reads. For example, the cache pages for the read data can be acquired by evicting the contents of a dirty page, which causes a write.
The journal will guarantee consistent fs structure after a crash even if it is written out lazily, because its operation depends only on correct sequencing. However, the user data will be lost/corrupted unless the filesystem is explicitly configured to journal it as well.
The sysctl parameters vm.dirty_writeback_centisecs, vm.dirty_expire_centisecs can be used to control the flush frequency on Linux. Windows can disable the file cache on a per device basis and configure certain quotas, but lacks fine grained timing control.
Reads for files opened in unbuffered mode flush and discard the corresponding cache pages and thus cause writes. Furthermore, writes can result from memory pressure, which can be the result of anything, including reads. For example, the cache pages for the read data can be acquired by evicting the contents of a dirty page, which causes a write.
The journal will guarantee consistent fs structure after a crash even if it is written out lazily, because its operation depends only on correct sequencing. However, the user data will be lost/corrupted unless the filesystem is explicitly configured to journal it as well.
The sysctl parameters vm.dirty_writeback_centisecs, vm.dirty_expire_centisecs can be used to control the flush frequency on Linux. Windows can disable the file cache on a per device basis and configure certain quotas, but lacks fine grained timing control.
Re: Partition damage by unplugging while reading
most operating systems are caching the disk writes.
also disk write occur if you read the files (to maintain access time for example).
thats why i decided my os not to do such things, so its safe to take out the disks whenever the user wants to.
also disk write occur if you read the files (to maintain access time for example).
thats why i decided my os not to do such things, so its safe to take out the disks whenever the user wants to.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html