How to backup operating system?


17 posts
by JerryRice » Tue Jun 19, 2012 3:52 pm
Hello, I am new to Raspberry PI and Linux. Recently I purchased an SD Card with Debian already installed for Rasberry PI. Before I use it I was hoping to back it up just in case I mess something up on it when I do use it.

Does anyone know if it's possible to back this SD card with windows xp pc?
Jerry Rice - alias

Eben has BALLS-OF-STEEL!
Posts: 24
Joined: Tue Jun 19, 2012 3:39 pm
by empire » Tue Jun 19, 2012 8:22 pm
I seem to recall that you can do this with Win32DiskImager
http://rpi-blog.com - Raspberry Pi guides, tips, tricks, and resources :-)
Posts: 42
Joined: Thu Jun 14, 2012 2:00 pm
by Buxton » Tue Jun 19, 2012 9:23 pm
If you do manage to mess things up, you can download a new image-file of the operating system and use Win32DiskImager to put that image on to the card. As empire mentions, you can also back the card up (copy the card to an image).

Link to download that tool and instructions on how to use it are on http://elinux.org/RPi_Easy_SD_Card_Setu ... on_Windows

You can also download images of other operating system configurations (the "normal" one is Debian, there's a new beta version of the Debian system with some fixes now available), write them to your card and try them out. You might want to find some spare SD cards or buy a couple more, if you want to try a new OS distrubution without erasing your old one.
Posts: 1
Joined: Tue Jun 19, 2012 9:18 pm
by JerryRice » Sat Jun 23, 2012 1:00 am
Thanks so much. I am going to get this done tonight. Sounds like no problem :)
Jerry Rice - alias

Eben has BALLS-OF-STEEL!
Posts: 24
Joined: Tue Jun 19, 2012 3:39 pm
by rasbeer » Sat Jun 30, 2012 9:39 am
Is there a way of backing up an OS that only uses the RasPi?
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by Joe Schmoe » Sat Jun 30, 2012 10:46 am
rasbeer wrote:Is there a way of backing up an OS that only uses the RasPi?


Plug in a USB card reader/writer, put a blank card into the external reader, then do:

dd bs=1M if=/dev/mmcblkWhatever of=/dev/sdWhatever
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2769
Joined: Sun Jan 15, 2012 1:11 pm
by rasbeer » Sat Jun 30, 2012 12:08 pm
Thanks Joe - that seems very straightforward.

I was a bit confused by dding if=/dev/something, but I see that's just a way ofcopying a partition.

But isn't the output a file - so it can be mounted with mount -o loop, but we can't boot from it?
If that's right, we still don't have a bootable OS in case we mess up this one...
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by grumpyoldgit » Sat Jun 30, 2012 12:19 pm
rasbeer wrote:Thanks Joe - that seems very straightforward.

I was a bit confused by dding if=/dev/something, but I see that's just a way ofcopying a partition.

But isn't the output a file - so it can be mounted with mount -o loop, but we can't boot from it?
If that's right, we still don't have a bootable OS in case we mess up this one...


I think you are confusing drive with partition.
SDD is a whole drive
SDD1 is the first partition on drive SDD
User avatar
Posts: 1454
Joined: Thu Jan 05, 2012 12:20 pm
by rasbeer » Sat Jun 30, 2012 12:58 pm
grumpyoldgit wrote:I think you are confusing drive with partition.
SDD is a whole drive
SDD1 is the first partition on drive SDD

Quite possibly :)
So this command dd bs=1M if=/dev/mmcblkWhatever of=/dev/sdWhatever will produce a bootable image of one drive (which happens to be an SD card)?
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by Joe Schmoe » Sat Jun 30, 2012 1:34 pm
rasbeer wrote:
grumpyoldgit wrote:I think you are confusing drive with partition.
SDD is a whole drive
SDD1 is the first partition on drive SDD

Quite possibly :)
So this command dd bs=1M if=/dev/mmcblkWhatever of=/dev/sdWhatever will produce a bootable image of one drive (which happens to be an SD card)?


Quite so. It produces a true backup - i.e., a copy of the original object (which is a plastic, bootable, SD card). The copy is also a plastic, bootable, SD card.

Also, as others have noted, this produces a copy of the entire disk, not a "partition".
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2769
Joined: Sun Jan 15, 2012 1:11 pm
by rasbeer » Sat Jun 30, 2012 2:06 pm
Joe Schmoe wrote: Also, as others have noted, this produces a copy of the entire disk, not a "partition".

Ok - sorry, lack of headings & a long section on floppy disks :lol: (here led to me missing "Cloning an entire hard disk".

Just a matter of finding a spare SD card reader then... :)
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by rasbeer » Sun Jul 01, 2012 8:55 am
What happens if the SD you want to back up to is bigger than the one being backed up? :?
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by nascent » Tue Jul 03, 2012 3:01 pm
What happens if the SD you want to back up to is bigger than the one being backed up? :?


Then you're gonna have a bad time.
Posts: 4
Joined: Tue May 29, 2012 10:34 pm
by rasbeer » Tue Jul 03, 2012 5:41 pm
I mean size(if's SD)<size(of's SD)?
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by Joe Schmoe » Tue Jul 03, 2012 5:44 pm
rasbeer wrote:I mean size(if's SD)<size(of's SD)?


That's likely to be OK. It is the opposite case that will be a problem.

So, I think the answer is: No problem. It will write the first X bytes to the card then quit, leaving the rest of the card unallocated/unused. But it should boot fine.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2769
Joined: Sun Jan 15, 2012 1:11 pm
by rasbeer » Tue Jul 03, 2012 5:47 pm
Ok - thanks, that's good.

I ask because I think I read somewhere SD's degrade and decrease in size gradually as you use them; if that's right this will be a common scenario.
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am
by moony » Thu Sep 20, 2012 2:59 pm
you can resize SD cards great with gparted. I tried increase the size (backup was smaller), works fine.
Posts: 26
Joined: Sat Sep 08, 2012 5:28 pm