I have an Odroid HC4 I've used as a NAS. Back around 2021, it worked fine. I think I installed plain armbian back then and installed openmediavault on top of it. Then I did all kinds of updates to it. I believe it's now on a hybrid of Debian Bookworm and Debian Trixie - don't ask. The update mechanism is not super clear.
I wanted to run a fresh, plain Armbian and install dietpi.
But there is a well documented flaw where Armbian cannot exit boot in some cases. In my case, it happens only when SATA drives are attached. I have two WD Red drives that it can't boot with those attached.
It seems like the bootloader code was changed over time, which let prior builds boot but not current builds.
Admittedly, these drives fail SMART, so they could be reporting bad data.
Errors:
Scanning bus for devices...
[SATA stuff]
timeout exit!
fs_devread read error - block
[SATA stuff - size is off by about 10x - says 700 GB, actually 6 TB]
Device 0: [SATA stuff]
... is now current device
timeout exit!
timeout exit!
timeout exit!
[etc.]
I tried setting the code in /boot to only attempt to boot from emmc0 and emmc1.
The farthest I got was this, but I think updating to trixie via armbian-config again broke the boot code:
installed old armbian minimal
apt install armbian-config
# the keys are old and fail with the sha1 ban recently implemented. this fixes that
wget https://apt.armbian.com/armbian.key
gpg --dearmor < armbian.key | sudo tee /usr/share/keyrings/armbian.gpg > /dev/null
armbian-config: disable firmware update (also disables kernel updates)
distro full upgrade from armbian-config
got:
Description: Armbian 26.5.1 trixie
Release: 13
https://dietpi.com/docs/hardware/#make-your-own-distribution
noticed this in the install script running, i'm worried it will wipe the good old firmware and replace with new bad:
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[ OK ] DietPi-Installer | APT install linux-image-current-meson64 linux-u-boot-odroidhc4-current
[ OK ] DietPi-Installer | rm -f /boot/uImage /boot/uInitrd /boot/uInitrd-6.18.34-current-meson64
[ OK ] DietPi-Installer | rm /boot/.next
[ OK ] DietPi-Installer | rm /boot/armbianEnv.txt
[ OK ] DietPi-Installer | mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr
[ SUB1 ] DietPi-Set_hardware > flash-u-boot-mmc (/dev/mmcblk0)
442+0 records in
442+0 records out
442 bytes copied, 0.00430629 s, 103 kB/s
2626+1 records in
2626+1 records out
1344880 bytes (1.3 MB, 1.3 MiB) copied, 0.162507 s, 8.3 MB/s
[ OK ] flash-u-boot-mmc (/dev/mmcblk0) | Completed
[ INFO ] DietPi-Installer | Preventing needless kernel and initramfs symlink generation
[ OK ] DietPi-Installer | eval echo 'do_symlinks=0' > /etc/kernel-img.conf
[ OK ] DietPi-Installer | rm -f /initrd.img /initrd.img.old /vmlinuz /vmlinuz.old
[ INFO ] DietPi-Installer | Generating list of minimal packages, required for DietPi installation
[ OK ] DietPi-Installer | Marking required packages as manually installed
[ OK ] DietPi-Installer | Unhold all packages
[ INFO ] DietPi-Installer | APT autopurge gawk original-awk, please wait...
Reading package lists...
Ideas:
- try booting with just one SATA
- try another SATA drive
- try with petitboot (older / manufacturer boot code) instead of uboot
- compare working /boot folder on working microsd with failed /boot folder (I did this, far too many differences to list). I did try copying key differences and recompiling the boot, didn't seem to fix it.
- hotswap / hot install the drives after boot (apparently works)
related:
https://dietpi.com/forum/t/error-on-updating-ombi/25096
https://dietpi.com/forum/t/dietpi-os-apt-update-warnings/24923/31?page=2
https://forum.openmediavault.org/index.php?thread/43298-install-omv-on-odroid-hc4-some-questions-from-a-newbie/
https://dietpi.com/forum/t/odroid-hc4-sata-drives-not-recognized/4795
https://dietpi.com/forum/t/odroid-c2-doesnt-boot-up/6489/14
https://dietpi.com/forum/t/orange-pi-5-boot-from-sata-m-2-ssd/17884/51?page=2
https://github.com/MichaIng/DietPi/issues/7601