Skip to main content

I Spent a Weekend Fighting TrueNAS's eMMC Installer Bug So You Don't Have To

Three bugs, seven patches, and one dumb HTTP server trick to install TrueNAS SCALE on a Beelink ME Mini

Updated 9 min readMarkdown

So I wanted to build a NAS, and I didn't want to spend Synology money on it. Their 4-bay boxes run $800+ and you're still locked into their weird proprietary ecosystem where everything works fine until you need something they didn't think of. I'd been eyeing mini PCs with NVMe slots for a while, the ones that are basically just a heatsink with six M.2 slots crammed inside a case the size of a paperback novel. This has been a project I've wanted to do for a long time, and I finally have an actual need for it - media storage, backups, a place to self-host things without paying someone else's cloud bill every month.

I'll acknowledge the timing is not ideal. Building anything storage-related right now means paying the Sam Altman tax - in October 2025 he flew to Seoul and signed letters of intent with Samsung and SK Hynix for 900,000 DRAM wafer starts per month, which analysts estimated at roughly 40% of global supply. Non-binding letters, but the market panicked anyway, Micron shuttered Crucial (their entire consumer memory brand, gone after 29 years), and NVMe prices have been climbing ever since. Great time to buy four terabytes of flash storage. Thanks Sam.

But I've been putting this off for over a year already, and at some point you just have to eat the cost and build the thing.

I went with a Beelink ME Mini N95. Around $200, Intel N95 (four cores, more than enough to serve files), 12GB LPDDR5, dual 2.5GbE, and the important part - six NVMe slots plus a 64GB eMMC for the OS. The idea is you put TrueNAS on the eMMC and keep all six NVMe bays free for actual storage. I grabbed two Crucial P310 2TB drives for a ZFS mirror (bought them before Micron killed the brand, luckily), racked the Beelink in my DeskPi RackMate alongside a Pi 5 running Pi-hole and a JetKVM for remote console, and figured I'd have TrueNAS running before dinner.

I booted the installer from USB, selected the eMMC as the boot device, confirmed the wipe, watched the progress bar for about thirty seconds, and then:

Failed to find partition number 2 on mmcblk0

That was it. Dead.

Turns Out This is Basically Everyone

I googled the error expecting to find a quick fix, maybe a flag I missed in the BIOS or something. Instead I found what I can only describe as a mass grave of forum posts from people running every eMMC-based mini PC you can buy, all hitting this exact error, most of them unresolved.

Odroid H4+ users have been posting about it since October 2024, the thread is three pages deep and still getting replies in 2025. Someone with literally the same Beelink ME Mini hit it in August 2025. Ugreen DXP2800, GMKtec NucBox, Beelink's own forums, Reddit. There's even a whole dev.to post from someone documenting their suffering with the same hardware. Proxmox had the same class of bug back in 2018.

The community workarounds were not encouraging. "Just retry the install 2-10 times until it works." Or "drop to shell and manually pre-create the partitions with sgdisk before running the installer, then pray." Nobody had actually looked at why it was failing, and the installer source is sitting right there on GitHub, so I figured I'd go read it.

Three Bugs, Seven Iterations

The installer boots a minimal Linux environment from the USB stick. The installation logic lives in /usr/lib/python3/dist-packages/truenas_installer/install.py, it's Python, and it's got problems. What I thought was one bug turned out to be three stacked on top of each other, and finding them took seven rounds of patching and rebooting.

The first one is almost too obvious. There's a function called get_partitions() that waits for partition device nodes to show up in /dev/ after the partition table gets written. It has a retry loop, which is good, except the default is tries=1. One try. One second of waiting. On NVMe or SATA drives, partition table operations propagate to the kernel basically instantly, so one second is fine. eMMC is different - the controller is slower, the kernel takes longer to register new partitions, and one second just isn't enough. Bump it to 30 or 60 and you've given the eMMC the time it actually needs.

The second bug is the one that really got me. Inside that retry loop, the code calls open(device, 'w') on the raw block device. This is a known Linux trick - opening a block device in write mode forces the kernel to re-read the partition table as a side effect. Works great on NVMe, works great on SATA. On eMMC it deadlocks. The open() call just hangs, forever, no timeout, no error, nothing in dmesg, the process is just gone. I confirmed that partprobe /dev/mmcblk0 and blockdev --rereadpt /dev/mmcblk0 also hang forever for the same underlying reason - they all try to open the block device during partition table settling, and the eMMC controller won't give it back. So even if you increase the retry count, each retry hangs on the first attempt and you never make it to try number two.

The third bug only appeared after I fixed the first two and the installer actually got further. It tries to extract a file called TrueNAS.update from the squashfs image on the ISO. The actual filename in the ISO is TrueNAS-SCALE.update. I genuinely don't know how this one has gone unnoticed - maybe SATA/NVMe installs hit a different code path, or maybe it was a recent rename that nobody updated in the installer code. Either way, trivial to fix once you see it.

The Part Where I Almost Lost My Mind

Here's what made this really painful though. The TrueNAS installer console is a minimal virtual terminal, you can't paste into it. No clipboard support, no tmux, no SSH running by default. It boots from USB and drops you into either the installer wizard or a bare shell, and that shell is where you need to edit Python files.

