Encrypted HDD shows I/O errors when Bitcoin Core gets 100% synchronized

Hi everyone! I have this setup:

  • RaspberryPi 4B with 8GB RAM
  • 32GB microSD card
  • openSUSE Leap 15.3 (Linux) on the microSD
  • VeraCrypt 1.24-Update7
  • 1TB HDD with a single partition encrypted with VeraCrypt
  • Umbrel 0.4.9 (latest at the moment) on the HDD

What’s happening is: when Bitcoin Core gets 100% synchronized (e.g. it downloads a block mined 1 minute ago), it stops syncing and does not download further blocks. Although the web interface keeps saying “Running” and “100% Synchronized”, if I SSH to the server and start inspecting the HDD contents (i.e. listing directories and files), I get a lot of I/O errors:

# ll /mnt/hdd
ls: reading directory '/mnt/hdd': Input/output error
total 0

Then I reboot the server, mount the HDD, start Umbrel, it works as normal, restarting to sync from, let’s say, 99,91%. Until it stucks at 100% again.

It is now stopped at block 713.846 (5 hours ago).

Do you have any ideas on what is causing this?

I know my setup is somehow unique, but if possible I would like to keep it, because I plan installing NextCloud when I get Umbrel working flawlessly (that’s why I encrypted the HDD).

Thanks!

Note: I’m always able to open the web interface and to remotely access the server (via SSH), even when it stops syncing. So I believe it’s something related to I/O, not to network.

Today I found something interesting, I’m not sure it’s related to the problem.

But between rebooting the server and mounting the HDD, I realized the server created “by itself” a /mnt/hdd/umbrel/lnd/ folder. And if I delete it, it is kind of recreated instantly:

# uptime
 18:31:34  up   0:02,  1 user,  load average: 2,10, 0,52, 0,17
# mount -l | grep /mnt/hdd
# ll /mnt/hdd/umbrel/lnd/
total 0
# file /mnt/hdd/umbrel/lnd/
/mnt/hdd/umbrel/lnd/: directory
# rm -rf /mnt/hdd
# ll /mnt/hdd/umbrel/lnd/
total 0
# file /mnt/hdd/umbrel/lnd/
/mnt/hdd/umbrel/lnd/: directory
# veracrypt /dev/sda1 /mnt/hdd
...
# /mnt/hdd/umbrel/scripts/start
Skipping status update when not on Umbrel OS

======================================
============= STARTING ===============
============== UMBREL ================
======================================

...
Skipping status update when not on Umbrel OS
# ll /mnt/hdd/umbrel/lnd/
total 28
drwx------ 5 umbrel nx 4096 out 25 15:24 data
-rw-r--r-- 1 umbrel nx    0 out 25 15:24 .gitkeep
drwx------ 2 umbrel nx 4096 out 25 15:24 letsencrypt
-rw-r--r-- 1 umbrel nx 1155 nov 24 15:49 lnd.conf
drwx------ 3 umbrel nx 4096 out 25 15:24 logs
-rw-r--r-- 1 umbrel nx  798 out 25 15:24 tls.cert
-rw------- 1 umbrel nx  227 out 25 15:24 tls.key
-rw------- 1 umbrel nx   99 out 25 17:34 v3_onion_private_key