Hugo Cardozo Posted July 1, 2017 Posted July 1, 2017 From time to time I want to change the SDcards on my boards, for one reason or another. So, in order to transfer the Armbian filesystem I dd from the first sdcard and later dd to the second, a very slow process. I think it would be faster to: Partition and mkfs the new sdcard Copy/tar/rsync the armbian filesystem But no board won't boot that sdcard. So I'm missing a crucial step, maybe it has something to do with u-boot?
martinayotte Posted July 1, 2017 Posted July 1, 2017 Yes ! Your second card doesn't have u-boot ! You should do a 'dd' between cards but only the first 1M. Then, with 'fdisk' on the new card, delete partition and re-create it to match size of the card, followed with 'mkfs.ext4' for reformatting. After that, you can tar or rsync the rootfs filesystem. 1
Eduardo Claro Posted July 4, 2017 Posted July 4, 2017 On 7/1/2017 at 0:57 PM, martinayotte said: Yes ! Your second card doesn't have u-boot ! You should do a 'dd' between cards but only the first 1M. Then, with 'fdisk' on the new card, delete partition and re-create it to match size of the card, followed with 'mkfs.ext4' for reformatting. After that, you can tar or rsync the rootfs filesystem. Hi martinayotte, I am new to Orange Pi (mine is OPi Zero), just installed some times and played with it. Now I have it well configured and want a backup that works. I am trying to perform a backup to a img bootable file. Based on your comment here and other findings in the Internet, I was able to do the following steps: - Created an empty image (3G size). - Copied the first 1M from the original Orange Pi image to my backup image. - Mounted the backup image in loopback and used parted to remove the original partition (about 1.4G) and created a new one (with 3G). To do this, my new image started exactly at 4194304 bytes as the original. - Remounted in loopback the created partition and formatted it with mkfs.ext4. - Mounted the partition and copied all files from my OPi to the image. - Dismounted. Burn the img file to a new SD Card. After all these steps, I was able to read the SD Card content in another Linux distribution. But when I put this SD Card into OPi, it does not boot at all. It seems to be booting, but falls in a never-ending loop. I cannot connect to the OPi with this SD Card created from my backup. Any clue what I am missing?
Hugo Cardozo Posted July 8, 2017 Author Posted July 8, 2017 On 1/7/2017 at 11:57 AM, martinayotte said: Yes ! Your second card doesn't have u-boot ! You should do a 'dd' between cards but only the first 1M. Then, with 'fdisk' on the new card, delete partition and re-create it to match size of the card, followed with 'mkfs.ext4' for reformatting. After that, you can tar or rsync the rootfs filesystem. Yes, it worked that way, with some extra work: For some reason, Armbian couldn't boot my ext4-formatted SDcard (I formatted it on a Debian 9 PC, maybe it has something to do with it?) So I've formatted again using ext3 Edit /boot/armbianEnv.txt and /etc/fstab to change root filesystem UUID value, and to change "ext4" for "ext3" in fstab
zador.blood.stained Posted July 8, 2017 Posted July 8, 2017 19 minutes ago, Hugo Cardozo said: For some reason, Armbian couldn't boot my ext4-formatted SDcard (I formatted it on a Debian 9 PC, maybe it has something to do with it?) So I've formatted again using ext3 U-boot doesn't support certain ext4 features enabled in newer Debian versions by default, so additional flags should be passed to mkfs.ext4
Hugo Cardozo Posted July 14, 2017 Author Posted July 14, 2017 May I ask which flags? "metadata_csum", for example?
zador.blood.stained Posted July 14, 2017 Posted July 14, 2017 40 minutes ago, Hugo Cardozo said: May I ask which flags? "metadata_csum", for example? -O ^64bit,^metadata_csum,uninit_bg according to tests made some time ago
trohn_javolta Posted October 5, 2017 Posted October 5, 2017 Reading this thread it sounds quite complicated to restore armbian. The way I did it with other operating systems is: Prepare a new sd card with the newest armbian install and restore a previously made rsync backup to it. I don't quite remember the details on which option(s) I used to restore the rsync backup. So is this bad practice? 'Cause it always worked, and seems faster and easier to me than dd'ing only the first bit from the old sd card (what if that sd card is faulty?), reformat and resize a partition and change files in armbianEnv.tx and fstab. I think if I did a restore to a larger sd card I resized the new card after the restore.
Recommended Posts