Bitcoin Forum
April 25, 2024, 09:44:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED] How to minimize size of blocks on disk in Linux  (Read 468 times)
NginUS (OP)
Full Member
***
Offline Offline

Activity: 190
Merit: 100


View Profile
October 05, 2017, 01:11:41 AM
Last edit: October 05, 2017, 02:22:21 AM by NginUS
 #1

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?
1714038264
Hero Member
*
Offline Offline

Posts: 1714038264

View Profile Personal Message (Offline)

Ignore
1714038264
Reply with quote  #2

1714038264
Report to moderator
"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714038264
Hero Member
*
Offline Offline

Posts: 1714038264

View Profile Personal Message (Offline)

Ignore
1714038264
Reply with quote  #2

1714038264
Report to moderator
1714038264
Hero Member
*
Offline Offline

Posts: 1714038264

View Profile Personal Message (Offline)

Ignore
1714038264
Reply with quote  #2

1714038264
Report to moderator
1714038264
Hero Member
*
Offline Offline

Posts: 1714038264

View Profile Personal Message (Offline)

Ignore
1714038264
Reply with quote  #2

1714038264
Report to moderator
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
October 05, 2017, 01:22:57 AM
 #2

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.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
NginUS (OP)
Full Member
***
Offline Offline

Activity: 190
Merit: 100


View Profile
October 05, 2017, 02:21:19 AM
 #3

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.
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
October 05, 2017, 08:12:39 PM
 #4

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
NginUS (OP)
Full Member
***
Offline Offline

Activity: 190
Merit: 100


View Profile
October 07, 2017, 12:19:01 AM
 #5

do this by making soft (symbolic) links of the certain amount of oldest blocks

This worked beautifully. Thanks!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!