element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Complete newbie instructions - how to backup your Raspberry Pi System SD Card
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 676 subscribers
  • Views 461 views
  • Users 0 members are here
  • raspberry_pi
  • raspberry-pi
  • raspbian
Related

Complete newbie instructions - how to backup your Raspberry Pi System SD Card

Former Member
Former Member over 11 years ago

I have never used Linux before about last Saturday, and I actually don't have that much programming experience, but I'm getting very good results and products with my limited Linux programming ability right now.  So of course after having produced a something which I like, I want to now use my raspberry pi for something totally different.  I don't have an infinite number of SD cards, in fact I only have a couple, so I want to now backup my fully functioning SD card with all of its modifications which I have made, and then wipe it and download a whole new type of package and try something else on my raspberry pi.  But of course I want to be able to go back to what I have later if I want to continue with what I'm doing, or install it on another pi which I am sure I will buy in the not-too-distant future.

 

So, how do I save my pi settings onto another SD Card which I can then put onto a different pi?

 

For this procedure you will need a USB hub, an SD card reader, and an SD card equal or larger in size to the SD card that the RPI is using.

 

Being a newbie, and fighting my way through some forms, with a great deal of persistence necessary to get what I want, I am now able to tell you all that I have succeeded in finding what I believe is the easiest way imaginable to save your raspberry pi configuration on a chip, including all of its disk partitions, in such a way as to later be able to put it back on a different chip and reinstall your pi from it.

 

Basically what we're doing, for all you Windows users, is to copy the system drive to another drive and then boot up from it to test it.

 

I have also included an explanation which will basically show you what each part of the command does so that a total newbie can understand what you're telling the computer to do.

 

The first thing you want to do is to format the SD Card.  Put it into any Windows PC and utilize the SDformatter program which you download from the raspberry pi foundation, and usually comes bundled in their extractable zips.  Format the drive with quick formatting, and format size adjustment option off.

 

Next, boot up the Pi snd log in.  Don't have the USB hub or SD cardreader in it, just the pi and it's System SD Card.  Now you're going to display all of the file system devices in a human readable fashion.  And the command for that is the following:

 

"df -all -h"

 

you will see a list of devices.  You don't have to pay much attention to it yet.

 

Now put the formatted SD card into the pi with the SD card reader.  Type in these 2 commands, one of which will give you an error message, and the other should work:

 

sudo mount /sda1 /usb

sudo mount /sdb1 /usb

 

which means "SuperUser Do - mount Serial Drive port A1 (or B1) - to the '/usb' directory."  One of them, A1 or B1, will be the correct USB port, depending on where you have put your stick, and the other one gives you the error.

 

Wait a few seconds, then display the file system again (use the up arrow to redisplay the previously entered command, and press enter again)

 

"df -all -h"

 

And at the bottom of the list you will see something that was NOT THERE in the first listing.  Something like '/dev/sda1 7.5G 32K 7.5G 1% /usb'  which is telling you that your second SD Card is on device address 'SDA1', 7.5 GB size, 32 KB used, 7.5 GB available, one percent used, and is mounted on the /usb directory.  Perfect.

 

So now that you have your system card working (which it obviously is because you're running Linux on the pi) and you have successfully inserted your second SD card, it's time to do the actual copy.  So here goes.  Enter the command, and here is exactly what I typed into my command line to make it do what I wanted it to do:

 

"sudo dd if=/dev/mmcblk0 of=/dev/sda1 bs=1M"

 

where the correct USB SD port must be specified as per what you found at the end of the "df -all -h" command listing.

 

Here is the explanation of that last command:

 

"SuperUser Do Disc Duplication - input file =/device/multimedia chip block zero - output file = device/serial drive A1 - block size equals 1 MB (copy across in 1 MB chunks)"

 

You will see the activity light on the pi go on to show there is something happening.  And then wait for about 10 - 20 minutes depending on the size of your system SD card.  At the end you will have all of the fully operational partitions on your other SD card.

 

Put your newest the card into the system slot on the RPI and rebooted using the command "sudo reboot".  I prefer to use this command rather than just pulling the plug because this command will save all of the commands you have typed in in memory, so you can later cycle back through them using the up arrow from the commandline.  It takes a few more seconds to reboot but is worth it.  If the RPI boots successfully from the newly copied card, then you have done well.  Go and have an ice cream, on me!

 

Of course you're probably going to want to get into the new system card now and copy files onto your PC.  If you look at the new card on a PC computer it will show up as unformatted.  That is because windows can't read the Linux file systems.  But don't try to reformat it to read it, because obviously you will erase everything you just did.  You will have to boot the PC up in Linux to read it or see it.  And that's going to be somebody else's forum, not mine.

  • Sign in to reply
  • Cancel
  • Former Member
    Former Member over 11 years ago

    Thanks for this.

    But surely you would be better making your backups into a series of conveniently named directories on an attached hard drive? For your next task, some amended instructions to achieve that please! We'll need to know how to format the hard drive in the first place, how to make back ups onto it and how to use it for other purposes such as storing music and pictures for that home media server project.

    Also, do you really need to back up the whole card? Surely you can just back up the few files that re unique to each project? Much faster!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    I solve my problems as I come to them.  If I get the solution I want and it works, I like to publicize my solution and why it works so that others can benefit.

     

    You can do what you want for your problems.  Some guys are on the forum looking for problems to solve.  I'm not.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • packetgeek
    packetgeek over 11 years ago in reply to Former Member

    I tend to use the dd method to back up the entire SD card as it avoids having to re-install software/data (as you'd need to do if you just backed up folders/files).  I do this because I tend to wear out SD cards (I have multiple RPi's) and the simplest means of recovery is to just recreate the system on the new SD card and swap it out for the bad one.  Since they're only 4 GB (or 8GB) each, the img's are easy to store elsewhere.  On average, I'm doing this about once per quarter (the cards last about 16-18 months).

     

    The only thing that I'd add to mutleyeugenius's procedure is to run "dmesg" immediately after inserting the SD card into the reader.  That should give you an idea of where the operating system wants to put the SD card (sda/sdb/etc.).

     

    - Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube