Author

Topic: Bitcoin Core can't start (hard disk corrupted?) (Read 193 times)

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Even though it's fixed already now, I'll add my 2 sats:
Considering you're using an external disk, I'd start with the classic have you tried turning it off and on again. I've seen these I/O errors happen with USB sticks. When it's off, reconnect the USB cable.

hero member
Activity: 924
Merit: 5943
not your keys, not your coins!
I forgot to edit my last post. Case's closed, everything works properly! Thank you vv181!
That's good to hear, but before you lock the door on this thread, I'd like to mention that I see way more HDD failures / corruptions / issues with Raspberry Pis than with normal PCs or laptops, where this type of stuff rarely happens. I'm not sure if it's because small corruptions just aren't normally noticed (because files still open fine, ...) or because the Raspberry Pi node operators are not supplying external power.

My personal gut feeling says it's the latter; in fact, I've had this issue myself in the past. I had a SATA-USB adaptor with barrel jack for external power, as well as a powered USB hub that I tried to use with a USB HDD and both failed sooner or later. Back then I had no USB-ammeters on hand, but I believe if you have such issues, it is worth measuring if your specific HDD / hub / adaptor is pulling most of its current from the Pi's USB socket or from the wall.

The reason I suspect this to be the common issue is that the Raspberry Pis provide extraordinarily low output on their ports; for a long time it was just a few hundred mA. It might have changed with the model 4, though. On the other hand, a laptop or PC tower is specced to easily power the SATA ports that it has.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Which test did you run? Usually i would start by "Short" and "Conveyance".
The short.



I forgot to edit my last post. Case's closed, everything works properly! Thank you vv181!
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Welp, my Pi HDD was also recently corrupted  Cheesy
Spooky coincidence.  Tongue

Lastly, try to check and test the SMART status as he referred: https://wiki.archlinux.org/title/S.M.A.R.T.#Run_a_test.
Code:
bitcoin@raspibolt:~ $ sudo smartctl -H /dev/sdb1
smartctl 6.6 2017-11-05 r4594 [armv7l-linux-5.10.52-v7l+] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

If turns out that /dev/sda1 is where the HDD located. The "target is busy." error sign may tell the HDD is completely hung up.
Okay, so I shut it down safely. I just turned it on.
legendary
Activity: 1932
Merit: 1273
Welp, my Pi HDD was also recently corrupted Cheesy

Besides fsck, you may also want to check the SMART status and/or try changing the HDD cable/port, as @ETFBitcoin suggested to me.

You should try to find where your HDD block device is located (/dev/sdX)
Code:
sudo fdisk -l
Then proceed to unmount the disk, and run fsck.

Lastly, try to check and test the SMART status as he referred: https://wiki.archlinux.org/title/S.M.A.R.T.#Run_a_test.

EDIT:

If turns out that /dev/sda1 is where the HDD located. The "target is busy." error sign may tell the HDD is completely hung up. If it the case I think you could either unplug the HDD and re-plug it again or just try to manually shutdown via CLI(sudo shutdown -h now). In case you executed shutdown and the Pi couldn't get powered off, unplugging the power is the last resort.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
I can't unmount it.

Code:
bitcoin@raspibolt:/mnt/ext/bitcoin $ sudo umount /dev/sda1
umount: /mnt/ext: target is busy.

I've just read that sda1 is considered the OS disk by Ubuntu and it cannot be unmounted.
So now the question is.. is the problem on sda1? I was expecting it to be on the non-system disk...

(Also I guess that we better wait for somebody more experienced with Linux  Embarrassed )
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I can't unmount it.

Code:
bitcoin@raspibolt:/mnt/ext/bitcoin $ sudo umount /dev/sda1
umount: /mnt/ext: target is busy.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
From what I've read here, you must unmount the drive first.
Also, from what I've read on that page, the -N parameter ensures no changes are made (dry run), if you want to only see first.

Code:
sudo umount /dev/sda1
sudo fsck -N /dev/sda1
mount /dev/sda1
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Imho you should run it at least to check for the errors (not repair) so you have a better overview of the problem.
It says it'll cause severe damage:

Code:
bitcoin@raspibolt:/mnt/ext/bitcoin $ fsck /dev/sda1
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
/dev/sda1 is mounted.



WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.


Do you really want to continue?
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
I searched that up and it has to do with the hard drive. Has it happened to anyone before? I just want to ensure I don't have to erase it and re-install everything.

Did you try to run fsck ?
From what I've read it's pretty much like chkdsk I've been using in the past. It will not necessarily render your data useless; it depends on the luck/what is on the bad area and what happened there (bad sector, cross link?)

Imho you should run it at least to check for the errors (not repair) so you have a better overview of the problem.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Bitcoin Client Software and Version Number: Bitcoin Core 22.0
Operating System: Raspberry Pi OS
System Hardware Specs: 32GB SD card with a 1 TB HDD external disk.

Description of Problem: I opened up my Electrum after a long time (perhaps a week) and it couldn't synchronize; it had stuck at "0/20 synchronized". This made me login in my RPi 4 and see if things work properly, which weren't. Bitcoin Core has simply stopped working for, yet, unknown reason.

I run bitcoind:
Code:
bitcoin@raspibolt:~ $ bitcoind
Error: Failed saving settings file:
- Error: Unable to open settings file /mnt/ext/bitcoin/settings.json.tmp for writing

I then go to /mnt/ext/bitcoin which is the data directory; hit a ls -l to check the file list:
Code:
bitcoin@raspibolt:/mnt/ext/bitcoin $ ls -l
ls: reading directory '.': Input/output error
total 0

It can't read it. I searched that up and it has to do with the hard drive. Has it happened to anyone before? I just want to ensure I don't have to erase it and re-install everything.
Jump to: