Pi Copier for Mac OS X

13 posts
by IvanX » Sun Apr 07, 2013 10:01 pm
Hello world,

I'm pleased to introduce Pi Copier. It copies a Raspberry Pi SD card to an image file on your Mac, with optional compression, so you can easily back up and take a snapshot of where your Pi is at on any given day. You can restore the cloned image file back to an SD card by using Pi Filler. It's an easy to use application; no Terminal necessary.

I'm considering Pi Copier to be beta software, and while I've tested it on OS X 10.7 and 10.8, I haven't yet tried it out on 10.5 and 10.6 (of course I think it will work, but I always think it's going to work). Any success stories, problem reports, or suggestions are extremely welcome.

Pi Copier is free (source is available by opening it in AppleScript Editor), and available at http://ivanx.com/raspberrypi .

UPDATE: renamed, because I didn't realize a similar program called PiCloner already existed.
Last edited by IvanX on Wed Apr 17, 2013 6:14 pm, edited 5 times in total.
Posts: 44
Joined: Sun Jan 27, 2013 7:08 pm
by Joe Schmoe » Sun Apr 07, 2013 10:18 pm
Are these just shell script wrappers around the "dd" command?

If not, why not?
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2520
Joined: Sun Jan 15, 2012 1:11 pm
by IvanX » Sun Apr 07, 2013 10:34 pm
They're AppleScript wrappers around the dd command. The person using them doesn't need to know what dd is, and even if they do, might find them more pleasant to use. They're super easy.

Additionally, they figure out which disk is your SD card, and perform error checking, and notify of time remaining for the copy.

If you're curious as to how they work, you can open them in AppleScript Editor and check them out.
Posts: 44
Joined: Sun Jan 27, 2013 7:08 pm
by tvjon » Mon Apr 08, 2013 8:24 am
"problem reports, or suggestions are extremely welcome."

Hello. I just quickly tried this, as I'm about to backup a SD card.

"More than 1 volume seems to have appeared........ Run again" is the paraphrased error message. Most SD Linux cards will have > 1 "volume" so don't know how you got this to work?

I'll take a look at your script later.
Posts: 298
Joined: Mon Jan 07, 2013 9:11 am
by IvanX » Mon Apr 08, 2013 3:45 pm
That's by design, but you raise a good point -- it might not be the right design.

I was operating the assumption that while a Linux disk might have multiple slices, it was only likely to have one Mac-mountable (i.e. FAT) volume, and that could be used to ID the card specifically and not some other disk that might have also come online.

This was more important in the context of Pi Filler, on which Pi Cloner is based, since Pi Filler erases the disk, and if multiple volumes appeared, it's potentially dangerous if it chooses the wrong one, so the guidance is to reformat the card first, resulting in a single volume.

With Pi Cloner, I think the correct behavior would be to, if multiple volumes come online, check to see if they all belong to the same device, and proceed if that's the case, and only complain if the multiple volumes actually belong to different disks. (There's no reason Pi Filler shouldn't employ this behavior too, actually.)

I'll make the change and post an updated version. Thanks for the report.
Posts: 44
Joined: Sun Jan 27, 2013 7:08 pm
by IvanX » Mon Apr 15, 2013 7:12 am
I've posted beta 2 of Pi Cloner, which, per the earlier comments, no longer protests if you attempt to back up a card which has multiple Mac-mountable volumes.

It is at http://ivanx.com/raspberrypi

Please let me know if you see any other issues.
Posts: 44
Joined: Sun Jan 27, 2013 7:08 pm
by tvjon » Mon Apr 15, 2013 12:16 pm
That's better :)

Just backed up my 8G SD via v2. No error messages, compressed size 3.17 Gb.

No time ATM to reconstitute the image to SD, so I used "unarchiver" on the mac to build the img file which mounts fine in the Finder, & a cursory glance suggests both partitions are fine, thank you.
Posts: 298
Joined: Mon Jan 07, 2013 9:11 am
by Utterchaos23 » Tue Jun 18, 2013 4:02 pm
Hi ....

is it supposed to be sat on my desktop flash for an hour? - or has something gone wrong?

No estimated time remaining either....


Posts: 10
Joined: Fri Oct 26, 2012 3:21 pm
by Utterchaos23 » Tue Jun 18, 2013 4:56 pm
Nope.. all is ok.. I't completed eventually :mrgreen:
Posts: 10
Joined: Fri Oct 26, 2012 3:21 pm
by IvanX » Tue Jun 18, 2013 8:31 pm
Glad it completed.

Pi Copier (and Pi Filler) won't display time remaining updates (or anything at all) if it is not the frontmost application. You can click on the icon in the dock to see updates.
Posts: 44
Joined: Sun Jan 27, 2013 7:08 pm
by GiraffeDog » Thu Aug 08, 2013 10:19 am
If you're not sure if your card is being written on a mac or need some hand holding (I know I do) then do the following in a new terminal window. Please note this does not work under Snow Leopard as the l command is not recognised!

This command will list all the disks available on the mac. In my case the SD Card is disk3 (I have two HDs in my MBP and no SuperDrive).

Code: Select all
mbp13:openelec username$ diskutil list
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *500.1 GB   disk0
   1:        Apple_partition_map                         32.3 KB    disk0s1
   2:                  Apple_HFS Storage                 500.0 GB   disk0s3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *750.2 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS Macintosh HD            749.3 GB   disk1s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.0 GB     disk3
   1:             Windows_FAT_32                         58.7 MB    disk3s1
   2:                      Linux                         3.9 GB     disk3s2

I then run the following command to monitor activity:

Code: Select all
mbp13:openelec username$ iostat -Iw 3 disk3
          disk3       cpu     load average
    KB/t xfrs   MB  us sy id   1m   5m   15m
    4.00 466396 1823.04  14  7 79  2.77 2.80 2.86
    0.00   0  0.00  16  9 75  2.77 2.80 2.86
    0.00   0  0.00  25 15 60  2.79 2.81 2.86
    0.00   0  0.00  14  8 78  2.79 2.81 2.86

To stop monitoring this, I press CTRL-C to break out.

Hope this helps :)
Posts: 1
Joined: Wed Jul 24, 2013 1:32 pm
by lsx » Tue Dec 10, 2013 9:28 pm
Thanks for the app, but I had a TIMEOUT with Pi Copier this afternoon after returning from work. The .gz reads INCOMPLETE.gz.
System is 10.9 on 4 year old Macbook Pro.
Anyone experienced this?
Posts: 4
Joined: Tue Dec 10, 2013 9:21 pm
by ChaseT » Thu Apr 03, 2014 12:24 pm
Hi all,

IvanX, I love these scripts.
They are great time saves and make timely backups during development a breeze.
(I also use them for my Beaglebone black boards)

I have recently upgraded to 10.9 Mavericks and the scripts don't seem to work - Your page only mentions up to 10.8.

Could the script environment have changed so much in one step?

Is there any chance of an update?

Thanks ChaseT
Posts: 9
Joined: Thu Aug 02, 2012 11:49 pm