The basic idea is to use dd to read the eMMC, and save it to a file. To image the eMMC, it's best to boot from a SD image, so you don't have to deal with issues from backup up a "live" system. When you boot from the microSD, the eMMC is visible as /dev/mmcblk1. You'll want some progress whilst copying, and you'll probably want to compress the file so you don't have a 16GB file which really only has around 3GB of stuff in it. Hence the use of gzip, as it'll compress stuff a bit, and also ignore all the empty space.
So you could do something like this (where /media/pine64/64GB_USB3 was the mount folder for my usb drive, and eMMC_backup.img.gz was the name I chose to save the file as):
But we can do better than that. gzip is a bit slow still, it only uses one of the four pinebook cpu cores, which seems a bit of waste, as that wil make it so the copy will take a quite a long time. pigz, on the other hand, is a gzip compatiable compressor with a difference... it will use all the cpu cores available. Consequently a 2516 second transfer instead took 970 seconds, just by switching to pigz. And is even faster if the --fast parameter is used, still with light compression and no storage of empty space benefits. So my prefered option, after doing a sudo apt install pigz to install it, is the following:
And to restore the backup? The traditional:
or the much faster:
should do the trick. However, since the of parameter of good 'ol disk destroyer is being used here... make sure you don't type this one wrong.... as you might find yourself writing the image to the wrong drive with disasterous consequences!
And as a side note, as the OP found out, if you are using NTFS formatted drives, ntfs-3g isn't installed by default, so a quick sudo apt install ntfs-3g is needed to enable NTFS write support.
So you could do something like this (where /media/pine64/64GB_USB3 was the mount folder for my usb drive, and eMMC_backup.img.gz was the name I chose to save the file as):
Code:
dd status=progress bs=512 if=/dev/mmcblk1 | gzip > /media/pine64/64GB_USB3/eMMC_backup.img.gz
But we can do better than that. gzip is a bit slow still, it only uses one of the four pinebook cpu cores, which seems a bit of waste, as that wil make it so the copy will take a quite a long time. pigz, on the other hand, is a gzip compatiable compressor with a difference... it will use all the cpu cores available. Consequently a 2516 second transfer instead took 970 seconds, just by switching to pigz. And is even faster if the --fast parameter is used, still with light compression and no storage of empty space benefits. So my prefered option, after doing a sudo apt install pigz to install it, is the following:
Code:
dd status=progress bs=512 if=/dev/mmcblk1 | pigz --fast > /media/pine64/64GB_USB3/eMMC_backup.img.gz
And to restore the backup? The traditional:
Code:
gunzip -c /media/pine64/64GB_USB3/eMMC_backup.img.gz | dd of=/dev/mmblk1 bs=512 status=progress
or the much faster:
Code:
pigz -d -c /media/pine64/64GB_USB3/eMMC_backup.img.gz | dd of=/dev/mmblk1 bs=512 status=progress
should do the trick. However, since the of parameter of good 'ol disk destroyer is being used here... make sure you don't type this one wrong.... as you might find yourself writing the image to the wrong drive with disasterous consequences!
And as a side note, as the OP found out, if you are using NTFS formatted drives, ntfs-3g isn't installed by default, so a quick sudo apt install ntfs-3g is needed to enable NTFS write support.