Browse over 10,000 Electronics Projects

How to backup your Raspberry Pi SD Card

How to backup your Raspberry Pi SD Card

Learn how to a backup your Raspberry Pi SD card
different ways to save your files from occasional loss

Eltechs from India present this Raspberry Pi Backup guide, 2017 version.
——————

Raspberry Pi SD card backup is what you really need if you work on Raspbian. Believe me, you do! If you backup your Raspberry Pi SD card in due course, someday it may save your files and your project. Alike any other hardware, the RPi devices may sometimes simply stop working.

It can occur due to a number of reasons: overheating, errors, energy supply issues, cable connection failure… All these problems will make you unplug and plug-in again the device to restart it. And such actions taken repeatedly will certainly lead to spoiling your SD card you are saving your work files to.

On the other hand, you can damage or delete your files occasionally with your own hands! There a lot of examples when we do something wrong because of the overall tiredness, inattentiveness or just being in a hurry.

Also, another reason to backup Raspberry Pi is the simplicity of starting all of the work over. I mean if you are completely messed up while doing some project on your RPi, it takes very short time to delete everything, reinstall the Raspbian and start from the last successfull point! This is very simple in case you back up the file system properly.

Finally, you may want to duplicate what you’ve done. In this case, it is very convenient to clone the Raspbian image (which is also a kind of backup) and reuse it again somewhere else.

So, you should do the backup of your Raspberry Pi over the network or literally make your RPi clone to keep your life in harmony!

OK, now I hope you understand the importance of backing up your Raspberry Pi SD card. Below we describe 3 ways to do that.

How to backup Raspberry Pi SD card

This way fully depends on your particular goals and wishes. By using SD card backup approach you may either copy the entire image of your file system or choose only to copy selected data to your SD card. If you would like to act the simplest way by storing the separate data or files, simply set up WinSCP client on your Windows PC device, connect to Raspberry Pi via SFTP connection and copy the particular files you need directly from RPi.

On the other hand, creating the whole image of Raspbian may be quite reasonable. It implies cloning the whole file system structure. So, you make a clone of SD card, write the copied image to a new SD card then just plug it in a new RPi and you have a full clone of the original device. If you chose to build this way of a backup, everything will depend on the operating system you are going to use: Linux, Mac or Windows.

 

LINUX
It’s quite easy, as you have to fulfill the standard command:

dd if=/dev/sdx of=/path/to/image bs=1M

Note, that “/dev/sdx” should be your SD card

MAC
You can use the same “dd” command here, but have to change your SD card designation:

dd if=/dev/rdiskx of=/path/to/image bs=1M

As you’ve already understood, /dev/rdiskx goes for your SD card.

WINDOWS
You’ll need a small additional app here, called Win32DiskImager. This app will help you to create the Raspberry Pi image from files kept on your SD card and store it safely on your PC. To make the Raspbian image follow these steps

  1. Download Win32DiskImager from the SourceForge
  2. Safely remove your SD card from the RPi and insert it into your PC slot
  3. Open Win32 Disk Imager
  4. Choose the name and location of the backup file and the letter for your SD card and
  5. Click “Read”

Wait for a little while for the system to create an image of the SD card. Usually, it takes several minutes, depending on the size of the card memory. After that, your Raspbian is fully backed up.

 

 

Raspberry Pi Backup with CrashPlan

CrashPlan on Raspberry Pi is what I have already written about. Copying files or full image are a manual kind of work. But you definitely need the automatic backup for your Raspberry Pi. CrashPlan is one of the kind. CrashPlan can back up your files to both cloud and your PC or laptop and even on PC of your friend ???? Backup to the cloud is a paid option which includes different pricing plans. Other ones are free. For that, you need a CrashPlan client running on Raspbian.

 

 

So, here is where you need ExaGear Desktop. It’ll enable running the x86 CrashPlan app on a Raspberry Pi device. After you get the ExaGear license or at least a demo, follow the instructions below.

As a zero step toy need to download CrashPlan from the official website www.crashplan.com. Note, that you need the Linux version! Then:

1. Unpack ExaGear Desktop archive:

cd home/pi/Downloads
tar -xvzpf exagear-desktop-rpi*.tar.gz

2. Install ExaGear:

$ sudo ./install-exagear.sh

Start guest x86:

3. Enter the guest x86 system using the following command:

exagear
Starting the shell in the guest image /opt/exagear/images/debian-8

Check if guest x86 system is on:

arch

There should be the return:

i686

4. Update the guest system:

$ sudo apt-get update

5. Download libraries necessary for CrashPlan:

$ sudo apt-get install lxrandr libgtk2.0-0 libXtst6 cpio

6. Unpack the CrashPlan archive, from the default RPi directory (usually, Downloads folder):

cd /home/pi/Downloads
tar -xvzpf CrashPlan_4.8.2_Linux.tgz

7. Install CrashPlan on the x86 guest system and from the directory, CrashPlan has been unpacked into:

