Every time I try to run monerod, I get the following error:

Failed to open db handle for m_blocks : MDB_CORRUPTED : Located page was wrong type

Command prompt window snippet

It briefly displays, and then shuts down the command prompt window.

What can I do to fix this?

Note: re-post of a question asked on reddit.

  • 1
    Probably not much can be done to fix that besides deleting the LMDB directory and resyncing from scratch. But before you do that I'd like to get a copy of your data.mdb file for dissection. – hyc Nov 24 '16 at 20:29

It is likely that this means blockchain database (LMDB) corruption.

The easiest way to fix it is to rename your corrupt lmdb folder to something else, for example:

Rename C:\ProgramData\bitmonero\lmdb to C:\ProgramData\bitmonero\lmdb-old and run monerod again.

It should start without errors and it will again create a fresh copy of C:\ProgramData\bitmonero\lmdb and sync from scratch. It will take some time to catch up with the network again, though.

Also, if you don't mind, please make a .zip archive of the C:\ProgramData\bitmonero\lmdb-old and upload somewhere for Monero dev. hyc, who is the creator of LMDB database, to examine (don't worry, your wallet data is not stored there, it's safe to share). This will help to understand why it had been corrupted and possibly prevent such occurances in the future.

At the end, when all is working, you can safely delete the C:\ProgramData\bitmonero\lmdb-old

Note: the example above is for Windows systems and default settings. On other systems, you'd need to locate your \lmdb folder and do practically the same, just at different folder location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.