Is it possible to have DietPi root on usb drive for Odroid C4?

Hi,

new here so please bear with me :slight_smile:
I recently purchased an Odroid C4 and want to use it as a small home / office server. While evaluating different OS options I stumbled upon DietPi and I must say: chapeau! This looks really great!

As the Odroid C4 must boot of the sdcard and I really do not want to do that, sdcards are know to be troublesome and non-performant, I want to have the root of the OS (where all the reading and writing takes place) come from an attached usb drive.

I found an excellent guide here on the forum that worked great for the official Odroid HardKernel OS but not (anymore) for DietPi. Somewhere in time DietPi moved to a single partition holding the root and boot.
So booting from the boot partition and then loading the root partition from the usb drive doesn´t work anymore…

Or maybe I am missing something and this IS possible and I just haven´t found out how.

So If somebody can enlighten me if and if so how to have all files (except the /boot) on the usbdrive that would be highly appreciated.

If it is not possible I would also like to hear that, unfortunately then DietPi is no option for me.

maybe something @MichaIng could have a look into

AFAIK, it is sadly not possible. On Odroid HC4 it is theoretically possible (coincidentally I’m just confronted with it: Odroid HC4 booting from SSD) since it has an SPI flash it can boot from. The bootloader from the SPI flash can then load an OS from USB. But the C4 has no SPI flash and I doubt that the hardware/firmware itself can check USB devices for a bootloader.

Hi, Thanks for following up.
Yesterday I had a go with armbian on this device. armbian comes with a tool called: nand-sata-install (Getting Started - Armbian Documentation)

when started it let’s you choose where you want the have the root residing: usb drive is an option.

This works as advertised: the sdcard still has one partition that is used for the initial boot, but then one of the first things it does is mount the usb drive.

Exactly what I want and functional (not technical) equal to result when following this (outdated) instructions: [Tutorial - Outdated] Odroid: - Move the filesystem to a USB Drive - #3 by k-plan

So I had (!) a working armbian setup that boots from sdcard but runs from usb drive.

I say ‘had’, because when doing a kernel / firmware upgrade, the boot ‘failed’ because it was to ‘fast’ and the usb drive was not yet ready. setting a bootdelay in boot.cmd (compiled) didn’t work.
So now when booting it fails into a boot prompt where I have to type ‘exit’ and then the boot continues and all works… but in a headless setup this is a nogo :s
There where some other issues with armbian (software install via their tool not working on jammy) which made me decide that this is for my purposes not stable enough: so not an option.

Jammy would be Ubuntu, while DietPi is based on Debian. Did you tried on of Armbian Debian images?

Hi @Joulinar, I know. as I am testing I downloaded the one they advice in the download section which is jammy. What I found is that their software install tool is ‘under heavy development’ (from their github repo), when looking at e.g. the install script for ISPConfig I noticed that it doesn’t have source for jammy. So that is probably where the issue is. When trying to install e.g. ISPConfig the install will partially fail as the repos from where to install the software are not available / pointing to the wrong version > leaving the system in a ‘broken’ state.

The whole point of using this is that it has these install / config and maintenance script: the alternative is going ‘vanilla’ and install / configure everything yourself.

Also defreezing the kernel / firmware and doing an opt upgrade breaking the system doesn’t give me the warm feeling :slight_smile:

You should give the Debian version a try to see if this is running. Once all is fine, you could use our Dietpi install script to convert into DietPi system. This should preserve the file system layout.

Yes, was thinking the same :slight_smile:

maybe another route would be to install DietPi and then (need to figure this out) use the nand-sata-install script from armbian to do the boot on sdcard and rootfs on usb drive.

Is that something that could work?

okay so that was a bust… installed debian version of armbian. Using nand-sata-install to boot from sdcard but have rootfs on usb diver… so far so good.
but hen installing updates: constant 404 on repos…

installing software via armbian-config > only partially possible so installations that have multiple packages like ISPconfig but also Pi Hole do not install / install complete.

I’m giving up on armbian :frowning:

Will try to see if i can get nand-sata-install working on dietpi, not sure if it is going to be easy though, will probably conflict with dietpi disk-manager as that then has no knowledge of the new setup and probably will break things when started / used…

but then again… it is never easy :slight_smile:

So after a good nights rest, i was able to run my Odroid C4 from a USB drive.
I think (battle testing will need to validate this), that I have done this in a way that will complement DietPi or at least not compromise it (and it’s tools).

I have done a write up here for anybody interested: [Tutorial] Odroid C4 rootfs on USB drive

I hope this helps, actually i hope this ‘holds’ as I really like the robustness of this project (especially after seeing so many others…)

4 Likes

This feature request is basically tracked here: DietPi-Drive_Manager | Re-allow moving rootfs on single-partition images · Issue #5295 · MichaIng/DietPi · GitHub