cd /home/pi/Downloads/crashplan-install
$ sudo ./install.sh

8. Follow the prompts of the installation manager and then configure an auto start:

$ sudo service crashplan start 2>/dev/null
$ sudo update-rc.d crashplan enable

9. That’s it! Now, you can run CrashPlan with the following command:

/usr/local/bin/CrashPlanDesktop

Otherwise, you can run CrashPlan from the Start menu:



Advertisement1


 

 

You’ll see a browser window with the empty fields. Fill them out and start up your account and start the backing up.

 

 

Backup your Raspberry Pi with Dropbox

Using Dropbox for file system backup on Raspberry Pi is a little bit different approach. It also uses a desktop app to set the process. So what’s the deal? And what’s the main difference from free CrashPlan automatic backup we have looked through earlier?

The main magic of Dropbox on Raspberry Pi is in its data recovery and file versions history access. In fact, Dropbox keeps a history of all versions of the files. With Dropbox, you can restore files for the duration of up to 30 days (120 days for extended business version). Moreover, you can get the access to all those versions online, from any device (even mobile) and from any place 24/7.

So, all you need is to set up Dropbox on Raspberry Pi and use it during your work, storing all the files to Dropbox dedicated folder. Dropbox will do the rest. For any occasion, you’ll be able to restore different versions of files, that’s even better than a pure backup. Worth money and efforts, I guess.

 

 

Installation Dropbox on Raspberry Pi

The process is very close to what we have done earlier with CrashPlan and you will need ExaGear in this case as well. So, follow these steps:

1. Download and install ExaGear just like in we did it in the previous chapter.

2. Install necessary libraries for Dropbox:

$ sudo apt-get install wget libxslt-dev libxxf86vm-dev xcb

3. Download Dropbox 32-bit Debian archive:

wget linux.dropbox.com/packages/debian/dropbox_2015.10.28_i386.deb

4. Unpack and launch the installation:

$ sudo dpkg -i dropbox_2015.10.28_i386.deb; sudo apt-get install -f

5. Run Dropbox:

 

 

At the first launch, Dropbox runs the installation daemon. Press “ok” and wait until the installation finishes.

 

 

 

5. You can also set up an autostart for Dropbox:

$ arch
armv7
$ sudo su
$ printf '#!/bin/bashnexec exagear -- $0 $@n' > /usr/bin/dropbox
$ chmod +x /usr/bin/dropbox
exit

That’s it. You may now use Dropbox as a backup option for Raspberry Pi!

Other Raspberry Pi Backup options

Frankly, you may find other variants for Raspbian backup.

Backblaze as an alternative backup service for Raspberry Pi

For example, Backblaze. If looking through the Backblaze vs CrashPlan difference, the Backblaze offers a little bit more access opportunities as you can get the access to the files stored in the cloud from the mobile devices. But, at the same time, Backblaze includes only Windows or Mac client versions and that is a real obstacle for installing and using it on Raspberry Pi.

Another difference is that Backblaze have a 14-day trial period when you can use the cloud storage account for free and after the expiration date it’ll cost $5/month, while CrashPlan personal “For Home” service option is fully free.

Finally, Backblaze has got a special feature called “B2 cloud”, that can help developers to create the automatic cloud storage and backup via its API with full access both from desktop and mobile devices. It includes first 10Gb of a storage space for free which seems quite an attractive option to make sure if it fits all of your needs.

Elephant drive as an alternative backup service for Raspberry Pi

Another bright backup service provider is Elephant drive. Basically, it offers similar features, including automatic backup right into the cloud, web access both from desktop and mobile devices, secure sharing. But where the real difference is it is in the Elephant drive pricing plans.

It’s got a free option with 2Gb limited storage space. Concerning the paid ones, there is a choice between “Pro Plan” with $9.95 per month (includes 1,000 GB of storage space) and “Business” featuring $39.95/month (for 2,000 GB). There is a trial period consisting of 30 days of free access to any type of subscription plans. All of these peculiarities make Elephant drive quite interesting and attractive service to consider.

Of course, digging deeper, we can find other opportunities for building up backup for your files on Raspbian. Among them, there are such providers as SOS, Mozy, Livedrive, Acronis and lots of others. All of them look very alike, the only they differ with are their subscription plans, which means that all of them are paid services. If you are looking for the free backup opportunities, additionally to CrashPlan and Dropbox mentioned earlier in this article, you may consider using Google Drive as a cloud storage space.

Final notes

We have learned lots of ways of saving your work files via Raspberry Pi backup. And it’s obvious that using ExaGear with powerful and up-to-date solutions such as Dropbox or CrashPlan can really save you time and money.

ExaGear is registered trademark of Eltechs, Inc. Raspberry Pi is a trademark of the Raspberry Pi Foundation. Other trademarks and product names are the property of their respective owners.

 

Read Original Article

 


Top