I'd like to share my recent experience with moving block's storage of my non-pruned Bitcoin Core node due to storage space constraints that have built up and called for action.
I found 85 search hits for "blocksdir" in post's text but none felt really suitable to append my post to, therefore I decided to post a new thread.On my private daily internet driver (an older Thinkpad laptop) with Ubuntu as OS I've an internal 1TB SATA SSD as main storage. This device runs basically 24/7 (with closed screen hooked to my external monitor) and I've a full Bitcoin Core node monitoring a few watch-only wallets of interest for me and all sorts of indices enabled. I browse the forum with this device mostly and need the Bitcoin Core node when I do some blockchain queries or digging occasionally.
Free storage space dropped below 20GiB and it didn't feel comfortable to me anymore to procrastinate any longer. I had another spare 1TB SATA SSD and a caddy for it to insert into the optical drive bay (yes, the Thinkpad is that old to have something like this and is the only option to add a second internal SATA storage with 2.5inch form factor). This second SATA SSD was then recognized as /dev/sdb and the formatted sole partition /dev/sdb1 mounted permanently at /mnt/ssdplus.
My plan was to use the
blocksdir option in my
bitcoin.conf file after moving the main space hog
blocks folder to the new partition. Shutdown the node clean. Rsynced
.bitcoin/blocks to
/mnt/ssdplus/blocks, verified the destination is the same as the source bit-by-bit, deleted
.bitcoin/blocks and added below line to my
bitcoin.conf:
# Specify a non-default location to store blockchain data.
blocksdir=/mnt/ssdplus
Fired up Bitcoin Core in GUI mode and, you guessed it, it didn't work out too well (because I didn't really read any documentation about the
blocksdir option, I naively thought I could move the whole
blocks folder to another partition, silly me). Bitcoin Core didn't recognize any block data apparently and I aborted to reinitialize the blockchain.
...
2025-07-24T13:37:43Z Using obfuscation key for blocksdir *.dat files (/mnt/ssdplus/blocks): '0000000000000000'
2025-07-24T13:37:43Z Opening LevelDB in /home/dude/.bitcoin/blocks/index
2025-07-24T13:37:43Z Opened LevelDB successfully
2025-07-24T13:37:43Z Using obfuscation key for /home/dude/.bitcoin/blocks/index: 0000000000000000
2025-07-24T13:37:43Z Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements
2025-07-24T13:37:43Z Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements
2025-07-24T13:37:43Z init message: Loading block index…
2025-07-24T13:37:43Z Assuming ancestors of block 00000000000000000001b658dd1120e82e66d2790811f89ede9742ada3ed6d77 have valid signatures.
2025-07-24T13:37:43Z Setting nMinimumChainWork=0000000000000000000000000000000000000000b1f3b93b65b16d035a82be84
2025-07-24T13:37:43Z LoadBlockIndexDB: last block file = 0
2025-07-24T13:37:43Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2025-07-24T13:37:43Z Checking all blk files are present...
2025-07-24T13:37:43Z Initializing chainstate Chainstate [ibd] @ height -1 (null)
2025-07-24T13:37:43Z Opening LevelDB in /home/dude/.bitcoin/chainstate
2025-07-24T13:37:43Z Opened LevelDB successfully
2025-07-24T13:37:43Z Using obfuscation key for /home/dude/.bitcoin/chainstate: 786dd8786c70e085
2025-07-24T13:37:43Z : Error initializing block database.
Please restart with -reindex or -reindex-chainstate to recover.
2025-07-24T13:37:53Z Shutdown: In progress...
2025-07-24T13:37:53Z scheduler thread exit
2025-07-24T13:37:53Z Flushed fee estimates to fee_estimates.dat.
2025-07-24T13:37:53Z Shutdown: done
Long story short:
blocksdir is only about the
*.dat files in the
blocks folder, Bitcoin Core still expects the block's index database folder
blocks/index to remain in the
datadir location. That was apparently unintuitive to me, but may have its reasons depending on how intensely the block's index database is utilized.
In above
debug.log italic highlighted line Bitcoin Core tries to access the LevelDB in
.bitcoin/blocks/index folder which wasn't there because I falsely moved it to
/mnt/ssdplus/blocks/index. Subsequently Core thought I didn't have any block files at all and wanted to go into IBD mode and download blockchain from scratch or recover in a similarly lengthy process with -reindex startup option. Something I absolutely didn't want to do!
The solution was of course pretty simple: move
/mnt/ssdplus/blocks/index folder back to
.bitcoin/blocks/index and restart Core. After that it was happy again with my blockchain data and continued to sync just fine from where it left off before I moved blockchain data files.
You may ask, why did I post this here? Well, it wasn't intuitive for me how the
blocksdir option works and I don't find the
man page verbose enough to understand it's only about the
*.dat files, but that's maybe just me (well, not really as I found some discussion about more verbose documentation of blocksdir in Bitcoin Core issues/pull requests).
-blocksdir=<dir>
Specify directory to hold blocks subdirectory for *.dat files (default: <datadir>)
I hope this helps someone else and clarifies the use of
blocksdir option. I now have a more healthier storage space situation for my daily driver Ubuntu box (sizes in KiB, MiB and GiB below). Should take some time before blockchain growth exhausts available space on
/dev/sdb1.
Filesystem Size Used Avail Use% Mounted on
tmpfs 783M 3,3M 779M 1% /run
/dev/mapper/vgubuntu-root 898G 121G 732G 15% /
tmpfs 3,9G 0 3,9G 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
efivarfs 56K 28K 24K 54% /sys/firmware/efi/efivars
/dev/sda2 1,7G 393M 1,2G 26% /boot
/dev/sda1 511M 6,1M 505M 2% /boot/efi
/dev/sdb1 916G 716G 154G 83% /mnt/ssdplus
tmpfs 782M 124K 782M 1% /run/user/1000