Unable to setup physical hard drive as the rootfs on Odroid HC2 as I have on my old setup

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information for OLD SBC

  • DietPi version |
    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=1
    G_DIETPI_VERSION_RC=1
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | bookworm
  • Kernel version | Linux HOSTNAME 4.14.294+ #1 SMP PREEMPT Sat Sep 24 10:24:15 UTC 2022 armv7l GNU/Linux
  • Architecture | armhf
  • SBC model | Odroid XU3/XU4/MC1/HC1/HC2 (armv7l)
  • Power supply used | the one sold by AmeriDroid.com for this SBC
  • SD card used | SanDisk ultra just for /boot and the rest of my system is installed on a spinning rust hard drive

Required Information for NEW SBC

  • DietPi version |
    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=1
    G_DIETPI_VERSION_RC=1
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | bookworm
  • Kernel version | Linux HOSTNAME2 6.1.79-current-odroidxu4 #3 SMP PREEMPT Thu Feb 8 13:10:24 UTC 2024 armv7l GNU/Linux
  • Architecture | armhf
  • SBC model | Odroid XU3/XU4/MC1/HC1/HC2 (armv7l)
  • Power supply used | the one sold by AmeriDroid.com for this SBC
  • SD card used | SanDisk ultra just with a SSD to transfer rootfs to

Additional Information (if applicable)

  • After realizing that I have to “start over” to get the latest kernel, as was reported in this issue, I have a brand new DietPi install on an identical device.
  • I am not able to find the option to “transfer RootFS” on target drive and (which is not mounted), as mentioned in this recent thread
  • The OLD SBC started on Bullseye before being upgraded to Bookworm so it could get a newer version of Nextcloud. This SBC requires a microSD for /boot and is not capable of booting directly from a HD/SSD.

Steps to reproduce

  1. Type lsblk on both the OLD and the NEW SBC and see different results:
OLD-SBC $ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0  2.7T  0 disk 
└─sda1        8:1    0  2.7T  0 part /
mmcblk1     179:0    0 14.8G  0 disk 
├─mmcblk1p1 179:1    0  257M  0 part /boot
└─mmcblk1p2 179:2    0 14.6G  0 part

NEW-SBC $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 465.8G  0 disk 
└─sda1        8:1    0 465.8G  0 part 
mmcblk0     179:0    0  14.8G  0 disk 
└─mmcblk0p1 179:1    0  14.8G  0 part /
  1. Run sudo dietpi-drive_manager on OLD-SBC. See that the hard drive is the rootfs / and that the microSD card is the /boot partition.

  2. Run sudo dietpi-drive_manager on NEW-SBC in order to replicate the same configuration. It sees the SSD, which I then formatted in this program. It also sees that the microSD is the rootfs / , but there is no /boot partition (as was on the OLD-SBC).

  3. Look for a “transfer RootFS” option on NEW-SBC and nothing exists.

Expected behaviour

  • The “transfer RootFS” option would be available on the NEW-SBC.
  • The microSD card on the NEW-SBC would have a separate /boot partition.
  • The microSD card on the NEW-SBC would also have a root / partition that could be moved to the SSD on the NEW-SBC.

Actual behaviour

  • No “transfer RootFS” option is available on the NEW-SBC.
  • Unable to replicate the disk setup of the OLD-SBC onto the NEW-SBC.

Extra details

  • I just want to replicate the same disk setup on this SBC as the OLD one, but I’m hitting brick walls in this. I need help figuring this out! Thanks.

Well, the new image no longer has this 2-partitioning. Therefore, there is no way to move RootFS. Because it simply no longer exists.

Any suggestions on how to take the supplied DietPi image & modify it to have the 2-partitioning? Or any other suggestions on how to run RootFS off of a physical SSD/HD and then have /boot on the microSD? Thanks.

First thing which comes in my mind is to move the folders you want to “outsource” to the SD card and them symlink them back to their original source path. So the system “thinks” their are still on the SSD but in reality they are somewhere else.

I’m not sure if that will work for this headless Odroid HC2 SBC as requires it to first boot from the microSD (which has uBoot & the kernel) before utilizing a separate disk in it.

this is not possible with current image.

Not sure if there are other guides on the web on how to allow moving parts of the system to USB device. Something you might need to check.

I tried a different way to get this running with DietPi, but it did not work - it did get close to being everything as the older system. I did:

  1. First, I installed Meveric’s Bullseye image from this post [OS] Debian Bullseye - ODROID , which gives me the “2-partitioning” needed to move the RootFS to a physical HD or SSD.

  2. Then, I upgraded it to Bookworm by using this info https://www.cyberciti.biz/faq/update-upgrade-debian-11-to-debian-12-bookworm/ and by also changing bullseye to bookworm in /etc/apt/sources.list.d/meveric.list

  3. Then, after the system was upgraded, and booted fine, I then ran dietpi-installer script, found here Supported hardware - DietPi.com Docs which would set this up as DietPi.

This is just with the brand new SanDisk microSD card. Any ideas on how to troubleshoot?

I see this in the changelog

v8.4
(2022-04-30)

New images:
- Odroid XU4 | We updated our Odroid XU4 image to be shipped with Linux 5.4. Sadly systems running the old image cannot be upgraded, since the new U-Boot config requires a single ext4 partition without a dedicated boot partition.

Where can I find the old u-boot config?

Yesterday i tried modifying dietpi-build script. Just changed line DietPi/.build/images/dietpi-build at 02592a3c0a9b33d851a5b71390c9a6571287c355 · MichaIng/DietPi · GitHub added boot_size and boot_fstype.

And it build working two partition system, where move rootfs work!

@jgreyz if you want i can provide a link to download an working image that rootfs can be moved?

2 Likes

Yes, that’d be great! Thank you very much for figuring a way to get this working on the HC2.

Thank you for sending an image file to me, but I am much more interested in what and how you changed the dietpi-build script to do this. I want to understand where the bread is baked.

I will write you exact steps i did as i get home from work.

EDIT:
@jgreyz

I run this script on my PC (x86-64) with Debian Bookworm.

Install curl, if you don't have it
apt install curl

Download the script
wget https://github.com/MichaIng/DietPi/raw/master/.build/images/dietpi-build

Open script in editor (for ex. VS Code)
and modify line
11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;;
to
11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 boot_size=128 root_size=764 boot_fstype='fat16';;

Make script executable
chmod +x dietpi-build

Build an image for XU4
./dietpi-build -m 11 -d 7