6

I have a Raspberry Pi running an IVR application. The application is a little painful to setup. My plan is to distribute the Pi image that has everything installed with a few friends that are planning to use it.

Whats the best way to compress the image so that it's easier to distribute? So far dd seems like a possible solution. I am running the Pi on a 16 GB memory card.

3 Answers 3

5

You can make use of dd and gzip combined to make it compressed.

Here is an example:

sudo dd bs=4M if=/dev/mmcblk0 | gzip > </path/to/image/image-name>.gz

To make use of the same gzip image and write it to an SD card :

sudo gzip -dc </path/to/image/image-name>.gz | sudo dd bs=4M of=/dev/mmcblk0

If you're using a USB card reader, replace your device path in if or of accordingly.

Here is a reference for more details. Link

Hope it helps.

4
  • 2
    Don't forget to actually remove data of old files from the filesystem, else dd will copy also these and the image will be bigger. Run dd if=/dev/zero of=/tmp_file bs=1M until the filesystem is full, then rm /tmp_file.
    – Marki555
    Jun 29, 2015 at 11:40
  • thanks for the clear answer. Hopefully, the result will be under a few gigs so that its easier to share :)
    – feverDream
    Jun 30, 2015 at 3:14
  • It worked perfectly. I was able to compress the image to 4 gigs. May be I can compress it a bit more with tweaking.
    – feverDream
    Jun 30, 2015 at 16:12
  • @feverDream You make use of this downsizer script : sirlagz.net/2013/03/10/script-automatic-rpi-image-downsizer to reduce size of copied SD card and then use gzip to compress it more. Worth a try. Jul 1, 2015 at 8:11
4

If you use NOOBS, then there is this simple setup tool that you can access by holding shift key during startup. You could supply it with scripts to install your data. You could then restore your installation from raspberry directly without a need for another computer. But dd should be faster.

1
  • That sounds like what I might need. I was thinking of asking users to manually run a script that takes care of all the things.
    – feverDream
    Jun 30, 2015 at 3:17
0

I think there are 3 parts to what you need to do.

Firstly making the image: https://github.com/markcity/pibackup

Secondly zipping the image: Your image should shrink down to 450MB - I use 7Zip https://www.7-zip.org/download.html

Thirdly distributing the image: Projektor Digital has free storage.

Here's an example of my pi image for IOT https://app.projektordigital.com/nextcloud/index.php/s/JrRf2sqHiCj6KCE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.