LePotato and NanoPi Neo Plus2 Goodness

LePotato and NanoPi Neo Plus2 Goodness

Move OS to the NanoPi Neo Plus2 8GB emmc:

Get an Armbian Image for the NanoPi and boot it from the microSD. After initially configuring, run /sbin/nand-sata-install. Follow the prompts to copy the root filesystem to the emmc. Remove the SD card.

Installing DietPi to the 8GB eMMC flash on the NanoPi:

Booted into Armbian on the internal SD card and put The dietPi image in a USB to microSD dongle. The DietPi image was small, so I chose to create an fsarchiver image of it on the Armbian filesystem temporarily. This may or may not work for you if you don’t have enough space on the booted OS in the internal microSD card.

Use fdisk to see where the external microSD is and the eMMC. For me it was the following:

# fdisk -l
Disk /dev/mmcblk2: 7.28 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbc471ea2

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk2p1       8192 15106047 15097856  7.2G 83 Linux


Disk /dev/sda: 14.63 GiB, 15707668480 bytes, 30679040 sectors
Disk model: microSD RDR
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x74239350

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        8192 30343168 30334977 14.5G 83 Linux


Disk /dev/mmcblk0: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6337f038

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       2048 31110143 31108096 14.8G 83 Linux
#

It translated to this:

/dev/mmcblk0p1 — The Internal microSD Armbian boot device.
/dev/sda1 — The SD card with a DietPI image on the microSD
/dev/mmcblk2p — The eMMC (7.28 GiB)

Now create a fsarchiver backup of the DietPi image on /dev/sda1

# fsarchiver savefs -A -j4 -o /DietPi.fsa /dev/sda

Create a new ext4 partition on the eMMC drive using fdisk

# fdisk /dev/mmcblk2

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/mmcblk2: 7.28 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbc471ea2

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk2p1       8192 15106047 15097856  7.2G 83 Linux

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-15269887, default 2048): 8192
Last sector, +/-sectors or +/-size{K,M,G,T,P} (8192-15269887, default 15269887):

Created a new partition 1 of type 'Linux' and of size 7.3 GiB.

Command (m for help): p
Disk /dev/mmcblk2: 7.28 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbc471ea2

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk2p1       8192 15269887 15261696  7.3G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
# 

Format the eMMC partition

# mkfs -t ext4 /dev/mmcblk2p1

Restore the fsarchiver image to the new partition:

# fsarchiver restfs /DietPi.fsa id=0,dest=/dev/sdb2

* files successfully processed:....regfiles=59379, directories=6999, symlinks=5774, hardlinks=331, specials=80
* files with errors:...............regfiles=0, directories=0, symlinks=0, hardlinks=0, specials=0

Finally -run nand-sata-install to get the boot record on the eMMC:

# /sbin/nand-sata-install

Once you say yes, it will execute and exit. Now poweroff, removed the SD cards, and see if it works!

# poweroff  

Unplug the nanoPi and Plug it back in. Hopefully it worked! Remember – the root password may be different now since you’re booting off the internal eMMC with DietPi

 

0