Rock pi 4 emmc back up

I updated the script, please download it again.

Thank you for helping to find the bug.

This is because -e option was added in the previous version. I provided this parameter when I tested it.

However, if this parameter is not specified when running it, it will add an extra \(backslash) to rsync and cause a bug.

Hi setq,
Thank you for your response.
I used emmc to sd card bakup.
Now also i am getting same error.
mount sd card in /run/media location.
Can you possible give command for taking backup emmc to sd card ?

Thanks & Regards
Vasu

rock@rockpi:~ $ sudo mount /dev/sda /mnt # sda is USB flash disk
rock@rockpi:~ $ sudo ./rockpi-backup.sh -o /mnt/backup.img -e /mnt
rock@rockpi:~ $ ls -lh /mnt/backup.img
-rw-r–r-- 1 root root 8.7G Nov 15 14:46 /mnt/backup.img
rock@rockpi:~ sudo dd if=/mnt/backup.img of=/dev/sdb status=progress # sdb is sd card
rock@rockpi:~ sudo umount /mnt
rock@rockpi:~ sudo mount /dev/sdb5 /mnt
rock@rockpi:~ sudo nano /mnt/etc/fstab # change mmcblk1p4 to mmcblk0p4
rock@rockpi:~ sudo umount /mnt
rock@rockpi:~

Plug in sd card and restart to verify the backup was successful.

Hi setq,
I used emmc 16gb back up to sd card 16gb.
I am getting error.

  root@rock:/home/rock# sudo ./rockpi-backup.sh -o /mnt/backup.img -e /mnt

Welcome to rockpi-backup.sh, part of the Rockpi toolkit.

Enter rockpi-backup.sh -h to view help.
For a description and example usage, see the README.md at:
https://rock.sh/rockpi-toolbox


dd: failed to truncate to 9644802048 bytes in output file ‘/mnt/backup.img’: File too large

Hi setq,
Stills issue is there this is emergency for production.
How to solve the issue ?
sudo ./rockpi-backup.sh -o /mnt/backup.img -e /mnt //got error

sent 1,181,637,806 bytes  received 632,767 bytes  4,260,434.50 bytes/sec
total size is 1,179,202,064  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196)       [sender=3.1.2]

Thanks & Regards
Vasu

I’ll take a look now.

Any update on this.

I’m sorry, but I had some other work yesterday. I’ll take care of it today.

Thank you for your reply.

I updated the script, please download it again and try it.

Hi setq,
Sorry for the late reply.
Thank you for your response.
Now back is working image also created.
Back up image flashed with sd card.
See /dev/root 2.2G 2.0G 67M 97% / but sd card size 16gb .

           Filesystem      Size  Used Avail Use% Mounted on
           /dev/root       2.2G  2.0G   67M  97% /
           devtmpfs        1.9G     0  1.9G   0% /dev
           tmpfs           1.9G     0  1.9G   0% /dev/shm
           tmpfs           1.9G  700K  1.9G   1% /run
           tmpfs           5.0M     0  5.0M   0% /run/lock
           tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
           /dev/mmcblk0p4  100M   38M   62M  38% /boot
           tmpfs           382M     0  382M   0% /run/user/0

How to expand /dev/root partition ?

Thanks & Regards
Vasu

After entering the system, execute

sudo ./rockpi-backup.sh -t expand

1 Like

Hi setq,
Thank you for spending your valuable time to solve the issue.
Now your script working fine.

Thanks & Regards
Vasu

You’re welcome. It’s my job.

Can a script be made to backup a micro-sd card with a card reader with a Linux OS on that you can run on a PC Linux OS perhaps that only backup used space?
It would be very useful since using the dd command takes 64GB space to backup a 64GB micro-sd card.
Some OS’s like LibreELEC also doesn’t have the same UI as Ubuntu so it’s not possible to run a script directly on these OS’s from a micro-sd card and a PC script would be useful in such a case.