Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

database files corrupted when laptop locked up #903

Closed
dooglus opened this Issue · 4 comments

4 participants

Chris Moore Gavin Andresen Pieter Wuille Wladimir J. van der Laan
Chris Moore

I just had my laptop freeze and had to hard reboot.

When it came back both the blockchain and addr databases were corrupted and failed to load.

I had to restore an old backup to get bitcoin to run again.

Is it possible to somehow keep the database files consistent even in the event of a power failure or OS lockup?

Gavin Andresen

We're only as good as BDB; see here: http://pybsddb.sourceforge.net/ref/transapp/reclimit.html

In particular:

"it is important to select hardware that does not do partial writes and does not cache data writes (or does not return that the data has been written to stable storage until it has either been written to stable storage or the actual writing of all of the data is guaranteed, barring catastrophic hardware failure -- that is, your disk drive exploding). You should also be aware that Berkeley DB does not protect against all cases of stable storage hardware failure, nor does it protect against hardware misbehavior."

Pieter Wuille
Owner

I think the real problem is that in the end, bdb doesn't seem appropriate for end-user desktop systems...

Chris Moore

Perhaps something like 'backupwallet ' but for all data files would be useful. I could write a crontab to copy the .bitcoin folder in the early hours of each morning, but there's no guarantee that the files I copy are in a consistent state.

'backupdata " could copy all 4 .dat files to the specified backup directory, for instance.

Also, when a database file does become corrupted, the output in the terminal is very unhelpful. It doesn't indicate which of the files is corrupted (although scanning back up through the log can show which file was being read at the time) and offers the user no advice on how to proceed.

Wladimir J. van der Laan
Owner

Closing this; automatic recovery is somewhat better now.

Wladimir J. van der Laan laanwj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.