I'm using Bitcoin Core 26.0 on Raspbian Lite OS (64-bit) with 4 GB RAM and a 2 TB external HDD.
Here's the deal: I swapped out my disks, and it looks like either the blocks or the chainstate got messed up, so now I'm stuck reindexing. I've been at it for a week and I'm only at 0.313028 progress. It feels like it’s crawling. Just yesterday, I was at 0.30. At this rate, hitting the tip is gonna take over a month.
I was wondering if I could just unplug the HDD and connect it to a more powerful computer to speed things up. I mean, it should work, right? The disk's running Raspbian, so I could boot it up on another machine without too much hassle. Just wanna make sure I won’t screw anything up.
I don't see a problem with doing what you suggest. I have never tried it though. To be honest, I don't understand how the directories were corrupted, but reindexing can be painful, indeed.
What I have tried in the past, and it worked, was to download the blockchain on my SSD using Windows 11 OS. Then I deleted Bitcoin Core, because I performed a format. Then I downloaded Core again and set it to look in the SSD again. It worked flawlessly. I guess it's a relevant situation, isn't it ?
I've considered doing that, but I don't have a terabyte of SSD, and I don't want to buy one just for that purpose. HDD satisfies my needs. Sure, Bitcoin Core would be less troublesome, but if it works, even slowly, then I don't care.
Hmm. Maybe if I used Bitcoin Core from my main computer without booting into Raspbian, and pointed to the Bitcoin data directory in the plugged HDD, then maybe it would reindex more rapidly. There are quite a lot of permission issues this way, though. (The datadir is read only, and I'll have to run Bitcoin Core as root)
Yes you can. Format of data directories between versions are the exact same and there is no compatibility issues whatsoever. Of course, remember to shut it down gracefully.
In fact, this was how I encouraged people to do IBD on a proper Desktop instead of their RPi. Resync on RPi was really long for me, and using the Desktop was much less frustrating in comparison.
That should work, although I'd prefer to use it as a secondary disk in another system, and not boot from it.
Your problem is the 4 GB RAM in combination with 11 GB chainstate. Add HDD, and it's a very bad combination.
As far as I know, reindexing chainstate requires almost as much writing to disk as a full fresh sync. It only saves writing 580 GB blocks. I wrote 4.58 GB to disk with 8 GB RAM during IBD. Remove the blocks, and you're left with 4 TB. And that was with twice the ram, so you'll need to write more than 4 TB. That's 4+ TB reading and writing more or less random access on a HDD. If it takes a month, that's 1.5+ MB/s on average, which could very well be the best the HDD can do with random reads and writes. This is why I prefer to put chainstate on SSD.
Progress will get worse once you're further ahead, see my graph.
I had the same experience some time ago. After deterioration of chainstate data on my external SSD I have fallen for reindex. This process was as slow as it was less than effective. Thus I had to start the sync from scratch.
Hence, to not waste time, I would advocate IBD rather than reindex in the case of any chainstate corruption.
If you do it on a full desktop system, mind the file permissions. 99% of the time there is no issue that 1% will drive you nuts.
And I know it's been said but I'll say it again, get a SSD
And, with all the disk I/O and everything else make sure the RPi is not throttling for either temperature because the CPU being hammered or power because of the constant pull from the drive.
-Dave