I've installed Bitcoin-Qt after a clean WUBI install, and installed Bitcoin-Qt directly. Now it suddenly says "Error loading blkindex.dat".

I assume my blkindex.dat file is corrupted, and I tried reinstalling Bitcoin-Qt with apt but it didn't work. Maybe if I delete the blkindex.dat file it will try to create it again, but I don't know where the installation folder is.

How can I solve this issue?

Extra information (added by other user); the error will likely look like this:

file blkindex.dat has LSN 727/2518588, past end of log at 727/1519938
Commonly caused by moving a database from one database environment
to another without clearing the database LSNs, or by removing all of
the log files from a database environment
__db_meta_setup: /home/user/.bitcoin/blkindex.dat: unexpected file type or format

You should be able to find this in ~/.bitcoin/db.log. This problem occured when interrupting the client suddenly or maybe because two of them opened the database at the same time.

  • I have this problem all the time. I just erase blk* but it will take 2 days long to download all blockchain again. I don't know why it is happening. I think it is a problem of the recent version. – Felipe Dec 21 '12 at 19:34

On Linux, the Bitcoin client data is kept in the .bitcoin directory in your home directory. Go to ~/.bitcoin/ and you'll see the files in there. You may need to toggle Show Hidden Files in your file manager in order to see the directory.

If you remove blkindex.dat, the client will have to redownload the blockchain. I just tested this locally by moving my copy of the file to another file name temporarily - the client resync'd.

Since your copy of the index is corrupted apparently, it sounds like you need to delete it and resync.

A note: be careful to do not erase your wallet.dat. I recommend you back it up before. Your wallet.dat is your private keys.


Just run ./bitcoind -reindex and this will fix your problem.


To avoid having to redownload everything from the p2p network, which may be slow as you have to validate the whole chain, you can download the bootstrap chain file from bitcoincharts.com

It is also available through bittorrent, which may be faster for you. Here's a copy of the message posted above and in the forums that authenticate the file (through GPG).

Hash: SHA1

Torrent info hash: 0bb0521942f586ed96203c6f4d136324756f8a9a
Torrent magnet link:

Filename: bootstrap.dat
Byte size: 2491771562
SHA1: e70ca90775dfdb13fd0014425805a0bdf4a31677
SHA256: a3f258e7af030165360596e4cb0b9beb24b4ce97352c22e65349b89ad5fc5d3e

Version: GnuPG v1.4.12 (GNU/Linux)


Also, here's a magnet link that includes trackers:


Finally, as explained in this answer, you can also simply discard the index and regenerate it using the existing ondisk blk000?.dat files, using -loadblock=blk0001.dat and by deleting blkindex.dat.

Edit: note that with bitcoind 0.8 and up, it's actually easier and faster to just download the block chain from the network directly, so don't bother with the bittorrent/manual download.

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.