Sign up ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
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 Micaroni Lalli Dec 21 '12 at 19:34

3 Answers 3

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.

share|improve this answer
A useful reminder, Felipe. Thanks. –  Colin Dean Dec 21 '12 at 19:51

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

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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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