[Tutor] Corrupt file(s) likelihood and prevention?

David L Neil PyTutor at DancesWithMice.info
Sat Feb 1 22:10:32 EST 2020


On 2/02/20 12:05 PM, Alan Gauld via Tutor wrote:
> On 01/02/2020 22:16, boB Stepp wrote:
> 
>> some sort of defensive programming.  Should every file in a program,
>> both data files and source code files have an associated checksum?
...

> Databases should also have a backup strategy but RDBMS systems
> have built in redundancy and recovery mechanisms plus they usually
> run on servers with RAID storage so even a corrupt disk won't lose anything.
...

> Yes. Absolutely. Backups are not an optional activity if you
> care about your data. And ideally stored off site and to at
> least 3 generations.

...stored in multiple locations (define "multiple" according to your 
level of risk/paranoia/caution/$depth-of-pockets.

All these things are two-edged swords, eg this morning it took me longer 
to perform a precautionary (SSD to HDD) backup of my system settings and 
/home partition, than it did to perform the actual system-upgrade! (one 
of the beauties of Linux, and one of the pains of behaving conservatively)


Back in the ?good, old days, when amending a DB, we would (first) output 
the command+data to a separate file (likely on a separate drive) and 
only after that, perform the DB-operation. The file became known as a 
"journal". When things (were realised to have) went awry, we would 
restore an assured backup of the DB, and then re-run the journal.

These days, RDBMS-es keep their own journals. Thank you! I haven't built 
a system with manual/application journaling for at least one, and 
possibly two, decades! (even with MySQL)


Similarly, the ext4 FS - a popular/common file system under Linux, is a 
journaling FS. If something goes wrong, one is invited/instructed to run 
fsck ("file system consistency check" - not what one of my circle called 
it after substituting letters!). Such checks are performed periodically, 
and/or after a set number of reboots.

In such an environment, the need to maintain separate/embedded 
check-sums would appear to have also passed. However, greater minds 
might have something else to say... and, as always, YMMV!

NB I can't comment about MS-Windows' ability to maintain file 
consistency, nor (necessarily) other FS on other systems...
-- 
Regards =dn


More information about the Tutor mailing list