rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

How do I create an image of the RPI already installed.

Mon Aug 06, 2012 12:19 am

I would like to make a backup of the whole RPI system now that's is up and running, updated, upgraded and with the apps installed that I use. How do I go about this so I can save let's say the image in .img format so later on I could install it with win32DiskImager Windows application to the same SDHC or another card?
thanks, regards.

felix123
Posts: 153
Joined: Tue May 15, 2012 6:06 am

Re: How do I create an image of the RPI already installed.

Mon Aug 06, 2012 12:31 am

Open win32DiskImager , click the read button. Easy, isn't it ;)

rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

Re: How do I create an image of the RPI already installed.

Mon Aug 06, 2012 2:31 am

sure sounds easy, had not tried yet, but I will!

Now, let's say that the SDHC card is 16GB, I take the image and store it in a PC. Then I want to use a 32GB SDHC card to place that image, will it work?


alexchamberlain
Posts: 121
Joined: Thu Jun 14, 2012 11:20 am
Location: Leamington Spa, UK
Contact: Website

Re: How do I create an image of the RPI already installed.

Mon Aug 06, 2012 6:13 am

rocketero wrote:sure sounds easy, had not tried yet, but I will!

Now, let's say that the SDHC card is 16GB, I take the image and store it in a PC. Then I want to use a 32GB SDHC card to place that image, will it work?
It won't work the other way round though...
Developer of piimg, a utility for working with RPi images.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: How do I create an image of the RPI already installed.

Mon Aug 06, 2012 6:35 am

rocketero wrote:Now, let's say that the SDHC card is 16GB, I take the image and store it in a PC. Then I want to use a 32GB SDHC card to place that image, will it work?
It will work. You will only see 16GB of the 32GB card though. I think there are instructions on the Wiki for extending the 2GB images; the same would apply to extending a 16GB image to 32GB.

rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

Re: How do I create an image of the RPI already installed.

Wed Aug 08, 2012 2:06 am

OK, I did a backup of the 32 GB sdcard, it took hours to do it and the final image is 32 GB in size even that only 4 or 5 GB are used so far. why is this way? I thought I was going to have a compressed image or something.

User avatar
jackokring
Posts: 816
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: How do I create an image of the RPI already installed.

Wed Aug 08, 2012 2:40 am

Use 7zip, and maybe bzip format archives .tar.bz2 or your favourite linux standard of .tar.gz but that's standards and availability 101.

Cheers Jacko
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How do I create an image of the RPI already installed.

Wed Aug 08, 2012 4:11 am

rocketero wrote:OK, I did a backup of the 32 GB sdcard, it took hours to do it and the final image is 32 GB in size even that only 4 or 5 GB are used so far. why is this way? I thought I was going to have a compressed image or something.
dd does a bit for bit copy of the sdcard, including free space.
If you want it smaller, compress it.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

Re: How do I create an image of the RPI already installed.

Wed Aug 08, 2012 1:53 pm

I didn't use dd, I used win32diskimager in Windows 7 (I took the sdcard out of RPI and use an usb adapter to plug it to the PC).

The image is called rpi-wheezy.img, it's 32 gb in size. Using 7zip I could compress it in bzip2 (bz2) format, and final size would be like 5gb to 10gb??, still big but not as big as 32gb.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26685
Joined: Sat Jul 30, 2011 7:41 pm

Re: How do I create an image of the RPI already installed.

Wed Aug 08, 2012 2:26 pm

rocketero wrote:I didn't use dd, I used win32diskimager in Windows 7 (I took the sdcard out of RPI and use an usb adapter to plug it to the PC).

The image is called rpi-wheezy.img, it's 32 gb in size. Using 7zip I could compress it in bzip2 (bz2) format, and final size would be like 5gb to 10gb??, still big but not as big as 32gb.
Correct - you have a direct image of the 32GB card which is 32GB. Use zip or similar to compress it. Should be smaller than 5GB unless you have really filled up the card.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

dfreder1
Posts: 12
Joined: Sat Feb 18, 2012 3:06 pm
Location: Sacramento, California

Re: How do I create an image of the RPI already installed.

Sun Sep 02, 2012 10:13 pm

Ugh, trying to use win32diskimager to read my working RPi SD card as a backup. Everything goes well until the 58% finished point when this error pops up "An error occurred when attempting to read from handle. Error1117: The request could not be performed because of an I/O device error."

I've tried running win32diskimager as admin, and, as one forum suggested, closed all open windows.

