It seems the Initial Block Download (IBD) on macOS Catalina uses a lot more disk space than expected, and will result in an unsuccesful download even when 480 GB of free disk space is available at the beginning.
Expected behavior
That the Initial Block Download finishes after using about 284 GB of disk space, as indicated by the Welcome window.
Actual behavior
When the download reaches 52% completion, over 284 GB of disk space has already been consumed. If the download is left to run, the machine will run out of disk space and Bitcoin Core will stop/quit before completing the download.
Looking a bit into the Bitcoin directory and what could be causing it, the files prefixed rev in the blocks folder are a lot larger than they are when compared to a previous blockchain downloaded on Linux.
Comparing the rev*.dat files with a previous successful IBD on Linux (below mounted with ext4fuse), the rev files use at most 23M, and the total is 32G:
0blocks # pwd
1/Users/erik/linux-ext4/bitcoin/.bitcoin/blocks
2
3blocks # du -ch rev*.dat | sort -n
46.0M rev01866.dat
5 12M rev00311.dat
6 12M rev00328.dat
7 13M rev00314.dat
8 14M rev00295.dat
9 14M rev00309.dat
10 ...
11 21M rev01206.dat
12 21M rev01291.dat
13 23M rev01036.dat
14 32G total
On Mac, the rev files will be significantly larger than 23M. You can see that the files can get as large as 184M, and in this case where 22.8% of the blockchain had been downloaded, we were already using 48G for just the rev files, 107G for the whole data directory.
0$ tail -n 1 /Users/erik/Library/Application\ Support/Bitcoin/debug.log
12019-12-29T07:30:29Z UpdateTip: new best=0000000000000000025930ce69bc9fcfae882de7231457f09534da493e114c52 height=399555 version=0x00000004 log2_work=84.162383 tx=111703322 date='2016-02-22T08:57:07Z' progress=0.228149 cache=466.9MiB(3406855txo)
2
3$ du -ch /Users/erik/Library/Application\ Support/Bitcoin/blocks/rev*.dat | sort -n
4 16M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00003.dat
5 17M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00056.dat
6 18M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00006.dat
7 20M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00000.dat
8 21M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00450.dat
9 24M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00078.dat
10 27M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00002.dat
11 ...
12171M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00232.dat
13172M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00266.dat
14172M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00334.dat
15174M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00256.dat
16175M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00143.dat
17175M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00275.dat
18177M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00132.dat
19177M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00204.dat
20178M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00337.dat
21184M /Users/erik/Library/Application Support/Bitcoin/blocks/rev00208.dat
22 48G total
23
24$ du -ch /Users/erik/Library/Application\ Support/Bitcoin
25 91M /Users/erik/Library/Application Support/Bitcoin/blocks/index
26105G /Users/erik/Library/Application Support/Bitcoin/blocks
271.8G /Users/erik/Library/Application Support/Bitcoin/chainstate
282.0M /Users/erik/Library/Application Support/Bitcoin/wallets
29107G /Users/erik/Library/Application Support/Bitcoin
30107G total
Here you can see the Linux-Mac diff side by side:
To reproduce
- Download and install Bitcoin Core 0.19.0.1 on a Mac with a fresh install of macOS Catalina 10.15.2
- Start Bitcoin Core and select the default data directory and leave the prune checkbox unchecked (see picture at the start of the report)
- After downloading ~55% of the blockchain, check the disk space use of the ~/Library/Application Support/Bitcoin folder, it should now already exceed 284 GB
- If you had 480 GB of free space when starting the download, you should not be able to finish the download before running out of disk space
Possible workaround
Based on https://bitcoin.stackexchange.com/questions/11104/what-is-the-database-for/11108#11108 it seems the rev*.dat files can be removed to free up disk space. By deleting the earlier ones created I was able to free up enough space continue and complete the IBD on the Mac mini. However, doing so may lead to side effects that I am unaware of.
System information
bitcoin-0.19.0.1-osx.dmg downloaded from https://bitcoin.org/en/download
Machine 1:
- Mac mini (Late 2012)
- 2,5 GHz Dual-Core Intel Core i5
- 16 GB 1600 MHz DDR3
- macOS Catalina 10.15.2 (fresh install on a 500 GB SSD)
Machine 2:
- MacBook Pro (15-inch, 2018)
- 2,6 GHz 6-Core Intel Core i7
- 32 GB 2400 MHz DDR4
- macOS Catalina 10.15.2 (upgraded from Mojave)