I've noticed that when doing backups of Linux Machines there tend to be two parts: File Backups and partition layout backups.

File Backups backup the non-os type files that are unique to you, and configuration files.

Software packages are loaded by your distro / repository.

However, no disastery recovery solution is complete without a partition layout recovery backup and restore. In other Linux distros this comes in the form of REAR which outputs a bootable ISO or PXE image from which to recover the partion layout to another drive before restoring your file backups.

OpenWRT also appears to have a process for doing this ( https://wiki.openwrt.org/doc/howto/generic.backup) How does one make a partion backup for a Raspberry PI SD card?


If you use raspbian you can use almost any tool that is available for debian based Linux distribions.

Because I prefer simple solutions, I use command line tools dd which can give you single partition image or entire disk image as .img file, which in turn can be mounted on any linux distribution AFAIK.

# backup entire disk to *img
dd if=/dev/mmcblk0 of=/path/to/image.img bs=1M

# backup just first partition '/boot'
dd if=/dev/mmcblk0p1 of=/path/to/image.img bs=1M

# backup just second partition '/'
dd if=/dev/mmcblk0p2 of=/path/to/image.img bs=1M

# backup entire disk and also compress on the fly
dd if=/dev/mmcblk0 bs=1M | bzip2 -c > /path/to/image.img.bz2

The dd command can be also used for writing .img to another sdcard and it would be bootable if you backup entire disk.

It is strong suggested to read man dd before play with this tool, because one can mess a bit, if use it wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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