User avatar
socialdefect
Posts: 110
Joined: Mon Jun 25, 2012 9:02 pm
Location: Tilburg, the Netherlands
Contact: Website

PiCloner - SD Backup Tool for OSX

Mon Feb 11, 2013 7:33 pm

Since it can be quite hard for the average Mac user to create a backup of a RaspberryPi SD card I have created a small app that makes this process a whole lot easier. The app is called PiCloner and has the following features:
  • Graphical interface (Cocoa)
    SD card detection
    Image Compression using GZIP (Decrease final backup size)
All you need to do is:
  • 1) Enter a location and file name for the backup
    2) Connect your SD card when asked
    3) Select a compression type
PiCloner is a Universal app that should work with OSX 10.4+ (Tiger and newer) on both PowerPC and Intel Macs. Backups can be restored using the same tools you use to install the official RaspberryPi OS images. (or my PiWriter app. PiWriter is basically the same as PiCloner but copies images to SD)

Click here to download PiCloner from Sourceforge.net

Hope You Like It!
== If it's not broke... I'm not done fixing it! ==

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: PiCloner - SD Backup Tool for OSX

Mon Feb 11, 2013 7:58 pm

Wicked!

Thanks for this!

sonium
Posts: 25
Joined: Mon Feb 11, 2013 1:30 pm

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 10:41 am

I think it doesn't work here:
My log says:

Code: Select all

Image will be stored as: /Users/sonium/Dropbox/Oslo/RaspberryPi-SD.img ...
Unmounting Device...
"/dev/disk2" was already unmounted.
"/dev/rdisk2s1" unmounted successfully.
"/dev/rdisk2s2" was already unmounted.
Starting the clone process.... Please be patient....
dd: /dev/rdisk2: Permission denied
Otherwise, just the tool I've been looking for.

sej7278
Posts: 249
Joined: Tue Jan 22, 2013 6:43 pm

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 11:49 am

nice idea, but wow only mac users could need two gui apps instead of just:

backup:

Code: Select all

dd if=/dev/sdb of=sd.img bs=4M
restore:

Code: Select all

dd if=sd.img of=/dev/sdb bs=4M
optionally piping to bzip2.

User avatar
socialdefect
Posts: 110
Joined: Mon Jun 25, 2012 9:02 pm
Location: Tilburg, the Netherlands
Contact: Website

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 11:59 am

This error has to do with the filesystem permissions on the SD card. A way around this is to execute PiCloner as administrator like this:

Code: Select all

sudo open /Applications/PiCloner.app
I can't seem to find out why some disks require administrative permissions while most removable disks don't need them. Since running as admin can be dangerous if mistakes are made I chose to not include any sudo commands for now just to be safe. When this becomes a problem to many users I might reply the 'Permission denied' with a workaround that fixes the permissions or runs the dd command as admin when there's no better solution.

Thanks for reporting the issue!
== If it's not broke... I'm not done fixing it! ==

User avatar
socialdefect
Posts: 110
Joined: Mon Jun 25, 2012 9:02 pm
Location: Tilburg, the Netherlands
Contact: Website

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 12:33 pm

sej7278 wrote:nice idea, but wow only mac users could need two gui apps instead of ...
I made these apps since not everyone shares our dd passion ;) Specially people who are new to Linux and OSX are afraid to mess-up their system when using the commandline, specially when using dd for all the guru's tell you that you will erase all your files if you're not 100% sure about what you are doing :D
== If it's not broke... I'm not done fixing it! ==

sej7278
Posts: 249
Joined: Tue Jan 22, 2013 6:43 pm

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 2:59 pm

socialdefect wrote:
sej7278 wrote:nice idea, but wow only mac users could need two gui apps instead of ...
I made these apps since not everyone shares our dd passion ;) Specially people who are new to Linux and OSX are afraid to mess-up their system when using the commandline, specially when using dd for all the guru's tell you that you will erase all your files if you're not 100% sure about what you are doing :D
i agree completely, dd is way too dangerous if you don't know what you're doing. i just fear that people will never know what they're doing when using gui's. i was surprised when i got my mac mini how much the console is hidden. anyway its starting to get off-topic now i digress

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 8:11 pm

sej7278 wrote:nice idea, but wow only mac users could need two gui apps instead of just:

backup:

Code: Select all

dd if=/dev/sdb of=sd.img bs=4M
restore:

Code: Select all

dd if=sd.img of=/dev/sdb bs=4M
optionally piping to bzip2.
I live in the command line on my Linux servers, my Pis, and occaisionally on my Linux & Mac desktops.

I use my Mac as my main desktop machine, and I am often working with dd, often late at night. This is app is a great guard against typos or smashing enter on the wrong history line.

