View: 4241|Reply: 5

Unable to clone sd card

[Copy link]

17

threads

48

posts

251

credits

Intermediate member

Rank: 3Rank: 3

credits
251
Published in 2016-1-3 11:07:16 | Show all floors |Read mode
I now have 2 Opi PCs.  Some time back, OPi #1, I downloaded Fedora 22, loaded the SD card, booted etc and it's been running great.  Then a week or so ago I got my second OPi.  I then put the SD card on my desktop and ran dd of=Fed22.img if=/dev/sdf ....  then reversed the process on to a new SD card.  My Fed22.img is 32Gb but the clone only outputs 5Gb and won't boot.  I've used the same process on a RasPi board and it worked like a charm.  Also when I mount the new SD card and go walk about I find coruption - bad card???

Any Thoughts
Thanks


4

threads

44

posts

165

credits

Registered member

Rank: 2

credits
165
Published in 2016-1-3 22:27:16 | Show all floors
I'm not exactly able to understand what you're trying to do. If all you want to do is clone a microSD card, then asumming that they're of  the same size or, the SD card onto which the clone is being written is bigger, All you need to do is mount both. Let's just say that the source SD card is "/dev/sdc" and the destination SD card is "/dev/sdd", simply type the following commands into the terminal and you'll be gold:

  1.     sudo dd if=/dev/sdc of=/dev/sdd
Copy code


Or on the other hand you could do the following if the SD card to which you're writing is smaller-:

  1.     sudo dd if=/dev/sdc of=~/clone.img # of, btw can be anything. It's the path to the img file that you're gonna rip off the SD card
Copy code


Then you can simply use fdisk on that img file to resize it, then dd it onto the SD card
This guide should be a better way to go about it - http://softwarebakery.com/shrinking-images-on-linux

17

threads

48

posts

251

credits

Intermediate member

Rank: 3Rank: 3

credits
251
 Author| Published in 2016-1-4 01:05:44 | Show all floors
Both microSD cards are 32gb
First with the orig card
dd bs=2M of=Fed22opi.img if=/dev/sdf oflag=direct  ; sync

then with the new card
dd bs=2M if=Fed22opi.img of=/dev/sdf oflag=direct  ; sync

All I want to do is make a 1:1 copy of orig card.

4

threads

44

posts

165

credits

Registered member

Rank: 2

credits
165
Published in 2016-1-4 04:01:45 | Show all floors
Are you sure your SD card is fine? Try copying a >10 Gig file. Note down its sha5sum. After copying the file to the SD card, remove it and then plug it back in, and then verify if the sha5sums match up or not. If they do match up, it'll be interesting to see what's happening

17

threads

48

posts

251

credits

Intermediate member

Rank: 3Rank: 3

credits
251
 Author| Published in 2016-1-5 02:29:40 | Show all floors
shahe_ansar replied at 2016-1-4 04:01
Are you sure your SD card is fine? Try copying a >10 Gig file. Note down its sha5sum. After copying  ...

I found this web site - has to do with some SD cards are phony.  That the lable says 16GB when the memory is only 2GB that overwrites 8 time - but you pay for 16.  So I created a 32GB urandom file and did the dd out, then a dd in to file.out   in = out.  So the card is good, well 32gb....  Althought I didn't do the checksum.  Will continue to smash forehead against screen

http://projects.nuschkys.net/201 ... d-card-under-linux/

4

threads

44

posts

165

credits

Registered member

Rank: 2

credits
165
Published in 2016-1-5 04:59:52 | Show all floors
Just do the checksum.... It'll save you a lot of headache, and no, it doesn't take (that) long.....
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list