tomazbracic

tomazbracic

Hi,

I have:

  • Raspberry CM4 8Gb, 32Gb eMMC
  • CM4 IO expansion board

I would like to correctly flash CM4 and make it operational (without SD Card).
I was following or lets say combining few sources:

  1. https://qbereau.hashnode.dev/flashing-a-nerves-raspberry-image-from-sd-card-to-emmc
  2. https://forum.elixirforum.com/t/flashing-a-nerves-rpi-image-from-sd-card-to-emmc/49912
  3. https://www.digikey.es/es/maker/projects/how-to-flash-the-raspberry-pi-compute-module-4-cm4-emmc-with-an-os/3e33d2593b914a98bfe7cc08d4af5dbb

I ended up with a working CM4. I can use LAN and connect to it. So it kind of works. But I am confused with the partitioning on CM4. This is the output of cmd("df -h") command on it.

iex(1)> cmd("df -h")
Filesystem                Size      Used Available Use% Mounted on
/dev/root                28.3M     28.3M         0 100% /
devtmpfs                  1.0M         0      1.0M   0% /dev
tmpfs                   770.6M      8.0K    770.5M   0% /tmp
tmpfs                   385.3M      4.0K    385.3M   0% /run
/dev/mmcblk0p1           18.7M     15.5M      3.1M  83% /boot
/dev/mmcblk0p3          510.0M    434.6M     75.4M  85% /root
tmpfs                     1.0M         0      1.0M   0% /sys/fs/cgroup

So this /dev/mmcblk0p3 is to my understanding too small. Am I correct? It should be around 30Gb?

For instance… on my 16Gb SDCard on another Nerves system (plain RPi4 - SDCard, no eMMC) I can see this:

iex(5)> cmd("df -h")
Filesystem                Size      Used Available Use% Mounted on
/dev/root                28.3M     28.3M         0 100% /
devtmpfs                  1.0M         0      1.0M   0% /dev
tmpfs                   368.8M      8.0K    368.8M   0% /tmp
tmpfs                   184.4M      4.0K    184.4M   0% /run
/dev/mmcblk0p1           18.7M     15.5M      3.1M  83% /boot
tmpfs                     1.0M         0      1.0M   0% /sys/fs/cgroup
/dev/mmcblk0p3           14.5G    603.5M     13.9G   4% /root

So, what did I do wrong? I would really appreciate some feedback.
Thanks!

Tomaz

Showing Posts 1 to 4

quentin

quentin

Hi Thomaz,

Your problem might reside in your fwup.conf and fwup-revert.conf
You’ll see something like define(APP_PART_COUNT, 1044480)
You should try to increase it to define(APP_PART_COUNT, 62914560) to make space for 30GB instead of 510MB.

Not 100% sure but worth a look.
Hope it helps.
Quentin

tomazbracic

tomazbracic OP

Hi Quentin,

I do have 1044480 set, but isn’t this expansion done automatically to the size of “disk”. At least I compared both installations CM4 and RPi4. On RPi4 with the same number it did expand to occupy the whole SD card. On CM4 eMMC it didn’t.

Hmm… any other idea perhaps?

ericr3r

ericr3r

Tomaz,

Are you using fwup to flash the nerves image directly on the CM4 or converting to an img file first?

I suspect that if you create an img file first, it is going to create a fixed size application partition. I’d recommend mounting the CM4 as an SD card and then run fwup <your_nerves_app>.fw and select the eMMC chip as the destination.

I don’t have direct experience with the CM4 but I believe that would work.

Eric

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews