PjV
Posts: 13
Joined: Tue Dec 13, 2016 5:39 pm

command line version of piclone?

Wed Apr 12, 2017 10:31 am

Hi,

My query in short: Is there a command line version of piclone?
(see: https://www.raspberrypi.org/blog/anothe ... -raspbian/ scroll down to SD card copier)
I have a 'headless' PI running Jessie Lite, so I can't run piclone from the UI. Via SSH I can access the device.

(Edit: it's piclone, not picopy)
Last edited by PjV on Wed Apr 12, 2017 3:30 pm, edited 1 time in total.

scotty101
Posts: 2909
Joined: Fri Jun 08, 2012 6:03 pm

Re: command line version of picopy?

Wed Apr 12, 2017 10:38 am

Yes. it's called dd and is a standard *nix tool and how we used to copy .img files to SD cards back in the old days.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

mikerr
Posts: 2683
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: command line version of picopy?

Wed Apr 12, 2017 10:49 am

picopy ("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
Android app - Raspi Card Imager - download and image SD cards - No PC required !

PjV
Posts: 13
Joined: Tue Dec 13, 2016 5:39 pm

Re: command line version of piclone?

Wed Apr 12, 2017 3:32 pm

Thanks Mike,

I corrected the name of the tool.
The link you provided looks to be what I needed :)

PlanB
Posts: 92
Joined: Tue Oct 28, 2014 6:44 am

Re: command line version of piclone?

Mon Jun 05, 2017 12:28 pm

I pasted the above code into a file I named sdclone & tried to run it. I got.....
[email protected]:/home/pi# bash sdclone
umount: 9: mountpoint not found
umount: 8: mountpoint not found
umount: 7: mountpoint not found
umount: 6: mountpoint not found
umount: 5: mountpoint not found
umount: 4: mountpoint not found
umount: 3: mountpoint not found
umount: 2: mountpoint not found
umount: 1: mountpoint not found
dd: failed to open ‘’: No such file or directory
Error: Could not stat device mklabel - No such file or directory.
Retry/Cancel?
Clearly my simple minded approach has missed some detail. Is there a simple guide for how to get piclone working on Jessie lite where there is no startx or pixel?

SkyRise
Posts: 154
Joined: Tue Jan 24, 2012 1:20 pm

Re: command line version of piclone?

Mon Jun 05, 2017 12:40 pm

The script requires the target device on the command line

Code: Select all

sdclone /dev/sdx
Make sure to get /dev/sdx right, or (as usual) you could wipe out your pi...
(oh, and will probably need to be run as root too)

PlanB
Posts: 92
Joined: Tue Oct 28, 2014 6:44 am

Re: command line version of piclone?

Mon Jun 05, 2017 1:16 pm

Thnx for the tip, any idea how to fix the 'operation not permitted' errors?

[email protected]:/home/pi# bash sdclone /dev/sda
umount: /dev/sda9: mountpoint not found
umount: /dev/sda8: mountpoint not found
umount: /dev/sda7: mountpoint not found
umount: /dev/sda6: mountpoint not found
umount: /dev/sda5: mountpoint not found
umount: /dev/sda4: mountpoint not found
umount: /dev/sda3: mountpoint not found
umount: /dev/sda2: not mounted
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0219021 s, 23.4 kB/s
Information: You may need to update /etc/fstab.

Information: You may need to update /etc/fstab.

mkfs.fat 3.0.27 (2014-11-12)
mkfs.fat: /dev/sda1 contains a mounted filesystem.
‘/tmp/tmp.yDOGKpbbDU/./COPYING.linux’ -> ‘/tmp/tmp.p8jDE1pUJ8/././COPYING.linux’
cp: failed to preserve ownership for ‘/tmp/tmp.p8jDE1pUJ8/././COPYING.linux’: Operation not permitted
‘/tmp/tmp.yDOGKpbbDU/./LICENCE.broadcom’ -> ‘/tmp/tmp.p8jDE1pUJ8/././LICENCE.broadcom’
cp: failed to preserve ownership for ‘/tmp/tmp.p8jDE1pUJ8/././LICENCE.broadcom’: Operation not permitted
‘/tmp/tmp.yDOGKpbbDU/./bcm2708-rpi-b-plus.dtb’ -> ‘/tmp/tmp.p8jDE1pUJ8/././bcm2708-rpi-b-plus.dtb’
cp: failed to preserve ownership for ‘/tmp/tmp.p8jDE1pUJ8/././bcm2708-rpi-b-plus.dtb’: Operation not permitted
‘/tmp/tmp.yDOGKpbbDU/./bcm2708-rpi-b.dtb’ -> ‘/tmp/tmp.p8jDE1pUJ8/././bcm2708-rpi-b.dtb’
cp: failed to preserve ownership for ‘/tmp/tmp.p8jDE1pUJ8/././bcm2708-rpi-b.dtb’: Operation not permitted
‘/tmp/tmp.yDOGKpbbDU/./bcm2709-rpi-2-b.dtb’ -> ‘/tmp/tmp.p8jDE1pUJ8/././bcm2709-rpi-2-b.dtb’

PlanB
Posts: 92
Joined: Tue Oct 28, 2014 6:44 am

Re: command line version of piclone?

Mon Jun 05, 2017 1:17 pm

I get a similar gripe when I try to use Bill Wilson's rpi-clone

User avatar
rpdom
Posts: 12582
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: command line version of piclone?

Mon Jun 05, 2017 1:47 pm

PlanB wrote:Thnx for the tip, any idea how to fix the 'operation not permitted' errors?
Just 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.

User avatar
peterscargill
Posts: 11
Joined: Fri Apr 17, 2015 10:40 pm
Location: Northumberland
Contact: Website

Re: command line version of piclone?

Thu Jul 12, 2018 3:02 pm

Interesting responses in here including the smartalec DD response. PICLONE is definitely NOT DD.

I got mountpoint not found for sda9 through 3, but that is to be expected. sda2 and 1 not found. re-reading partition table failed - resource busy, HOWEVER, it DOES seem to be working, now half way through partition 2 which begs the question why the warnings and apparent error on rereading the table?

Desktop CD Copy has always worked for me and so I've no reason to think this command line version won;t... ignoring those mountpoint warnings, is that re-read failed message is maybe important? Dialog says copy complete. Rebooted onto new SD. Works.. but that message is bugging me.

Did this on a PI2 with full Raspbian.
Regards

Peter Scargill (tech.scargill.net)

Return to “Beginners”

Who is online

Users browsing this forum: LTolledo, toemchen and 51 guests