Cloning SDcard with rpi-clone shows errors

In order to move to an RPi3B system I have tried to make a clone SDcard on an RPi2B running the latest version of OSMC with the rpi-clone program available via git.
I use the following command after first:

  • Shutting down Kodi: systemctl stop mediacenter
  • Plugging in the USB carrier of the clone target SDcard
  • Unmounting the automounted partitions on sda (I am using a SDcard used on a RPi before)
  • Using fdisk to remove the partitions on /dev/sda

Then I call rpi-clone like this: sudo rpi-clone -f /dev/sda

Now there are some user input acknowledging allowing reformatting the target drive etc.
After this the process starts and seems to go normally for 8 minutes or so.
But then I get a bunch of errors concerning the /boot partition…

What does this mean for the functioning of the cloned backup SDcard?

Sample of the output (I cut away a lot of similar looking lines):

Syncing file systems (can take a long time)
Syncing mounted partitions:
  Mounting /dev/sda2 on /mnt/clone
  => rsync // /mnt/clone with-root-excludes ...
  Mounting /dev/sda1 on /mnt/clone/boot
  => rsync /boot/ /mnt/clone/boot  ...rsync: chown "/mnt/clone/boot/." failed: Operation not permitted (1)
rsync: readdir("/mnt/clone/boot/."): Input/output error (5)
rsync: chown "/mnt/clone/boot/bcm2708-rpi-b-plus.dtb" failed: Operation not permitted (1)
rsync: chown "/mnt/clone/boot/bcm2708-rpi-b-rev1.dtb" failed: Operation not permitted (1)
rsync: chown "/mnt/clone/boot/bcm2708-rpi-b.dtb" failed: Operation not permitted (1)
rsync: chown "/mnt/clone/boot/bootcode.bin" failed: Operation not permitted (1)
rsync: chown "/mnt/clone/boot/config-user.txt" failed: Operation not permitted (1)
rsync: chown "/mnt/clone/boot/dtb-5.10.32-2-osmc" failed: Operation not permitted (1)
IO error encountered -- skipping file deletion
rsync: chown "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays" failed: Operation not permitted (1)
rsync: chown "/mnt/clone/boot/overlays" failed: Operation not permitted (1)
rsync: mkstemp "/mnt/clone/boot/.LICENCE.broadcom.QLeAbe" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.System.map-5.10.32-2-osmc.WM1Rim" failed: Read-only file system (30)
.......
rsync: mkstemp "/mnt/clone/boot/.bcm2837-rpi-3-b.dtb.i0JmtF" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.bcm2837-rpi-cm3-io3.dtb.TrDKfT" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.cmdline.txt.sqAvH6" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.config-5.10.32-2-osmc.vkPM4i" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.config.txt.0OjSQv" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.fixup4x.dat.pYWyFI" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.fixup_x.dat.ONlTDX" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.install.log.1qf1Cc" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.kernel.img.K6VpEr" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.start4x.elf.taJXdj" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.start_x.elf.SJ9imi" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/.vmlinuz-5.10.32-2-osmc.wpFdFo" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/.bcm2708-rpi-b-plus.dtb.AoYjO4" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/.bcm2708-rpi-b-rev1.dtb.4KEzzM" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/.bcm2708-rpi-b.dtb.aHh9lu" failed: Read-only file system (30)
......
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays/.vga666.dtbo.yJ0IV6" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays/.w1-gpio-pullup.dtbo.eOSA66" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays/.w1-gpio.dtbo.ShU2g7" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays/.w5500.dtbo.Wkp0q7" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays/.wittypi.dtbo.OzZ3E7" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/dtb-5.10.32-2-osmc/overlays/.wm8960-soundcard.dtbo.SUVuR7" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.README.6WFx37" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.act-led.dtbo.jb3sRv" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.adafruit18.dtbo.kTqrDT" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.adau1977-adc.dtbo.xh3Jsh" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.adau7002-simple.dtbo.EQkMkF" failed: Read-only file system (30)
.....
rsync: mkstemp "/mnt/clone/boot/overlays/.w5500.dtbo.34UOPr" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.wittypi.dtbo.ovyUV5" failed: Read-only file system (30)
rsync: mkstemp "/mnt/clone/boot/overlays/.wm8960-soundcard.dtbo.NXDs1J" failed: Read-only file system (30)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]


===============================
Done with clone to /dev/sda
   Start - 23:42:51    End - 23:52:01    Elapsed Time - 9:10

Cloned partitions are mounted on /mnt/clone for inspection or customizing.

You should probably contact the developer of this application.

It isn’t related to OSMC.

They are performing filesystem level backups instead of block level backups and then resizing the filesystem. I’m not sure why they are doing this and don’t recommend this approach.

The permission errors are expected for the FAT32 based boot partition.

Your process of just stopping Kodi does not guarantee filesystem integrity

OK, I have used this in the past to clone RPi disks (live) but I will stop that now.
Instead I pulled the OSMC SDcard out and attached it to one of my RPi4 using a USB SDcard reader.
Then I also plugged in the target SDcard using another USB reader.
Finally fired up GParted on the RPi4 and:

  • Erased all partitions on /dev/sdb
  • Copied the partitions on /dev/sda to /dev/sdb
  • Done, took less than 10 minutes.

Then I put the clone back into the RPi2 to verify that it would run on the cloned SDcard and it did!
So the clone is identical to the original.

Case closed! :slight_smile:

You could just have used dd if=source of=destination bs=2048 status=progress

If destination contains data, will that be erased first or will it try to somehow mix the data?

dd will create a bitwise copy of the source data on the destination data, so data will just simply be overwritten. Also this will copy the partition table 1 to 1 means if the destination card is bigger than the source card the partition size of the source card will be used.