Just because someone uses a gui app, doesn't make them a n00b, or incompetent with the commandline...

Commandline is great, but it is not a path to salvation from a deity.

ElWilliaM
Posts: 16
Joined: Tue Jan 15, 2013 8:50 pm
Location: A westerly corner of canuck-land

Re: PiCloner - SD Backup Tool for OSX

Tue Feb 12, 2013 10:34 pm

I'm a Linux user on Ubuntu 12.04 - when I try to dd my RasPI SDCard into a .img, it works for a random (short) amount of time, then Ubuntu pulls an automation trick and "helpfully" remounts my SDCard, thus putting a stop to my dd copy operation. Does anyone know how to turn the automount off?

User avatar
socialdefect
Posts: 110
Joined: Mon Jun 25, 2012 9:02 pm
Location: Tilburg, the Netherlands
Contact: Website

Re: PiCloner - SD Backup Tool for OSX

Wed Feb 13, 2013 7:18 am

ElWilliaM wrote:I'm a Linux user on Ubuntu 12.04 - when I try to dd my RasPI SDCard into a .img, it works for a random (short) amount of time, then Ubuntu pulls an automation trick and "helpfully" remounts my SDCard, thus putting a stop to my dd copy operation. Does anyone know how to turn the automount off?
Sure;
Go to the config screen >> Details >> Removable Media >> uncheck the box that says: Never prompt or start media on insertion.

Good Luck
== If it's not broke... I'm not done fixing it! ==

ElWilliaM
Posts: 16
Joined: Tue Jan 15, 2013 8:50 pm
Location: A westerly corner of canuck-land

Re: PiCloner - SD Backup Tool for OSX

Thu Feb 14, 2013 2:35 am

Thanks 4 the info. I actually was able to get it to work already (last night) by going straight into console mode and bypassing the graphical login manager, thereby bypassing Ubuntu desktop and its automount feature.

kelvinmead
Posts: 44
Joined: Tue Feb 05, 2013 9:19 pm
Location: Bristol, UK

Re: PiCloner - SD Backup Tool for OSX

Thu Feb 14, 2013 11:01 pm

great, not tested yet, but posted for thanks and returns!

Utterchaos23
Posts: 10
Joined: Fri Oct 26, 2012 3:21 pm

Re: PiCloner - SD Backup Tool for OSX

Wed Mar 06, 2013 11:29 am

Hi.. I ran PiCloner from the terminal and still got access denied?

Any Ideas?

p.s. - will happily run in terminal directly is someone posts the commands and steps...

surely there's more to it than....

backup:
CODE: SELECT ALL
dd if=/dev/sdb of=sd.img bs=4M

?

Cheers

BillStephenson
Posts: 254
Joined: Thu May 17, 2012 1:25 am
Location: SW Missouri Ozarks
Contact: Website

Re: PiCloner - SD Backup Tool for OSX

Sat Mar 23, 2013 6:26 pm

Hi.. I ran PiCloner from the terminal and still got access denied?
I did what was suggested in the PiWriter Readme file for the PiCloner tool:

1) Make a copy of the PiCloner.app and name it PiClonerAdmin.app
2) Right click PiClonerAdmin.app and select "Show Package Contents"
3) Navigate to Content/Resources in the Finder window that pops-up
4) Double click AppSettings.plist. The config editor will open it
5) Check the box next to 'RequiresAdminPrivileges'
6) Save the file and your ready to run as Admin
7) Remember to only run as admin when there is no better option!!

When I ran the app it asked me for my Admin Password and it copying my disk now. I'll let you know how it works for me.

I've played with dd on the Mac a bit. That was on OS 10.6.8. I couldn't get a disk to boot using it. It would start loading and then hang. I've got the latest OS now, and haven't tried it yet, but if this works than I'll be happy enough to stay away from dd.

BillStephenson
Posts: 254
Joined: Thu May 17, 2012 1:25 am
Location: SW Missouri Ozarks
Contact: Website

Re: PiCloner - SD Backup Tool for OSX

Sat Mar 23, 2013 10:20 pm

Alright, I just got finished up. The whole process on my very slow Mac Mini took about 5 hours to create a disk image and copy it to a new SD card. I used an 8GB Sandisk SDHC card. I'm sure a 2 GB card would go faster, but I installed Libre Office, apache, and VNC on my system card and that's what I wanted to see come up working.

I'm impressed. This little tool did just what I needed it to do.

socialdefect, Thank you very much!!

User avatar
socialdefect
Posts: 110
Joined: Mon Jun 25, 2012 9:02 pm
Location: Tilburg, the Netherlands
Contact: Website

