Switch from SD Card to SSD boot

after running my current setup for Dietpi Nextcloud with Odroid HC4 - RootFS on 256GB SD Card and having data on 2x3TB HDD Raid 1, I am not satisfied with the reaction speed.
Therefor I decided to switch to SSD boot.
As I am not switching the device itself, is it possible to setup the SSD boot with a clean install and then apply the data from dietpi-backup?
Are there any other ways for the migration? Perhaps before doing so, just switching the rootfs to the HDD with the current device and then cloning everything to the SSD?
Best Regards

Does the Odroid HC4 support USB boot at all?

I don’t know, never used it.
the future setup would be boot from SSD directly or boot partition on sd-card and rootfs on SSD. I haven’t figured out what would be best but I will test it with additional sd-cards and the new SSD.

Probably the SD card is still needed. At least to host the bootloader.

Hey @Joulinar , @MichaIng ,

first of all I restored the most recent petitboot (spiboot-20221228.img) according to this guide and tested to directly boot and install dietpi on a fresh SSD.
So I flashed the recent dietpi image DietPi_OdroidC4-ARMv8-Bullseye.img.xz to the SSD and it booted straight away. Somehow there was a small vat partition on /dev/sda2, after manual deletion of /dev/sda2, I triggered a resizeFS and the dietpi setup runs smoothly after reboot. So for fresh installs on HC4 we could state somewhere in the documentation that a direct sata boot is possible.

Next I will try to restore the data from the backup or clone the SD card as stated in the following post Odroid N2/HC4 | Add support for petitboot>USB boot · Issue #5634 · MichaIng/DietPi · GitHub text*

1 Like

This is a new feature we introduced. Using this vfat partition allows to connect USB device to a Windows system to preform some pre-configuration steps within dietpi.txt before running initial boot/setup. Usually this partition should be removed automatically on first setup process.

Ok, perhaps there is a bug on this feature with the experimental sata boot :slight_smile: Shall I reproduce the issue and create a bug report therefor?

We can ask @MichaIng on his opinion

There is a way…but the SD card will hold the /boot partition, then you can midgrate the “root partition” over to any external SSH/HDD using this method

It will rsync everything except the boot drive over to the external USB…then tell the boot script to use the PARTUUID to look for the /root partition on the external USB, the /etc/fstab is also modified to ensure the UUID is correct for the newly mounted and stupidly faster than a SD card

Nice thing is…you can get cheapo 8GB~ SD cards, leave it in, and it will ALWAYS come up…if it doesn’t pop out the SD card, put in a windows machine and scan the fat32 partition for errors. (as long as the root partition isn’t errored out)

Even on slow craptastic USB 2.0 SBC’s like my RPiZero2W an OPiPC an OPiOne, and OPiZero2, it boots from a $4 8GB generic bulk SD card, into a 64GB USB drive externally…and it’s MUCH faster than just a SD card only build. With boot barely every being touched…it rarely if ever has file system issues…and I don’t have to flash an EEPROM on the board and risk having some revision later coming out and crashing my SBC

Biggest thing is BEFORE rebooting after…make sure the /boot/config.txt is correct and the /etc/fstab entries are correct (script should ensure that it’s right…but I borked many a system by having poor scripting [thanks adafruit and {now fixed!!} armbian]

Here is my /etc/fstab on my OPiPC running nothing more than a 2TB transmission bittorent server…happilly slogging away in a cupboard/switch closet

warhawk@orangepipc:/$ cat /etc/fstab
# <file system>					<mount point>	<type>	<options>							<dump>	<pass>
tmpfs						/tmp		tmpfs	defaults,nosuid							0	0
UUID=705b28eb-7ba5-481e-ac44-cb93d2cfd612	/media/mmcboot	ext4    defaults,noatime,commit=600,errors=remount-ro,x-gvfs-hide	0	1
/media/mmcboot/boot                             /boot		none	bind								0       0
UUID=3c82ef17-f148-4cd5-afb5-efa861ad05ef	/		btrfs	defaults,noatime,commit=600,compress=lzo,x-gvfs-hide	        0	2
UUID=9e54bb81-0a95-4ba5-a478-000b5542ae8b	/home/warhawk/hdd	btrfs	defaults,noatime,commit=600,compress=lzo,x-gvfs-hide	0	0

/media/mcboot is SD card
/boot is SD card
/ is a 64GB Sandisk Ultra Fit
/home/warhawk/hdd is the external powered 2tb housing

As I posted in Switch from SD Card to SSD boot - #5 by Rednox, there is no need for SD card anymore at all :slight_smile:
I managed to boot the setup image directly from the external SSD on the HC4.

right right…from an eeprom or does it automatically see the SSD and use some sort of uboot?

I did that a few times as well until a power blip screwed something up…then I couldn’t get back into the SSD or get the EEPROM right on a RPi4B…so I gave up and went stock flash boot from SD card then point to external so if something hosed…I could quickly get the SBC back up and running.

To each his own I suppose… but great call! Not having to have a SD and boot bare metal is actually the end goal for SBC’s…plug and play and ledder rip! :smiley:

I can’t tell you exactly what is happening. The dietpi install partition directly shows in the petitboot menu and boots automatically without any additional action.

Ah…petiboot is a pre-boot environment…kinda like a eeprom version of ventoy…it auto detects partitions and can point the next step in the right direction…nice!


EEPROM is an RPi thing, but yeah, basically the same as the SPI flash on Odroid C4 and others: A dedicated little flash storage for a bootloader, which the hardware can natively boot from. That way from there it can boot distros from any other attached storage types, as long as the bootloader ships with the driver(s) and configuration for it.

Would be great if you could try to reproduce the issue with the config FAT partition. It should not matter from where you boot for this to work. If the partition remains after first boot and/or the root partition was not resized, check this log file:

cat /var/tmp/dietpi/logs/fs_partition_resize.log
1 Like