Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 505  / 1 Year ago, fri, april 14, 2023, 11:22:08

So in this scenario:



I create tar.gz file. with very important files.



Before I power down computer, electricity goes out.



is it safe to files written in tar file will not get corrupted?



is it ok to check just tar file for integrity and not individual files?



How can I check tar.gz file integrity?


More From » tar

 Answers
6

Yes, this is definitely possible.



Because hard disks are exceptionally slow compared to the rest of your computer, there is virtually always a delay between when a piece of software is told a write to a file is finished and that file actually gets physically written to the hard disk. This keeps slow disks from making it difficult to keep using the computer. But until this write finishes, the data may only exist in your computer's RAM.



There are mechanisms applications can use to ensure data has been written out to disk, but there is a significant performance cost to using them, so a low-level application like tar will not use them and rely on a higher-level tool to ensure data integrity.



Since tar is not doing this for you, you can ensure that any pending writes have been flushed out to disk using the sync command. Once that command returns, you can be sure that any disk writes that happened before running sync have been successfully written to the hard disk.



Additionally, if you cleanly shut down your system, one of the last things that happens is that any pending writes are synced out. So in the case of power loss, data may not have been written out to the disk, but in the case of a clean shut down, everything should be.


[#42061] Saturday, April 15, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reangi

Total Points: 213
Total Questions: 102
Total Answers: 114

Location: Namibia
Member since Wed, Jan 19, 2022
2 Years ago
reangi questions
;