Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Armbian rpi-clone script

Featured Replies

I need to clone a bigger (almost empty) sd card to a smaller one.

I use rpi-clone on RPIs but since armbian has a single partition rpi-clone (or its forks) doesn't seem to work :-/

 

https://github.com/billw2/rpi-clone.git

https://github.com/KoljaWindeler/pi-clone

https://github.com/wbphelps/rpi-clone-wm.git
 

Has anybody used successfully rpi-clone or other similar scripts on armbian?

 

What is the best way for creating the smallest img files possible?

 

With my RPIs I clone SDs to smaller ones, then I "zerofree" the created card and I backup it to an image file.

I'm currently using this software on Windows which creates compressed img files so that I have no need of zipping files,

but there might be better options out there... Please share with me your experiences about efficient (and possibly fast) backups.

 

Thanks,

V.

  • Author

That's great Igor,

thank you so much, it will be really a useful script to use from now on.

 

For the raw image, since the BPIs have the SATA drive, is it fine to simply use DD?

sudo dd if=/dev/mmcblk0 of=/mnt/sda1/SD_Backups/BPiArmbian.raw

 

I'm trying it for the first time, is there a way with dd to copy only the used part of the SD,

to speed up the process?

 

Thanks again,

V.

  • Author

Hello Igor, I had problems trying to use your function shrinking_raw_image () directly on the Armbian release I'm using.

 

So I tried copying the partition as you suggested but the "cloned" card did not boot.

I used some instructions I found on the web to extract the bootloader from the MBR backup

#Backup MBR
dd if=/dev/mmcblk0 of=/usr/local/sbin/mbr_sdcard.img bs=512 count=1
#Restore Bootloader
dd if=/usr/local/sbin/mbr_sdcard.img of=/dev/sdd bs=446 count=1

According to what I understood Armbian SD card consists only of bootloader MBR and the ext4 partition. Am I correct?

 

Besides the former commands I did the following: created a single ext4 partition on an external sdcard, mounted it to /mnt/sdd1 and rsynced the contents from mmcblk0 to sdd1. This is more or less the sequence of actions used by rpi-clone scripts.

 

Am I missing something?

This scripts is designed to work with images. So it's only an example / idea , not for direct usage in your scenario.

 

I am not sure that bs=512 is enough. It's different for each board architecture so double check.

 

This is how we write it Allwinner:

 

dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8

 

Yes, armbian has only one ext4 partition.

  • Author

Hello Igor I tried without success but at the end I found a solution (sort of).

I restored a clean Armbian raw image to my sd and then zeroed it

and used rsync to backup my original sd to the smaller one.

Rsync took less than 2 minutes (2Gb of data on my SD) and I now have a compressed raw of 1.3GB!

 

Not the ideal solution but it's a good compromise at least.

 

Thanks and have a nice day,
V.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.