Jump to content

How to backup/transfer Armbian filesystem?


Hugo Cardozo

Recommended Posts

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:

  1. Partition and mkfs the new sdcard
  2. 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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines