Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm playing around with my raspberry pi project and have made a number of customizations to my device OS (simple stuff... configuration files... installed packages... etc).

I would like to make a "copy" of my system available for others to download/use. What's the easiest way to do this?

share|improve this question

The easiest way to make an image:

ssh root@raspberrypi cat /dev/sda >rpi.img

This creates a large raw copy. If you want to compress the file, you should first fill the unused disk space with a compressible pattern. Run this command in any on-disk directory (if you run multiple partitions, do it for it partition):

cat /dev/zero >zero; rm zero

To restore, cat rpi.img >/dev/sda after booting from some external media (replace sda by the right designation for the internal storage).

This is not necessarily the best way to make an image for an identical installation. If you only want to save your settings, you only need to back up a few things:

You can then restore an identical system by doing a minimal installation, restoring the packages (see Re-installing apps after a fresh install?), and restoring /etc and other hierarchies. If you're sharing the installation over the Internet, this has the advantage that you only need to share a few megabytes, not a few gigabytes (the rest is downloaded from Debian/Raspbian's servers).

share|improve this answer

Take the SD card out of your Raspberry. Insert it into a desktop computer's SD card reader. Under Linux it will show up as device, e.g. /dev/sdx. Use dmesg or hwinfo to find out the actual device name. Then clone it to a file e.g. using the command

dd if=/dev/sdx | bzip2 -z | cat >/var/www/image_file.bz2

Do not forget to adapt this line according to your needs; replace /dev/sdx by your device name and /var/www/image_file.bz2 by the name of the file you want to share.

Once other users have received image_file they can unpack it using bunzip and restore it as usual.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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