• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Replicate SD card  (Read 5300 times)
mail4asim
Newbie
*

Karma: 0
Posts: 39



View Profile
« on: January 12, 2010, 11:50:30 AM »

I am running Ubuntu on my Sheevaplug booting from a 4GB SD card. I have purchased another 4GB SD card and was wondering what would be the best way to replicate my current card. So in case it dies, all I have to do is plug in my backup card and boot up the plug.
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #1 on: January 12, 2010, 12:58:54 PM »

FWIW, here's a pointer to a post I wrote some time ago describing how I back up my SD card:

http://plugcomputer.org/plugforum/index.php?topic=865.msg5515#msg5515

After you get the card's contents on your backup box, you can plug an SDcard into it, format it, and populate it.
Logged

jeroenj
Newbie
*

Karma: 0
Posts: 1


View Profile
« Reply #2 on: January 12, 2010, 01:25:53 PM »

I've used the following method to make an image of the SD card:
dd if=/dev/mmcblk0 of=[name of SD card backup file on different storage]

And to store additional info on the partitions of the image:
fdisk -ul =/dev/mmcblk0 >[name of SD card backup file].info

To copy the image back to the new SD card you would do:
dd of=/dev/mmcblk0 if=[name of SD card backup file on different storage]

However you would need to boot from the NAND on your plug to be able to plug in the new SD card.

I didn't figure this out by myself, but found it on http://darkdust.net/writings/diskimagesminihowto  Wink

Hope this works for you!
Logged

mail4asim
Newbie
*

Karma: 0
Posts: 39



View Profile
« Reply #3 on: January 12, 2010, 01:59:19 PM »

Thanks for the suggestions.  What I was thinking about is connecting the second SD card using a USB card reader. This way I can make an exact copy off the SD card.


Just a silly question, what if I was to connect the 2 SD card via 2 different USB card readers onto a linux box. Could I just drag and drop the files ? Would that work or does it cause problems with the file permissions ?
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #4 on: January 12, 2010, 09:02:43 PM »

Unless I misunderstand what you are suggesting, I'd think that the ownership permissions would not be correct after a drag-and-drop, unless perhaps you ran the desktop as root, something I'd guess would not be recommended.
Logged

mail4asim
Newbie
*

Karma: 0
Posts: 39



View Profile
« Reply #5 on: January 13, 2010, 01:50:29 PM »

I just remembered that the SD card has 2 partitions on it.  I guess it's not going to be easy replicating it like I had originally thought.  Any suggestions ?
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #6 on: January 13, 2010, 03:40:02 PM »

Multiple partitions shouldn't be a showstopper; you just have to deal with them one at a time.  Obviously, you'll have to format the target card so it is laid out similarly to the source card before you begin.

If you copy the partition file-by-file (or drag and drop), you'll have to mount the partitions first.  My SDcard has three partitions and an "ls" shows the following:
Code:
$ ls -l /dev/mmc*
brw-rw---- 1 root disk 179, 0 2010-01-05 01:28 /dev/mmcblk0
brw-rw---- 1 root disk 179, 1 2010-01-05 01:28 /dev/mmcblk0p1
brw-rw---- 1 root disk 179, 2 2010-01-05 01:28 /dev/mmcblk0p2
brw-rw---- 1 root disk 179, 3 2010-01-05 01:28 /dev/mmcblk0p3
$

The first entry refers to the card's partition block.  The next three are the partitions as defined in the partition table.

If you "dd" the raw partition from one card to the other, remember that the target partition must be the same size (or bigger) than the source.
Frankly, I've had good luck reading raw partitions off an SDcard from the Plug.  I've had less success dding to a raw partition, for reasons I have never been fully able to understand.  It appears the writes, which are much slower than the reads, become increasingly backlogged, to the point where the copy grinds to a halt and never succeeds.  But, that was trying to copy one of the partitions to another on the same card.  Try it and see how it works on your system.  YMMV.

Good luck.
Logged

mail4asim
Newbie
*

Karma: 0
Posts: 39



View Profile
« Reply #7 on: January 13, 2010, 09:51:40 PM »

I would like to thank everyone for their input and tremendous assistance.


I ended up using G4L to clone the SD card and it worked very well. I read the instructions on this page and it's an easy way to replicate any drive.

http://www.oakdome.com/lab/?page_id=8

Logged

Kneerlemi
Guest
« Reply #8 on: February 01, 2010, 09:10:30 PM »

Looks like the Wolfman is going to have to make a 12" x 12" wallet.   This way Im covered as long as the ID card is under 1 ft.
Logged

Pages: [1]
Print
Jump to: