Code: Select all
sdclone /dev/sdxJust ignore them. They're harmless. It's just the copy trying to set the ownership and permissions on the files, but the VFAT file system in /boot doesn't support them.PlanB wrote:Thnx for the tip, any idea how to fix the 'operation not permitted' errors?
Code: Select all
sudo ./sdclone /dev/sda /dev/macblk0Shouldn't that be mmcblk0 (not macblk0)?dckornbluh wrote: ↑Sat Dec 15, 2018 11:14 pmThen I used this command:Code: Select all
sudo ./sdclone /dev/sda /dev/macblk0
Code: Select all
sudo ./sdclone /dev/sda /dev/mmcblk0
dckornbluh wrote: ↑Sat Dec 15, 2018 11:14 pmI used sdclone successfully (see github link above) and it got me out of a pickle. I have an RPi model 3A+ which has only one USB port. This enabled me to SSH in and successfully clone the current SD card.
Tips for newbies: use command lsblk which yieldsThen I used this command:
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 7.4G 0 disk
├─sda1 8:1 1 41.8M 0 part
└─sda2 8:2 1 7.4G 0 part
mmcblk0 179:0 0 7.4G 0 disk
├─mmcblk0p1 179:1 0 1.8G 0 part /tmp/tmp.egPTiZW7gf
├─mmcblk0p5 179:5 0 32M 0 part
├─mmcblk0p6 179:6 0 69M 0 part /boot
└─mmcblk0p7 179:7 0 5.6G 0 part /Code: Select all
sudo ./sdclone /dev/sda /dev/macblk0
Code: Select all
sudo ./sdclone /dev/sdaCode: Select all
src=$(mktemp -d)
dst=$(mktemp -d)
Code: Select all
sudo mount $1$pnum $dst
sudo mount /dev/mmcblk0p$pnum $src
sudo cp -axv $src/. $dst/.
sudo umount $dst
sudo umount $src
ObSnarkiness: "man mktemp"The code sets the src and dst variables internally like this:What does this in fact do?Code: Select all
src=$(mktemp -d) dst=$(mktemp -d)
I'm pretty sure the "sudo" is unnecessary. I'm basing this on the fact that most of the script's commands that need it seem to be preceded withsudo ./sdclone /dev/sda
Correct, I just quoted the original suggestion for the command execution, but if I look closer in the script it precedes all such commands with sudo that need elevation.GlowInTheDark wrote: ↑Thu Feb 27, 2020 12:51 amBTW, earlier up in your post, you say:I'm pretty sure the "sudo" is unnecessary. I'm basing this on the fact that most of the script's commands that need it seem to be preceded with sudo on their own, so it shouldn't be necessary to sudo the script itself.sudo ./sdclone /dev/sda
Code: Select all
sdclone /dev/sdaCode: Select all
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 14cd:1212 Super Top microSD card reader (SY-T18) <== My SDcard reader
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL
UUID NAME FSTYPE SIZE MOUNTPOINT LABEL MODEL
sda 7.4G Storage_Device
8139-B4CA ├─sda1 vfat 256M
e31a2667-663c-4715-a994-bb94af77a1b7 └─sda2 ext4 7.2G
mmcblk0 28.9G
69D5-9B27 ├─mmcblk0p1 vfat 256M /boot boot
24eaa08b-10f2-49e0-8283-359f7eb1a0b6 └─mmcblk0p2 ext4 28.7G / rootfs
Code: Select all
cat /etc/fstab
proc /proc proc defaults 0 0
PARTUUID=d9b3f436-01 /boot vfat defaults 0 2
PARTUUID=d9b3f436-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
Code: Select all
cat /mnt/sdroot/etc/fstab
proc /proc proc defaults 0 0
PARTUUID=d9b3f436-01 /boot vfat defaults 0 2
PARTUUID=d9b3f436-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for thatSOLVED!Bosse_B wrote: ↑Thu Feb 27, 2020 9:59 amI just came across this command line rpi-clone on github.
Has someone here tested it and can give feedback?
It seems like it has many features like the ability to be used as a backup function with incremental updates of a base copy where only changed files are transferred.
Maybe this would be a better solution than the script discussed above?
OTOH:
The rpi-clone script is huge and does a lot of different things, maybe "keep it simple, stupid" is a valid comment here?
So... I would run the script like this?mikerr wrote: ↑Wed Apr 12, 2017 10:49 ampicopy ("piclone") isn't the same as dd
dd is a direct byte for byte copy - so resulting .img would be huge, and also can't copy to smaller sd cards
piclone first sets up partitons, then does a file based copy - so can move a 32GB SD card install to 8 GB etc..
In the github for piclone, there is the original command line script here:
https://github.com/raspberrypi-ui/piclo ... src/backup
Code: Select all
./piclone.sh > mygolden.imgCode: Select all
sudo rpi-clone sda