the itjerk

my adventures with technology

Tag Archives: card

raspberry pi and sd cards

As much as I'm enjoying my Raspberry Pi, I've come across one big issue: the SD card has failed twice now. Even though I'm using a "verified" card from this list, it keeps getting corrupt to the point where my RPi won't boot. Why is this? Just a bad card? Voltage on the board checks out okay, I use "sudo halt" to shut down cleanly, I don't manhandle the cards… so maybe it's from overclocking? Fortunately cards are cheap, and I'm not adding a whole lot to the standard Wheezy distro.

Here's how to backup and clone a SD card with Ubuntu. First, mount the SD card, then find out its device name in /dev/ by using ls. (You can also use "sudo fdisk -l").

ls -al /dev/sd*
... 
brw-rw---- 1 root disk 8, 32 Jan 15 18:50 /dev/sdc
brw-rw---- 1 root disk 8, 33 Jan 15 18:50 /dev/sdc1
brw-rw---- 1 root disk 8, 34 Jan 15 18:50 /dev/sdc2

That known (and correct), unmount the disk and use the dd "convert and copy" command to clone an image of the card to a bin file. NB: This isn't the fastest operation (we're talking SD cards) and dd doesn't display a progress bar. It will however give you a summary of the transfer when completed.

sudo umount /dev/sdc*
sudo dd if=/dev/sdc of=~/sd-card.bin bs=1M

Finally, put in a new SD card, verify the device name (again), then issue the same dd command, but in reverse. Note your SD cards must be the or larger than your image. Be patient!

sudo dd if=~/sd-card.bin of=/dev/sdc

Another hint I found is to go into /etc/fstab and add "sync" to allow immediate writes.

/dev/mmcblk0p2  /               ext4    defaults,[B]sync[/B],noatime  0       1

Finally, I picked up a "class 10" SDHC card to give a try (much faster writes).

On the web:
Copying an image to the SD card in Linux (command line)

Other option:
dcfldd
dd if=/dev/sdx | gzip > /path/to/image.gz
gzip -dc /path/to/image.gz | dd of=/dev/sdx

Advertisement

flash memory card

My first purchase for the Nokia 770 Internet tablet was a new RS-MMC flash card. The unit comes with a 64MB card, but that's for little use other than creating a virtual memory swap-file. The unit itself has around 64MB of storage of userspace, so obviously adding another gig for music, pictures, movies whatever is a must.

Newegg had a 1GB card from PQI for around $27 delivered, and I had my new flash card in a few days time. Even though the card is MMC-Mobile, its fully RS-MMC compliant. Transfers to and from the card a stable although a little slower than with a SD card. In order to enable the virtual memory swap-fle, just open the Control Panel and click on Memory. When connected to any computer via a USB cable, the 770 shows up as a removable storage drive.

So, that's about the only thing I'll be purchasing for this, except for perhaps a keyboard…

Here's the link to Newegg:
http://www.newegg.com/Product/Product.asp?Item=N82E16820141049