Would like to clone the Manjaro SD card

With the original Raspberry OS you can clone the SD card on the Raspberry itself:
OS mini SD card stays in the Raspberry and the SD mini SD card to be cloned to is plugged into the USB port.
Click on the clone command in the Raspberry OS menu - wait - that’s it.

Does this also work in Manjaro for Raspberry?
If yes, how?

Greetings
Karl

You cannot directly clone a running system, as a running system will always write something in logs or system files.

I don’t know what the Raspberry Pi OS clone application does, but whatever it is, it won’t be as good as a direct DD clone of the SD card.

if you use rsync you can “clone” from running system:
the microsd must be formatted with 2 partitions FAT and ext4.

this is FAT partition (/boot)

rsync -aAXHv --delete /boot/* /media/$USER/$label/

sync

this is ext4 partition

rsync -aAXHv --delete --exclude={/boot/,/dev/,/proc/,/sys/,/tmp/,/run/,/mnt/,/media/,/lost+found,/var/cache/pacman/pkg/*} / /media/$USER/$label/

sync

$label is
BOOT_MNJRO for /boot
ROOT_MNJRO for /

rsync is more like a backup, not a clone. :slight_smile:

Hi @enrico20026, sorry to sort of hijack the topic but is it possible to use this sequence of commands you suggested in order to have an usable backup to recover to another sd card if needed?

I mean, I have a stable running system and I’d like to have an image of this system ready so that I may just burn it to a new sd card if goes wrong the one I’m using now.

Would this work? Thanks in advance.

before run rsync i have to format FAT and ext4 (and label), but yes, with this system i can create a usable microsd running same system on another machine or in the same machine if the system crash after an update.
the advantage is not to rewrite the backup, dd rewrite any byte, rsync write new, and delete if is not on the system.

1 Like

You would have to edit the boot script and fstab, when you do it this way, since the partition UUID’s have changed.

2 Likes

This can help?

1 Like

Thank you for the help, @Strit and @enrico20026.

I’ll do a couple of tests and try that on a spare sd card I have here and see if it boots.

if you boot with microsd backup plugged on usb 2.0, maybe /boot will be mounted from backup :slight_smile:
check with lsblk maybe this behaviour is related with eeprom