Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-02-2014, 09:21 AM   #1
LQ Newbie
Registered: Aug 2013
Posts: 28

Rep: Reputation: Disabled
backing up sd card as .img

I have raspbian on an SD card that i'm using in my raspberry pi, and i'd like to make a backup as a .img

I'm doing this by plugging the SD card into my main computer, which runs mint.
When I plug it in, it automatically opens two file system explorer windows:
the first is
containing what looks like legit boot-time files

the other is
/media/<myuser>/<long string of hexy characters>
containing the usual /bin, /etc, /usr, /tmp directories that i'm used to

So, what are these? Are they two different partitions on the sd card?

Also, what is my username doing in the path /media/<myuser> - is that just coincidence because I was logged in as me when I copied the files initially to the sd card?

I'd like to back up the sd card into a single .img file. I've seen elsewhere that I could use something like
dd if=/dev/sd? ..

I'm not sure which (if any) sd(a|b|c|d) my sd card maps to. I tried following some ideas to get some clues but I just ended up more confused. Do I need to mount the sd card first? I also don't really understand what mounting is, and whether I need to do that.
Does the fact that these /media/<something> automatically appear when I plug in mean that it's been automatically mounted for me?

I'd really appreciate some pointers if anyone can help
Old 02-02-2014, 09:34 AM   #2
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108

Rep: Reputation: 18
You just need to make sure what sd is your SD card
fdisk -l
For example, your SD card is sdb
dd if=/dev/sdb of=raspi.img
Based on your SD card size, imaging time will different.
.img file size will be same as your SDcard size since we are imaging whole drive including bootsector.
1 members found this post helpful.
Old 02-02-2014, 02:56 PM   #3
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,766

Rep: Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933Reputation: 1933
There are two partitions on that SD card, one labelled "boot" and the other does not have a label or is labelled as that string of letters and numbers. When you insert the card into your machine running Mint the operating system mounts these partitions for you in /media/<username>/ -- if the partition has label lit uses that for the name of the directory is mounts it in and if not it mounts it as the UUID (I think) which would be the string of letters and number you see.
myatthu explains how to back the complete contents of the card up to an img file.
Old 02-02-2014, 03:52 PM   #4
LQ Newbie
Registered: Aug 2013
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thanks for your answers. Following your advice I was able to successfully create the image I wanted
Thanks again!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding realtek rtl8102 nic card in initrd.img great3003 Linux - Kernel 3 12-29-2009 12:49 AM
[SOLVED] Mounting .img file (chromiumos.img); can't mount it?? Help please? linus72 Linux - General 2 11-27-2009 08:11 PM
How do I pack stage2.img into initrd.img for a PXE linux rescue? real1elmo Red Hat 12 10-14-2009 06:29 PM
Add new cciss driver module to initrd.img ,stage2.img kunalroy2002 Linux - Software 4 09-25-2007 12:09 AM
Putting network.img on a CF card and booting from it? jordan0 Mandriva 0 03-30-2004 03:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration