Hello everyone.
Need some help with restoring system after my several mistakes.
I have headless RockPi 4b with soldered SPI Flash and m2 extension board.
So, I was using it with DietPi for almost 5 years firstly on SD card and moved to 256 Gb NVME after SD died (~ 1 year after start). After moving to 256 Gb NVME bootloader was flashed to SPI, so no SD card used.
Some time ago I realized that 256 Gb not enough and I need to move to 1Tb.
Several days ago I started “migration” to 1 Tb NVME:
-
On live DietPi using
ddcommand and external SSD case I cloned currently used NVME to the bigger one (first mistake because the smaller one still was mounted/used by system) -
After NVME was cloned system despite my mistake started OK, but I was needed for some repartitioning (need more space!). So I tried to use
systemctl enable dietpi-fs_partition_resize.service -
After reboot and some time ago system still was without link on my router and no LED flashes on board/NVME and because it was headless I thought that something went wrong and powered it off (second mistake).
-
HDMI not working for some reasons so I connected board with UART and saw some u-boot console, tried to restore u-boot partition on SPI, but failed and completely cleaned it (third mistake)
-
With USB-OTG and Maskmode i think that I restored u-boot on SPI Flash (I think so because UART shows some tries to find bootable system even with no SD/NVME installed) – used loader *.bin and u-boot image from here.
-
When connected 256 Gb NVME system tried to start, on kernel boot I saw message like ‘Started resize partitions’ (I thought “How is this possible, I enabled dietpi-fs_partition_resize.service on different NVME!?”) and it stucks for hour – no LED board/NVME blinks and no new data on UART, so I powered it off (fourth mistake).
-
After that issue, loading with 256Gb NVME stops at u-boot after CRC error of RAMDisk Image
-
When connecting 1Tb NVME loading stucks on “
Starting kernel ...”.UART Output
DDR Version 1.20 20190314
In
channel 0
CS = 0
MR0=0xB8
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
CS = 1
MR0=0x38
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0xB8
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
CS = 1
MR0=0x38
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 1 training pass!
change freq to 400MHz 0,1
channel 0
CS = 0
MR0=0xB8
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
CS = 1
MR0=0x38
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0xB8
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
CS = 1
MR0=0x38
MR4=0x1
MR5=0xFF
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 1 training pass!
change freq to 800MHz 1,0
Channel 0: LPDDR4,800MHz
Bus Width=32 Col=10 Bank=8 Row=15/15 CS=2 Die Bus-Width=16 Size=2048MB
Channel 1: LPDDR4,800MHz
Bus Width=32 Col=10 Bank=8 Row=15/15 CS=2 Die Bus-Width=16 Size=2048MB
256B stride
ch 0 ddrconfig = 0x101, ddrsize = 0x2020
ch 1 ddrconfig = 0x101, ddrsize = 0x2020
pmugrf_os_reg[2] = 0x3AA1FAA1, stride = 0xD
OUT
Boot1: 2018-06-26, version: 1.14
CPUId = 0x0
ChipType = 0x10, 220
Spi_ChipId = b4016
SpiBootInit:0
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
mmc0:cmd8,32
mmc0:cmd5,32
mmc0:cmd55,32
mmc0:cmd1,32
SdmmcInit=0 1
StorageInit ok = 21697
SecureMode = 0
SecureInit ret = 0, SecureMode = 0
GPT vendor signature is wrong
LoadTrust Addr:0x1800
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 1000
Load OK, addr=0x200000, size=0xf1664
RunBL31 0x10000
NOTICE: BL31: v1.3(debug):0e7a845
NOTICE: BL31: Built : 16:13:46, Apr 17 2019
NOTICE: BL31: Rockchip release version: v1.1
INFO: GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO: Using opteed sec cpu_context!
INFO: boot cpu mask: 0
INFO: plat_rockchip_pmu_init(1181): pd status 3e
INFO: BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR: Error initializing runtime service opteed_fast
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x200000
INFO: SPSR = 0x3c9U-Boot 2017.09-2697-ge41695afe3 (Dec 19 2020 - 04:46:31 +0000), Build: jenkins-linux-build-release-436
Model: Radxa ROCK Pi 4B
PreSerial: 2
DRAM: 3.9 GiB
Relocation Offset is: f5bde000
Sysmem: init
I2c speed: 400000Hz
PMIC: RK808
vdd_center 900000 uV
vdd_cpu_l 900000 uV
MMC: dwmmc@fe320000: 1, sdhci@fe330000: 0
Using default environmentModel: Radxa ROCK Pi 4B
Error: “rkimg_bootdev” not defined
Bootdev: mmc 1
MMC: no card present
mmc_init: -123, time 0
rockchip_get_bootdev: can’t find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
MMC: no card present
mmc_init: -123, time 0
rockchip_get_bootdev: can’t find dev_desc!
[Vendor ERROR]:Invalid boot device type(0)
MMC: no card present
mmc_init: -123, time 0
rockchip_get_bootdev: can’t find dev_desc!
rockchip_get_boot_mode: dev_desc is NULL!
MMC: no card present
mmc_init: -123, time 0
rockchip_get_bootdev: can’t find dev_desc!
init_resource_list: dev_desc is NULL!
Can’t find file:logo.bmp
failed to display uboot logo
CLK: (uboot. arml: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
CLK: (uboot. armb: enter 24000 KHz, init 24000 KHz, kernel 0N/A)
aplll 816000 KHz
apllb 24000 KHz
dpll 800000 KHz
cpll 24000 KHz
gpll 800000 KHz
npll 600000 KHz
vpll 24000 KHz
aclk_perihp 133333 KHz
hclk_perihp 66666 KHz
pclk_perihp 33333 KHz
aclk_perilp0 266666 KHz
hclk_perilp0 88888 KHz
pclk_perilp0 44444 KHz
hclk_perilp1 100000 KHz
pclk_perilp1 50000 KHz
Net: eth0: ethernet@fe300000
Hit key to stop autoboot(‘CTRL+C’): 0
Here trying to boot from nvme
dcache offDevice 0: RKPARM: Invalid parameter part table
Vendor: 0x1f99 Rev: GTb57903 Prod: 4E09O8GE92KR6MG9DEMN
Type: Hard Disk
Capacity: 976762.3 MB = 953.8 GB (2000409264 x 512)
… is now current device
Scanning nvme 0:1…
Found U-Boot script /boot/boot.scr
3020 bytes read in 5 ms (589.8 KiB/s)Executing script at 00500000
372 bytes read in 4 ms (90.8 KiB/s)
30095872 bytes read in 259 ms (110.8 MiB/s)
13140474 bytes read in 112 ms (111.9 MiB/s)
81775 bytes read in 17 ms (4.6 MiB/s)
** File not found /boot/dtb/rockchip/overlay/rockchip-pcie-gen2.dtbo **
2825 bytes read in 11 ms (250 KiB/s)
Applying kernel provided DT fixup script (rockchip-fixup.scr)Executing script at 09000000
Loading init Ramdisk from Legacy Image at 0a200000 …
Image Name: uInitrd
Image Type: AArch64 Linux RAMDisk Image (gzip compressed)
Data Size: 13140410 Bytes = 12.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum … OKFlattened Device Tree blob at 08300000
Booting using the fdt blob at 0x8300000
reserving fdt memory region: addr=8300000 size=7a000
Loading Ramdisk to e913c000, end e9dc41ba … OK
Loading Device Tree to 00000000e90bf000, end 00000000e913bfff … OK
Adding bank: 0x00200000 - 0xf8000000 (size: 0xf7e00000)
Total: 19104.19 msStarting kernel …
-
UART output with 1Tb NVME does not contain some obvious critical errors, so I burned SD card with Armbian, put 1Tb NVME to SSD case, loaded from SD, mounted NVME with DietPi and tried to edit
/boot/dietpiEnv.txtto setverbosity=7, but nothing changed after that – same output. But at least I understand that all my data (more or less) on NVME is accessible/readable. -
And my zero mistake was before starting “migration” – last dietpi backup was made in April 2025 – half year ago, so have no recovery snapshot.
-
Also tried fsck on both NVME – was some mistakes, but after repairing them nothing changed.
And now I’m having:
- 256 Gb NVME with bad CRC checksum (but still is mountable with SSD case after loading from SD)
- 1Tb NVME with stucks on “
Starting kernel ...” with partitions sizes from 256 Gb one - No hope to start my old system without fresh install.
DietPi Version
G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=11
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
Maybe someone have any thoughts:
- How I can try to restore my old setup? Where to look at? I am out of ideas.
- Or maybe there is easy way to make fresh install and migrate all installations/configurations from the old one? (maybe there are some lists of installed dietpi-software)?
dietpi_userdatais also accessible btw, and it has all critical for me Home Assistant settings (and maybe some other apps).