Re: PiCloner - SD Backup Tool for OSX

Tue Apr 16, 2013 9:37 am

Utterchaos23 wrote:surely there's more to it than....

backup:
CODE: SELECT ALL
dd if=/dev/sdb of=sd.img bs=4M

?
Cheers
Well actually that's about it, the only problem with the CLI approach is that not everyone understands the naming of the devices in OSX, Linux, BSD and making mistakes when using a tool like dd can cause a lot of damage. Even if you do know all about a simple typo can screw-up just as much, and believe me... I know all about that even though I use dd almost daily for the past 10 years I regularly manage to erase the wrong disk. I've even managed once to erase my laptop's HDD, 2 external HDD's and a USB key all at once while making backups :? :D :lol:
Alright, I just got finished up. The whole process on my very slow Mac Mini took about 5 hours to create a disk image and copy it to a new SD card. I used an 8GB Sandisk SDHC card. I'm sure a 2 GB card would go faster, but I installed Libre Office, apache, and VNC on my system card and that's what I wanted to see come up working.
WOW! :shock: It took how long??!!!!!
Did you use an old USB1 adapter to connect your SD maybe? I'm using an 8 year old powermac G5 (single-core 800MHZ with 2GBof RAM) and even I can fill a 8GB SD within 2 hours...
Or did you mean you've bootstrapped a custom image from (packaged) scratch? ??
I'm impressed. This little tool did just what I needed it to do.

socialdefect, Thank you very much!!
Glad you like it... I'll see what I can do to to speed-up the process for you next time... But I don't think I can do more about that than adding an option to set a different block size. It now uses 1M blocks by default which does improve the quality of the clones but using 4M blocks would at least save you an hour or so.

Thanks for the feedback!
== If it's not broke... I'm not done fixing it! ==

JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiCloner - SD Backup Tool for OSX

Tue May 07, 2013 1:35 pm

So I'm in a bit of a predicament...

I had several permission denied attempts to run PiCloner, so last night I cloned the app and ran it in admin mode as suggested in a post above. Finally, it looks like it started working. However, the progress bar never moved at all, but I figured I'd just wait.

It's now 15 hours later, and I'm still at the same place. I've been checking the output file size, and it's currently at 2.12GB. Unfortunately, that's the same filesize I was at 8 and a half hours ago when I gave up and went to sleep. As I monitor it now, it seems like it's still increasing in size by about a MB every 2 or 3 minutes...

I chose "best" compression (which in hindsight, was probably a huge mistake). And I have no idea what the final file size is supposed to be, so I have no idea how close to done I am.

But like I said, it's been 15 hours, so I'm getting a little impatient. But I'm terrified that if I take my SD card out, it's going to corrupt and lose everything. There's no stop button or anything, so if I quit or force quit the app, does that leave me safe to remove the SD card? Because I'm ready to give up if it's not done in a couple hours.

I'm running on a 2.4gHz core i5 Macbook Pro with 4GB RAM and using a built-in SD card. It seems like it shouldn't take this long.

Anybody with any help would be greatly appreciated.

JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiCloner - SD Backup Tool for OSX

Tue May 07, 2013 3:07 pm

Aaaaand 15.5 hours later, I just got a message saying it was finished, so I guess nevermind to the previous post.

User avatar
InsecureSpike
Posts: 23
Joined: Thu Feb 07, 2013 5:37 pm

Re: PiCloner - SD Backup Tool for OSX

Thu Jan 16, 2014 12:12 am

hi, i'm getting nothing but errors when trying to back up any card...
any help would be great, as i don't like the dd idea

Code: Select all

Image will be stored as: /Users/InsecureSpike/Downloads/raspi.img ...
/Users/InsecureSpike/Desktop/PiCloner.app/Contents/Resources/script: line 21: /tmp/PiCloner-image.tmp: Permission denied
/Users/InsecureSpike/Desktop/PiCloner.app/Contents/Resources/script: line 28: /tmp/PiCloner.tmp1: Permission denied
/Users/InsecureSpike/Desktop/PiCloner.app/Contents/Resources/script: line 39: /tmp/PiCloner.tmp2: Permission denied
/Users/InsecureSpike/Desktop/PiCloner.app/Contents/Resources/script: line 42: /tmp/PiCloner-device.tmp: Permission denied
Unmounting Device...
hdiutil: unmount: "AppSettings.plist" failed to unmount due to error 16.
hdiutil: unmount failed - Resource busy
hdiutil: unmount: "AppSettings.plist" failed to unmount due to error 16.
hdiutil: unmount failed - Resource busy
thanks

:edit:
ok not sure if this is going to work ok?

Return to “Beginners”