How to Backup and Restore SD Card for Raspberry Pi?

After having successfully recorded some system for our Raspberry Pi on our SD card ands almost certainly we will go on to do some tests of the new system, as well as make customization settings in it.

But something What I am sure of is that you have had to go through this process more than once, for the simple fact that there are several systems for this device, you have made yourself the task of testing them to see which one suits your needs.

This process can cause you to lose some configurations of a system that you previously used and that if you lose them you can later regret having made the change.

To avoid this type of regret we can make a preventive backup of our SD card and to be able to save those systems and configurations that we deem appropriate.

And not only that, we must also consider that SD cards tend to have a certain life time, so it is never too much to do a preventive backup.

So if you think it is time to back up your SD card, I invite you to follow the following instructions.

Una of the easiest ways to make a backup of the information contained within our SD card is to make the total copy of its content.

As let's do with this is create an image of the SD card which we can save to later be able to carry out the restoration.

So to carry out this work it is necessary that we extract the SD card from our Raspberry Pi, which we must disconnect from the power.

How to make a backup of our SD card?

Now we must place our card in our computer in our card reader or with the help of an adapter.

Done this we must open a terminal and execute the following command to know the mount point that our SD has.

sudo fdisk -l

With this command we will see the mount point, as well as all the partitions that our card has.

Almost by default it is usually the mount point / dev / sdb or / dev / sdc even if you have more storage devices attached this mounting point may vary.

In my case it is / Dev / sdb, let's ignore the partitions / sdb / sdb1, sbd2, sdb3 etc. Those do not interest us.

Now on the terminal we are going to execute the following command

sudo dd bs=4M if=/dev/sdb of=imagenraspberrypi.img

You will notice that the command is similar to the one we use to burn the disk images, only that in it we change the mount point and the path of the parameter image.

For the case of those are Windows users, they can make use of the same tool that is recommended to record the images Win32DiskImager.

Here the way to do it is selecting the folder icon, as if we were going to find the disk image, but here we are going to create the name of our image.

Bakcup Raspberry pi

We can position ourselves in the folder where we want to save the backup image of our SD

Now we are going to select the path that the SD card has.

And we will see that the only enabled button is "Read" which we will press to start the process to back up our SD card.

At the end of the process we can verify that the image is in the path we indicate.

How to restore a backup of our SD?

An important point is that you should know that this backup can only be recorded on an SD card of the same capacity, never less.

I have not tried with higher capacity cards, but generally this process can generate some conflict, since the partitions and sectors are a vile copy.

SIf you have another SD card or do you want to restore the backup you created You can do it by following the same instructions that you follow to record a system on your device's SD card.

So the process is the same and if you have an SD card of the same capacity you can perform the test on it.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Daniel H. said

    friends, to make a backup from windows of all the micro sd memory that contains partitions, how would it be done? Cheers!