After plugging in the SD card by USB, you have to figure out which device it is. I found this out by going to /dev/disk/by-id, searching for an id with a name that had "usb" in it, and then running the "file" command on that id (which is a file that is a symbolic link to the device we want. I suppose I could have used this file directly, now I think of it). It should say something like "/dev/disk/by-id/<name>: symbolic link to `../../sdb'". For me it was sdb. Once you know this, it's easy. Just run
- Code: Select all
sudo dd if=/dev/sdb of=~/sd-card-image.img conv=notrunc
One thing I had been trying to do before this is create an image from scratch, but I couldn't find a simple way to do this without downloading something. If anybody has an idea of how to take a zip full of files and convert it to an image, that would be cool. I know somehow the image needs to have a FAT filesystem, so I was wondering if there was some elegant way to create a filesystem image formatted to just the size to only hold the files inside it. Right now the image is 128 MB, since it's an image of the 128 MB SD card.