<p>I thought <code>-reindex</code> read blocks from disk to rebuild the index, without downloading the chain from the network. If that's so, why is bitcoind allocating memory in the files on disk? Like this:</p>

<p><code>Pre-allocating up to position 0x3000000 in blk00205.dat</code></p>

CC BY-SA 3.0
2017-04-22T21:27:42.510Z
It shouldn't. Can you provide some more of your debug.log?
Pieter Wuille
CC BY-SA 3.0
2017-04-22T22:03:25.057Z
Ok I must have done something else wrong. At the top of the log is the message `2017-04-22 18:37:28 LoadBlockIndexDB: last block file = 209
` even though the directory `~/.bitcoin/blocks/` contains files up to `blk00834.dat`. The first `pre-allocating` message in the log continues from `blk00209.dat`

I started with `-reindex` earlier today, stopped and then restarted a few times...
pinhead
<reindex>
Why does "pre-allocating..." still happen during -reindex?
pinhead
# Why does "pre-allocating..." still happen during -reindex?

(Asked by: username_0 on 2017-04-22)

I thought `-reindex` read blocks from disk to rebuild the index, without downloading the chain from the network. If that's so, why is bitcoind allocating memory in the files on disk? Like this:

`Pre-allocating up to position 0x3000000 in blk00205.dat`

**Tags:** reindex

> **Comments:**
> **username_1**: It shouldn't. Can you provide some more of your debug.log?  
> **username_0**: Ok I must have done something else wrong. At the top of the log is the message `2017-04-22 18:37:28 LoadBlockIndexDB: last block file = 209 ` even though the directory `~/.bitcoin/blocks/` contains files up to `blk00834.dat`. The first `pre-allocating` message in the log continues from `blk00209.dat`  I started with `-reindex` earlier today, stopped and then restarted a few times...  

---

## 0 answers

