Erario Posted January 28, 2023 Posted January 28, 2023 (edited) I couldn't find anything on the web, I looked everywhere. With the dd command I can of course create a complete image of the eMMC anywhere, even on a network path, but I can't find anything that allows me to do what the "nand-sata-install.sh" script does, which formats the eMMC and populates it with all the contents of the MicroSD, appropriately adapting some files needed for booting. It would be many useful to be able to do the exact opposite as well, i.e. clone eMMC to MicroSD, which would be useful to have a bootable backup with all the customizations performed on the eMMC, without having to go through the process of creating an image file. I tried modifying the script to do this but could not do it, there is actually an option already there to do this but it doesn't work for me. Surely there is someone better than me, I hope, who maybe has already done this. nand-sata-install.sh Edited January 28, 2023 by Erario
SteeMan Posted January 28, 2023 Posted January 28, 2023 Since you are posting in the TV Box sub-forum, I'm assuming you are talking about a TV Box. But you have't provided any informaion about your setup. What TV Box do you have, what version of Armbian do you have (by version I mean the name of the image you downloaded, and where downloaded from).
Erario Posted January 31, 2023 Author Posted January 31, 2023 (edited) I solved with two scripts, the first one creates a dump to img in mounted Windows filesystem (to be executed only once), the second one keeps the image aligned via rsync as needed. Edited January 31, 2023 by Erario
Erario Posted February 5, 2023 Author Posted February 5, 2023 (edited) Another excellent method that works perfectly is this. The advantage of this script is that it succeeds in copying the entire filesystem to SD or USB drives without performing a mirror clone as with dd, so even if the destination is smaller than the source as long as it has the space needed for the actual space occupied. I had been using it for years on RPI, I didn't think it was compatible with Armbian as well, instead it works great. And by taking the correct version from here is already compatible with Armbian, also acts on correcting UUID on the target device to make it boot correctly after the clone. If it works on my tvbox it will also work on any official Armbian distribution, so on any device... absolutely must have! Booted disk: mmcblk2 63.7GB Destination disk: mmcblk0 31.4GB --------------------------------------------------------------------------- Part Size FS Label Part Size FS Label 1 root 58.7G ext4 -- 1 29.3G ext4 -- --------------------------------------------------------------------------- == Initialize: IMAGE partition table - forced by option == 1 root (6.7G used) : RESIZE MKFS SYNC to mmcblk0p1 --------------------------------------------------------------------------- -e clone fstab edit : edit mmcblk2p device entries to mmcblk0p. Run setup script : no. Verbose mode : no. -----------------------: ** WARNING ** : All destination disk mmcblk0 data will be overwritten! -----------------------: Initialize and clone to the destination disk mmcblk0? (yes/no): y Optional destination ext type file system label (16 chars max): Initializing Imaging past partition 1 start. => dd if=/dev/mmcblk2 of=/dev/mmcblk0 bs=1M count=8 ... Resizing destination disk last partition ... Resize success. Changing destination Disk ID ... => mkfs -t ext4 /dev/mmcblk0p1 ... Syncing file systems (can take a long time) Syncing mounted partitions: Mounting /dev/mmcblk0p1 on /mnt/clone => rsync // /mnt/clone with-root-excludes ... Editing /boot/armbianEnv.txt UUID to use 08477615-e9ee-4faa-8574-d58796f838ad for partition 1 Editing /etc/fstab UUID to use 08477615-e9ee-4faa-8574-d58796f838ad for partition 1 =============================== Done with clone to /dev/mmcblk0 Start - 14:56:29 End - 14:57:55 Elapsed Time - 1:26 Edited February 5, 2023 by Erario
Recommended Posts