Home Ops Search

NVMe Initramfs Boot Fix

Crucial P310 NVMe drives don’t auto-enumerate namespaces at boot. This causes boot failures on Rock 5B+ nodes.

On this page

Use this page to get past the initramfs prompt and make the fix survive a reboot. The original investigation keeps the recovery history and machine-specific evidence.

Quick Fix (at initramfs prompt) #

echo 1 > /sys/class/nvme/nvme0/rescan_controller
exit

Permanent Fix #

New nodes receive the hook from the Radxa golden image. Build and verify that image before flashing it:

mise run provisioning:build
mise run provisioning:verify provisioning/artifacts/<release-id>.img.xz

For an existing node that cannot yet be replaced, install the hook manually:

sudo tee /etc/initramfs-tools/scripts/local-premount/nvme-rescan << 'EOF'
#!/bin/sh
PREREQ=""
prereqs() { echo "$PREREQ"; }
case "$1" in prereqs) prereqs; exit 0;; esac

if [ -e /sys/class/nvme/nvme0 ] && [ ! -b /dev/nvme0n1 ]; then
    echo "NVMe rescan..."
    echo 1 > /sys/class/nvme/nvme0/rescan_controller
    for i in 1 2 3 4 5; do [ -b /dev/nvme0n1 ] && break; sleep 1; done
fi
EOF
sudo chmod +x /etc/initramfs-tools/scripts/local-premount/nvme-rescan
sudo update-initramfs -u -k all

Affected Hardware #

  • Drive: Crucial CT1000P310SSD8 (firmware VACR001)
  • Board: Rock 5B+ (Armbian, kernel 6.1.115-vendor-rk35xx)

Persistence #

The hook survives kernel upgrades via:

  • Existing nodes: the manual installation updates every installed initramfs.
  • New nodes: the hook is baked into the Armbian image under provisioning/armbian-build/userpatches/, and the image customisation step rebuilds every installed initramfs. mise run provisioning:verify checks both the executable rootfs hook and its embedded initramfs entry before the image can be flashed or distributed.
Skip to content Close