Migration from i.MX8MPlus to A311D

Correct, my SSD (nvme0n1) has no /dev; it is the /home drive, mounted at boot time. It has never been a boot drive.

The EMMC device on my new A311D board, mmcblk1, has no partition according to parted.

root@pix:~# parted /dev/mmcblk1
GNU Parted 3.6
Using /dev/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Error: /dev/mmcblk1: unrecognised disk label
Model: MMC AJTD4R (sd/mmc)                                                
Disk /dev/mmcblk1: 15.6GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 
(parted) ^C              

Then there are the other two devices, mmcblk1boot0 and mmcblk1boot1, also not partitioned according to parted. They’re only 4MB each. “Unrecognized disk label”.

It would’ve been useful if you had described your setup. There are a hundred different ways to set up an OS and unsurprisingly, reform-emmc-bootstrap cannot know of them all but is limited to a few common cases.

So where is/was your root filesystem located?

Yes, seems that way. We already saw that in the lsblk output earlier.

Those are irrelevant for you. That’s where (in case of a311d) u-boot gets flashed to and those two partitions will always be there independent on what dos or gpt partitioning layout you write to the main device.

To help you migrate we need to know what your original setup was.

Out of the box stock Pocket Reform with i.mx8m+, on which I’d edited /etc/fstab to mount the SSD on /home. Unfortunately I did not note the device layout, but I had not modified it except the /home business.

Now knowing that the two mmcblk1boot* drives are the u-boot stuff, I can ignore them; partition /dev/mmcblk1 as / and /boot, and probably proceed from there.

I’m sorry to drag this out like this, but I could not find anything describing the block device layout or intent. I read about u-boot but I’d not seen any description of how they appear in the system (if at all).

I reinstalled the i.mx8m+ board, and did lsblk. Here it is:

tomj@pox:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk2      179:0    0 116.6G  0 disk 
├─mmcblk2p1  179:1    0   488M  0 part /boot
└─mmcblk2p2  179:2    0 116.1G  0 part /
nvme0n1      259:0    0 931.5G  0 disk 
└─nvme0n1p1  259:1    0 931.5G  0 part /home
mmcblk2boot0 179:256  0     4M  1 disk 
mmcblk2boot1 179:512  0     4M  1 disk 
tomj@pox:~$ 

OK I’m up and running. The process, in the end, was extremely simple:

  • Download pocket-reform-system-a311d.img
  • dd microSD card with that image.
  • Swap in A311D board.
  • Install microSD and boot from it.
  • Copy the image file to a USB stick. Insert and mount USB stick on /mnt.
  • dd the USB image file to /dev/mmcblk1.
  • Done.
  • Edit /etc/fstab to mount /dev/nvme0p1 onto /home.

I was under the impression the u-boot stuff was entangled with the mmcblk1 block device, I think because the only mentions of u-boot implied or stated it was on the EMMC and I was afraid of soft-bricking it, and I could find no block device descriptions.

I’m really sorry it took so many go-rounds. A rough description of the boot process and block device layout would have helped me.

I usually try to run my computers with absolute minimum changes to systems without good reason otherwise, consistent with top reliability.

And thank you for your patience.

1 Like

This is what the script reform-flash-rescue does. But that script does a few more things for you which just dd-ing the image to eMMC is not doing:

  • parted --script --machine /dev/mmcblk1 resizepart 2 100%
  • resize2fs -p "/dev/mmcblk1p2"

This grows the partition of the root fs to fill all of eMMC.

  • e2label /dev/mmcblk1p1 reformemmcboot
  • e2label /dev/mmcblk1p2 reformemmcroot

This changes the labels of both partitions on eMMC to be different from the disk labels on the SD-card or otherwise your system might accidentally try to mount the rootfs from the wrong flash medium.

  • reform-boot-config --emmc emmc

Configure /etc/fstab and rebuild the initramfs on /boot on eMMC to boot your system on eMMC instead of the one on your SD-card.

I see. I had assumed that you were in the same situation as OP and wanted to migrate your encrypted system from your SSD from i.MX8M+ to A311D. I had not expected that you actually… did not want to migrate your system. :laughing:

Anyways, I am happy it works for you now!

I had done the resize…

But given all of this, I started over – dd’d the image to sd, booted from that, ran reform-flash-rescue, clicked Y at the warnings, and it completed without error, and works as expected.

I manually added my nvme as home, that’s the only manual effort.

I likely misread the docs; I was initially trying to use reform-emmc-bootstrap, when it was reform-flash-rescue that I needed. With that, success.

And I should have started a new thread, sorry for the OT thread hijack.

1 Like