Linux – thesql dump file corrupted

linuxMySQL

I've been using the following command to dump my databases:


$ mysqldump -uuser -ppass --all-databases | gzip > all-db.sql.gz

A full dump of the database is around 130 Gb, and takes about 10 hours to complete.
After finishing a recent dump, I found that the gzip'ed file is corrupted:


$ gunzip < all-db.sql.gz > /dev/null
gzip: stdin: invalid compressed data--crc error

AFAIK, the file has not been modified, nor has the mysqldump ... | gzip command been interrupted.

What's going on here? (Have you had similar issues?) I suspect disk corruption, but am unable to run fsck at the moment. Are there any issues (other than filesystem corruption) that might cause this file to become corrupted? Could gzip be to blame?

I realize this question is somewhat generic, but I cannot fathom a more specific problem to track down. Any hints are much appreciated.

Best Answer

File corruption comes in many flavors or situations....I think you are right concerning possible disk corruption....if this is true, you should IMMEDIATELY restart your system, and force a full fsck so as to hopefully repair the damage to make a backup. Leaving things the way they are may cause other more serious damage to your disk. I'd also be checking my system logs too!

Related Topic