Deleted the emmc partition

To migrate to NVME I did the stupid thing an deleted the partions of the emmc. Is there a way to restore / reflash? I can boot from SD.


no worries, as long as you didn’t delete u-boot on the eMMC boot sector (it takes some effort to do that, though), you can still boot from MicroSD card and use the following part from our factory install script to re-image the eMMC freshly. Copy it to a text file and make it executable (with chmod a+x).

The script requires a few tools, to make sure these are installed, do:

apt install bmap-tools e2fsprogs parted

And here’s the main install script:

echo "Copying MNT Pocket Reform System Image to eMMC..."

sudo bmaptool copy /dev/mmcblk2

echo "System Image copied. Resizing root partition..."

parted /dev/mmcblk2 resizepart 2 100%
sleep 1
e2fsck -fy /dev/mmcblk2p2
resize2fs -p /dev/mmcblk2p2
e2fsck -fy /dev/mmcblk2p2

echo "Relabeling eMMC partitions..."


e2label /dev/mmcblk2p1 $BOOTPART
e2label /dev/mmcblk2p2 $ROOTPART

mount /dev/mmcblk2p2 /mnt

cat << END > "/mnt/etc/fstab"
/dev/mmcblk2p2 / auto errors=remount-ro 0 1
/dev/mmcblk2p1 /boot auto errors=remount-ro 0 1

mount -o bind /dev "/mnt/dev"
mount -t sysfs sys "/mnt/sys"
mount -t proc proc "/mnt/proc"
mount /dev/mmcblk2p1 /mnt/boot
chroot "/mnt" update-initramfs -u

umount --recursive /mnt

echo "Done."

Thanks a lot!!! Worked! Great support!