How To Move Root Partition From eMMC to SSD

spamsink spamsink at reposit.be
Wed Feb 14 12:06:50 CET 2024


I am running the NanoPi R6C.  The device is not capable of booting from 
the SSD, the next best thing is to load the root filesystem from the SSD.

Using rockchip's repos, I compile from source the images to boot 1) from 
the microSD card and 2) from eMMC.  I install to the eMMC.  Then, so as 
not to mount any partitions from eMMC, I boot from the microSD card, and 
I clone the root partition from the eMMC (/dev/mmcblk2p8) to the SSD 
(/dev/nvme0n1p1).

I boot from the eMMC, the output of "cat /proc/cmdline" is:

storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal 
androidboot.dtbo_idx=0 androidboot.verifiedbootstate=orange 
earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 coherent_pool=1m 
irqchip.gicv3_pseudo_nmi=0 rw root=/dev/mmcblk2p8 rootfstype=ext4 
rootflags=discard data=/dev/mmcblk2p9 consoleblank=0 
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 
androidboot.fwver=uboot-a83a7263ef-01/09/2024

How do I change "root=/dev/mmcblk2p8" to "root=/dev/nvme0n1p1"?

I connect to the serial port and get to the U-Boot monitor.  I examine 
the variables.  "bootcmd" runs "bootrkp" which boots the system.  
"bootrkp" ignores "bootargs", I confirm this by deleting "bootargs" 
before running "bootrkp", the system boots up as before with no change 
in behavior.  "bootrkp" is implemented in file "cmd/bootrkp.c".  That 
code emits the equivalent of:

setenv bootm-no-reloc y
booti 0x400000 0xa200000:0x7b2bc0 0x8300000

Can I tell U-Boot to load the root partition from /dev/nvme0n1p1, either 
by entering commands at the monitor, or by modifying the source code of 
U-Boot, or through any other means?

Regards,
Eric



More information about the U-Boot mailing list