rpi-clone icon indicating copy to clipboard operation
rpi-clone copied to clipboard

Clone without unmounting 3rd partition

Open jonferreira opened this issue 6 years ago • 2 comments

Noob here to excuse me if it's a stupid question.

I'm following steps (7) to backup my RPI into a USB flash drive with 3 partitions: boot, root and data (which is supposed to be left untouched)

I've followed the instructions to initialise the USB so that it matches the SD card

image

Used fdisk to create the partitions, set the right type and then

mkfs -t vfat -F 32 /dev/sda1 mkfs.ext4 /dev/sda2 mkfs.ext4 /dev/sda3

While it "works" OK while I don't have sdb3 mounted, if I do have it mount (which I'll need to) then it fails immediately with

"Destination disk partition /dev/sdb3 is mounted on /mnt/tmp. The clone cannot proceed unless it is unmounted."

My understanding was that sdb3 was supposed to be left alone?

jonferreira avatar Jan 22 '19 17:01 jonferreira

OK I've edit the script as follows to only check for mount on partition 1 and 2

dst_mount_table=$(findmnt -o source,target -n -l \ | grep "^/dev/${dst_disk}1\|^/dev/${dst_disk}2" | tr -s " ")

jonferreira avatar Jan 24 '19 15:01 jonferreira

This should consider as fix. There is not need to check for sdX3. I having same issue. Thanks for the temporary fix

tyjtyj avatar Feb 10 '20 04:02 tyjtyj