Any ideas for those of us with Windows 7 as our "regular computer" (other than get a spare Linux machine - which I'm considering!)

(Kingston 8Gb Class 10 SD, win32diskimager just downloaded so latest version, Windows 7)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How do I create an image of the RPI already installed.

Mon Sep 03, 2012 4:01 am

Get a linux LiveCD and boot up your regular computer with the LiveCD ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: How do I create an image of the RPI already installed.

Mon Sep 03, 2012 9:24 am

dfreder1 wrote:Ugh, trying to use win32diskimager to read my working RPi SD card as a backup. Everything goes well until the 58% finished point when this error pops up "An error occurred when attempting to read from handle. Error1117: The request could not be performed because of an I/O device error."

I've tried running win32diskimager as admin, and, as one forum suggested, closed all open windows.

Any ideas for those of us with Windows 7 as our "regular computer" (other than get a spare Linux machine - which I'm considering!)

(Kingston 8Gb Class 10 SD, win32diskimager just downloaded so latest version, Windows 7)
Hi

I had no end of problems like this with a cheap card reader I bought off eBay. Since I got a better one from Amazon I haven't had this problem.

Cheers

Paul
Procrastination - The Thief of Time.

dfreder1
Posts: 12
Joined: Sat Feb 18, 2012 3:06 pm
Location: Sacramento, California

Re: How do I create an image of the RPI already installed.

Tue Sep 04, 2012 1:56 am

I created a Debian boot disk from a usb stick plugged into my laptop. I pulled the SD card out of the pi, and put it in my laptop's card reader. Saw that the SD card is "sdc" at "/dev/sdc". Ran:

dd fi=/dev/sdc fo=/dev/rpiback.img

At some point I saw that it worked, by mounting the file system I could see the contents. So all good so far.

Then I put in another SD card of the same size (8 GB) and used dd to write the image to that card:

dd fi=/dev/rpiback.img fo=/dev/sdd

That seemed to copy the img over. But two things are wrong and probably related: I can't mount it in linux to look at it, and worse, when I put this new card into the pi, it doesn't start up. Other posts are talking about copying the mbr and messing with partitions. Why is this so hard? To get the initial pi SD card I just downloaded the img file and used win32diskimager to write it to the disk. Isn't that the same thing dd does?

So what step and I missing here?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How do I create an image of the RPI already installed.

Tue Sep 04, 2012 6:41 am

Was the SD card set to /dev/sdd after you pulled out the first SD card ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

dfreder1
Posts: 12
Joined: Sat Feb 18, 2012 3:06 pm
Location: Sacramento, California

Re: How do I create an image of the RPI already installed.

Wed Sep 05, 2012 5:51 am

When I pop in an SD card the OS puts up a msg with a bunch of stuff including sdc, sdd, etc. I verified it by checking the dev directory. So I think I have that part right.

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: How do I create an image of the RPI already installed.

Wed Sep 05, 2012 6:27 am

rocketero wrote:OK, I did a backup of the 32 GB sdcard, it took hours to do it and the final image is 32 GB in size even that only 4 or 5 GB are used so far. why is this way? I thought I was going to have a compressed image or something.
I use HDD Raw Copy Tool, its images are compressed.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How do I create an image of the RPI already installed.

Wed Sep 05, 2012 8:27 am

dfreder1 wrote:When I pop in an SD card the OS puts up a msg with a bunch of stuff including sdc, sdd, etc. I verified it by checking the dev directory. So I think I have that part right.
Just because it mentions it doesn't mean it's the right one.
When you do the imaging, run fdisk -l /dev/sdc or /dev/sdd before you start it to make sure that you have the right device.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

dfreder1
Posts: 12
Joined: Sat Feb 18, 2012 3:06 pm
Location: Sacramento, California

Re: How do I create an image of the RPI already installed.

Sat Sep 08, 2012 8:30 am

Yes! Sweet Success! I now have a bootable backup of my SD Card.

sdc is an unmounted usb drive with more memory than sdd which is the SD Card I'm copying from. Entered the following as su:

dd bs=512 count=1 if=/dev/sdd of=/dev/sdc/rpimbr.img
dd if=/dev/sdd1 of=/dev/sdc/rpi1.img
dd if=/dev/sdd2 of=/dev/sdc/rpi2.img

Pop out the first SD Card I'm copying from and insert the SD Card I'm copying to. Say it also appears as sdd. Redo the above but swap the if for the of and the of for the if.

dd bs=512 count=1 of=/dev/sdd if=/dev/sdc/rpimbr.img
dd of=/dev/sdd1 if=/dev/sdc/rpi1.img
dd of=/dev/sdd2 if=/dev/sdc/rpi2.img

Thanks for the help everyone.

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: How do I create an image of the RPI already installed.

Mon Sep 10, 2012 7:57 am

Any reason to save them separated like that?
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

dfreder1
Posts: 12
Joined: Sat Feb 18, 2012 3:06 pm
Location: Sacramento, California

Re: How do I create an image of the RPI already installed.

Tue Sep 11, 2012 4:59 am

I don't have a reason to do them separately (sdc1, sdc2, sdc3). I think it has to be done this way. But to be honest I didn't try it as "dd /dev/sdc /dev/sdd". Do you think it would work that way?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: How do I create an image of the RPI already installed.

Tue Sep 11, 2012 7:38 am

Yes, it still works if you use /dev/sdd
It will copy the entire device, though doing it your way allows you to selectively image partitions.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: How do I create an image of the RPI already installed.

Tue Sep 11, 2012 7:58 am

I've had issues using SDcards in general. Support for them on many notebooks is poor.

So... I only get MicroUSB memory cards now and use an SDcard adapter. This allows me to remove the MicroUSB, put it into a thumb drive and use it as a USB thumb drive. Support for that is very good and fast. Getting 16gb class 4 cards with adapters now days is about $9 which is pretty cheap. I normally pickup 2 or 3 of them when I order them as they have other uses.

I currently use Win32 Disk Imager to make backups of an existing OS card... and store them on my hard drive. I can then write them using the same to a new MicroUSB card of the same size.

Note that when I expand the filesystem to fill the SD card, I don't use the utility in the raspi-config utility. The reason is that it will make an image which can be backed up, but won't fit on similar sized cards.

I am working on a script that will do the same function, but leaves some room on the image so it will always fit on a new memory card of the same size. Should have it tested and completed by the weekend or earlier.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

gilbdeth
Posts: 37
Joined: Fri May 17, 2013 9:49 am

Re: How do I create an image of the RPI already installed.

Wed Nov 27, 2013 3:43 pm

I setup my rpi on a 32gb sd card but am never going to use all that space so was thinking about writing my backup image onto a 16gb sd card, but i read it doesnt work that way round....
Any ideas on how i can do this?

Return to “Beginners”