Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: NginUS on October 05, 2017, 01:11:41 AM



Title: [SOLVED] How to minimize size of blocks on disk in Linux
Post by: NginUS on October 05, 2017, 01:11:41 AM
I run Bitcoin-QT on an Ubuntu that's installed to a small SSD, & the blocks folder is on a larger HDD.

It's blocks folder is over 145GB & I'd like to be able to reduce that somehow. At first I looked into there being a way to compress individual folders like Windows can on NTFS, but brief Googling told me that's not a thing in linux.

Any tricks to do this?


Title: Re: How to minimize size of blocks on disk in Linux
Post by: -ck on October 05, 2017, 01:22:57 AM
The blockchain doesn't compress very well so I'd advise against trying to compress the directory. The easiest thing to do is prune your blockchain which gives you a fixed size blockchain of only the latest blocks that fit into the size you specify. The smallest you can set it to is 550MB. You won't be contributing to the network as much since you will no longer be able to seed new nodes, but it depends on what you want to run your own node for. If it's only for your own security and wallet then you won't lose anything by pruning it. Set prune= in your bitcoin.conf to the size you want.


Title: Re: How to minimize size of blocks on disk in Linux
Post by: NginUS on October 05, 2017, 02:21:19 AM
The easiest thing to do is prune(.) You won't be contributing to the network as much since you will no longer be able to seed new nodes, but it depends on what you want to run your own node for.

Thanks for letting me know of that function. However I don't believe I'll be using it, as the whole point of running a node is to simply contribute a bit. If it gets considerably larger I'll either upgrade the size of the disk or just stop running it & delete the blocks.


Title: Re: [SOLVED] How to minimize size of blocks on disk in Linux
Post by: aleksej996 on October 05, 2017, 08:12:39 PM
I run Bitcoin-QT on an Ubuntu that's installed to a small SSD, & the blocks folder is on a larger HDD.

It's blocks folder is over 145GB & I'd like to be able to reduce that somehow. At first I looked into there being a way to compress individual folders like Windows can on NTFS, but brief Googling told me that's not a thing in linux.

Any tricks to do this?

There is no real way to efficiently compress it and used it as such, since if you do compress it, you will be spending some CPU power whenever you need to access it anyway, but the previous reply is also right, it won't compress much.

Are you asking this so you can fit the blockchain on the SSD?
If so, you could try instead of pruning it, to maybe put the older blocks on the HDD and newer ones on the SSD. That should speed things up for the most requested blocks. You could probably do this by making soft (symbolic) links of the certain amount of oldest blocks until you are comfortable with the amount of free space you have left on the SSD.

You can see more about creating symbolic links here https://en.wikipedia.org/wiki/Symbolic_link#POSIX_and_Unix-like_operating_systems (https://en.wikipedia.org/wiki/Symbolic_link#POSIX_and_Unix-like_operating_systems)


Title: Re: [SOLVED] How to minimize size of blocks on disk in Linux
Post by: NginUS on October 07, 2017, 12:19:01 AM
do this by making soft (symbolic) links of the certain amount of oldest blocks

This worked beautifully. Thanks!