Difference between revisions of "MicroSd"
Aqisecoxefi (Talk | contribs) |
|||
Line 1: | Line 1: | ||
+ | ---- | ||
+ | <div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> | ||
+ | ---- | ||
+ | =[http://imyqokyf.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]= | ||
+ | ---- | ||
+ | =[http://imyqokyf.co.cc CLICK HERE]= | ||
+ | ---- | ||
+ | </div> | ||
It is possible to duplicate a microSD using a few simple tools in Linux. This can be useful once you have a known good image that you want to replicate for a bunch of Gumstix COMs. | It is possible to duplicate a microSD using a few simple tools in Linux. This can be useful once you have a known good image that you want to replicate for a bunch of Gumstix COMs. | ||
Line 15: | Line 23: | ||
===Creating a compressed image=== | ===Creating a compressed image=== | ||
You can also compress the image on disk but be warned that you need to do this as the root user. | You can also compress the image on disk but be warned that you need to do this as the root user. | ||
− | dd if=/dev/sourcecard bs=1M | gzip -c | + | dd if=/dev/sourcecard bs=1M | gzip -c > somefile.gz |
gunzip -c somefile.gz | dd of=/dev/destcard bs=1M | gunzip -c somefile.gz | dd of=/dev/destcard bs=1M | ||
To make even smaller image files, zero out all remaining space on your microSD card partitions before doing the two steps above. For example, let's say your Ext3 partition is mostly empty and is mounted at /mnt/card_ext/. | To make even smaller image files, zero out all remaining space on your microSD card partitions before doing the two steps above. For example, let's say your Ext3 partition is mostly empty and is mounted at /mnt/card_ext/. |
Revision as of 15:45, 23 November 2010
It is possible to duplicate a microSD using a few simple tools in Linux. This can be useful once you have a known good image that you want to replicate for a bunch of Gumstix COMs.
The Use-Cases below assume a source card found at /dev/sourcecard and a destination card at /dev/destcard. Note, you can use 'dmesg' or 'mount' to confirm the actual mounting location; they are probably something like /dev/sde. Also, we are interested in the actual card device (e.g. /dev/sde) rather than the block devices representing any partitions it may have (e.g. /dev/sde0, /dev/sde1).
Creating a Basic Card Image
dd if=/dev/sourcecard of=/home/user/masterimage.img bs=1M dd if=/home/user/masterimage.img of=/dev/destcard bs=1M
Specifying a block size of 1MB should speed up the transfer.
If you happen to have two microSD slots so both cards are simultaneously available, you can do a direct copy:
dd if=/dev/sourcecard of=/dev/destcard bs=1M
For touchscreen boards, you'll redo the calibration for each board. Be sure to remove the /etc/pointercal file from the master image.
Creating a compressed image
You can also compress the image on disk but be warned that you need to do this as the root user.
dd if=/dev/sourcecard bs=1M | gzip -c > somefile.gz gunzip -c somefile.gz | dd of=/dev/destcard bs=1M
To make even smaller image files, zero out all remaining space on your microSD card partitions before doing the two steps above. For example, let's say your Ext3 partition is mostly empty and is mounted at /mnt/card_ext/.
dd if=/dev/zero of=/mnt/card_ext/mybigfile rm /mnt/card_ext/mybigfile
Note for large cards, it may be faster to create a script to format the card (see [1] for hints) and copy over the required files.
Thanks to Dave Hylands, Ananth and Coderone for their mailing list replies and to Doug Gibbs who posed the original question. See thread for the full discussion.