My first two patch attempts, I typed everything by hand. Staring at a JetKVM remote console, pecking out Python one character at a time, getting the indentation wrong because it's Python and one bad space kills the whole thing, fixing typos, realizing I missed a closing parenthesis, going back up. Each attempt was a full cycle - edit the file, run the installer, watch it fail in a new way, understand why, plan the next edit, type it out again. I was three iterations in and about to lose my mind.

Then I remembered something obvious: the box has a network connection. It got a DHCP lease from my Pi-hole when it booted. And the minimal Linux environment has curl.

I opened a terminal on my laptop, threw the patch into a Python file, and started a web server:

python3 -m http.server 8000

From the TrueNAS console:

curl http://192.168.1.137:8000/patch_install.py | python3

And that was it, that was the whole trick. Write the patch on a real machine with a real editor, serve it over HTTP, curl it from the console. My iteration loop went from ten minutes of careful typing to about thirty seconds of edit-save-curl-run. Four more iterations after that and I had all three bugs nailed down.

The Actual Fix

The core realization is that you can't open eMMC block devices while the partition table is still settling, but you don't actually need to. udevadm trigger tells the kernel to re-enumerate devices through sysfs without touching the block device directly, and udevadm settle blocks until all the triggered events finish processing - which means by the time it returns, your partition nodes are guaranteed to exist in /dev/.

So the fix is: rip out every open(device, 'w') and partprobe and blockdev --rereadpt, replace them with udevadm trigger --subsystem-match=block followed by udevadm settle --timeout=10, bump the retry count from 1 to 60, and fix the squashfs filename. That's it.

Here's the patch script I ended up with. Save this somewhere your TrueNAS console can reach via HTTP, then pipe it through python3 before starting the install:

#!/usr/bin/env python3
"""
Patch TrueNAS SCALE installer for eMMC (mmcblk) devices.
Fixes three bugs:
  1. Insufficient retry count in get_partitions() (1 try -> 60 tries)
  2. Deadlocking open(device, 'w') replaced with udevadm trigger/settle
  3. Squashfs filename mismatch (TrueNAS.update -> TrueNAS-SCALE.update)

Usage from TrueNAS installer shell:
  curl http://<your-ip>:8000/patch_install.py | python3
"""

import re

INSTALL_PY = "/usr/lib/python3/dist-packages/truenas_installer/install.py"

with open(INSTALL_PY, "r") as f:
    source = f.read()

# --- Fix 1: Replace open(device, 'w') partition re-read with udevadm ---
# The original opens the block device in write mode to force a partition
# table re-read. This deadlocks on eMMC controllers.
source = source.replace(
    """try:
                open(device, 'w').close()
            except Exception:
                pass""",
    """try:
                import subprocess as _sp
                _sp.run(['udevadm', 'trigger', '--subsystem-match=block'], check=False)
                _sp.run(['udevadm', 'settle', '--timeout=10'], check=False)
            except Exception:
                pass"""
)

# Replace partprobe/blockdev fallbacks with udevadm equivalents
source = source.replace(
    "subprocess.run(['partprobe', device]",
    "subprocess.run(['udevadm', 'trigger', '--subsystem-match=block']"
)
source = source.replace(
    "subprocess.run(['blockdev', '--rereadpt', device]",
    "subprocess.run(['udevadm', 'settle', '--timeout=10']"
)

# --- Fix 2: Increase retry count ---
# Default tries=1 is one second. eMMC needs 30-60.
source = re.sub(
    r'def get_partitions\(([^)]*?)tries\s*=\s*1([^)]*?)\)',
    r'def get_partitions(\1tries=60\2)',
    source
)
source = re.sub(
    r'get_partitions\(([^)]*?)tries\s*=\s*1([^)]*?)\)',
    r'get_partitions(\1tries=60\2)',
    source
)

# --- Fix 3: Squashfs filename mismatch ---
source = source.replace("TrueNAS.update", "TrueNAS-SCALE.update")

# Ensure os is imported
if "import os" not in source:
    source = "import os\n" + source

with open(INSTALL_PY, "w") as f:
    f.write(source)

print("Patched. Changes:")
print("  - open(device,'w') -> udevadm trigger/settle")
print("  - Retry count 1 -> 60")
print("  - TrueNAS.update -> TrueNAS-SCALE.update")
print("  - partprobe/blockdev -> udevadm equivalents")
print("\nRun the installer normally now.")

Applying It

  1. Boot the TrueNAS SCALE installer USB

  2. Choose the shell option from the installer menu

  3. On another machine on your network, save the script above and run python3 -m http.server 8000 in that directory

  4. Back on the TrueNAS console: curl http://<your-other-machine-ip>:8000/patch_install.py | python3

  5. Exit back to the installer menu, start the install, select your eMMC as the boot device

It should complete without the partition detection error.

This bug is still unfixed upstream as of TrueNAS SCALE 25.10.3. The installer source on GitHub still has tries=1 and still uses open(device, 'w'). Every eMMC-based mini PC on the market still hits it. I've been running TrueNAS on this Beelink for a few months now - 4TB ZFS mirror, Jellyfin, Radarr, the whole stack, saturating both 2.5GbE links over SMB. The hardware is great for this, the installer just needed to get out of its own way.

No comments yet. Be the first to comment.