Armbian OS – Backing up eMMC/NAND (Via GUI)

Backing up if you are using eMMC/NAND for booting/running Armbian OS

These instructions are for those whom are running Armbian from an internal eMMC storage and wish to make a backup image. If you are wanting to make an image of a SD Card/USB stick, then please look at this document here.

Because of the length of some of the commands used in this process, I would suggest either opening this page on your TV box when performing this OR use Microsoft Remote Desktop (RDP)/VNC from another machine with this open, where you can copy/paste the text over. 

UNIX commands are CAPS specific, so must be typed exactly as shown, because “command“, “COMMAND” and “CoMManD” would try to run 3 different programs, not the same one like Windows would (which is why I suggest you copy/paste commands out of this document).

You will need the following to do this

Option A – (Perform ALL steps below) Either a blank SD card with enough space to make a copy of your eMMC/NAND Armbian installation AND your original Armbian image file you used that matches what you have installed on your eMMC/NAND.

Option B – (Perform Step 3 onwards from Below) Your original, still imaged Armbian SD card with enough space to make a copy of your eMMC/NAND Armbian installation.

So if you have 18GB of data on your eMMC/NAND, you would need a 32GB or larger SD card.

Performing the backup (GUI BASED)

1) With your Backup SD card, complete steps 1 to 8 of the Armbian Installation, using your original Armbian Image file that matches your Armbian version installed on your eMMC/NAND.

2) When thats completed, edit your uEnv.ini and extlinux.conf files to use the correct DTB file for the TV box you will use this card in as detailed here.

3) Log into your Armbian TV box as the root account.  

This is CRITICAL for the instructions I am giving you to work and allowing me to keep the instructions simple.

4) On your booted/running Armbian TV box, go to Applications > Settings > Removable Drives and Media and ensure you are set to Mount removable drives and Mount removable media. If this option isn’t there on your Armbian version, you will need to manually mount your Backup SD Cards partitions at the terminal by making a mount point in your /media folder and using the mount command.

5) Put your Backup SD card into your booted/running Armbian TV box.

6) You should see BOOT and ROOTFS appear on your desktop. In the BOOT volume, delete the “System Volume Information” folder thats been created by Windows, as per the instructions here.

7) Now open Applications > System > Gparted.

8) In Gparted, select the Backup SD card. The correct partition labels for the Backup SD card will be BOOT and ROOTFS.

If you see BOOT_EMMC and ROOT_EMMC, then you are on the wrong drive.

9) When you have selected the Backup SD card, right click on the ROOTFS partition and select Delete.

10) Next, click on the Unallocated space, right click and select New.

11) Click Add then click the Green tick button to apply the changes. Ensure its set to ext4 as the file system and in the label box, type ROOTFS

ROOTFS MUST be typed in ALL CAPS – Its CRITICAL for the instructions I am giving you to work correctly.

12) Click Add then click the Green tick button to apply the changes. One applied, close Gparted.

13) Its possible that you might now end up with 2 mount points in the /media folder, under the name of root (/media/root/ROOTFS and /media/root/ROOTFS1), because its detecting the newly formatted partition as an entirely new partition separate to the one it had mounted prior. With your Backup SD card in your box, you can browse over to /media/root/ to look inside that folder and check if you have two ROOTFS mount points. If this has occurred, physically eject your Backup SD card from your Box, open a terminal Applications > Terminal Emulator and type:

cd /media

Make sure you have moved into this folder before you run the next command, or you may delete a system folder.

rm -rf root

This will delete all your root user account’s mount points if you have any, which is very unlikely, but if you have created some, I assume you know how to clear this area down.

After this, you can put the Backup SD card back in your TV Box.

14) Open a Terminal window Applications > Terminal Emulator.

15) Enter the following command and wait for it to complete:

rsync -arlthD --info=progress2 --delete --exclude={/boot/*,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,*thinclient_drives} / /media/root/ROOTFS/

16) Enter the same command AGAIN and wait for it to complete (it should be quick this time, like 1 minute or less):

rsync -arlthD --info=progress2 --delete --exclude={/boot/*,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,*thinclient_drives} / /media/root/ROOTFS/

17) Enter the following commands

sudo geany /media/root/ROOTFS/etc/fstab

18) Change the following in the fstab file and save it. You will have 3 lines you want to comment out with a hash # 




And you will want to copy the below in.

LABEL=ROOTFS / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
LABEL=BOOT /boot vfat defaults 0 2
tmpfs /tmp tmpfs defaults,nosuid 0 0

These are important, without them, you may just end up with a black screen on boot. You can always boot to the emmc and re-edit this on the /media/root/ROOTFS/etc/fstab 

If you dont change these, the automated routine to copy the SD card to eMMC/NAND will not work properly, should you ever use it in the future.

19) Close Geany and unmount the disks (right click on their icons on the desktop to unmount)

20) Log out as the root user OR shut down your system 

Your Backup SD card is now ready and you can boot from it on whatever system you have configured the DTB files for. Just remember to not leave it in your TV Box it it will boot from that and not your eMMC/NAND.

How can I confirm Ive booted from my Backup SD card?

The mounted/mountable drives on your desktop will be labeled BOOT_EMMC and ROOT_EMMC when you are booting from your SD card, and called BOOT and ROOTFS when you are booting from your eMMC/NAND.

What have we actually just done?

This process will copy your emmc/NAND Armbian OS over the destination Backup SD card’s partition. On the Backup SD card, it will delete, create, update files with permissions etc, as needed until you have a copy of what is on your eMMC/NAND. So in effect, you will have a 1-2-1 copy of the operating system on your eMMC/NAND, just without the BOOT partition, which we created by imaging the SD card in the first place.

What can I do with my imaged SD card?

This Backup SD card used on your current system or a new destination system (if you have changed the DTB files to the correct ones).

Can I use either of the above processes to copy my Armbian installation over to an SSD for booting on the USB 3 port of my system?

Yes, these processes can be used for that purpose.

Armbian Tech Guides

0 0 vote
Article Rating
Read Previous

Armbian OS – Backing up an SD Card/USB Stick

Read Next

Armbian OS – Backing up eMMC/NAND (Via CLI)

Inline Feedbacks
View all comments
error: Content is protected !!
Would love your thoughts, please comment.x