Most images released for Mele A1000 (Ubuntu, Puppy Linux..) won’t fit in my SD card, and until now I had to manually partition the SD card, extract the data and copy it to the SD card.
I’ve also noticed the size of the SD card slowly creeps lower overtime. I bought an SD card last week and fdisk reported 3901685760 bytes and this morning the same command reported 3898782720 bytes. That’s probably due to new bad sectors which I believe is actually normal for this type of device. The problem is that a backup of “last week” SD card done with dd might not be restored properly with dd since the SD card is now smaller.
So I decided to write a shell script “makeSD.sh” that will do the following:
- Umount the SD card if needed
- Partition the SD card
- Copy uboot to the SD card
- Mount the image file and SD card partitions
- Copy the files between the image file and SD
- Cleanup the mess, i.e. umount the partitions and delete the mount points.
The command line is as follows:
./makeSD.sh device image
First, you’ll need to install parted and kpartx:
sudo apt-get install parted kpartx
I tried it with Puppy Linux image in a machine running Ubuntu 12.04:
7z x mele-sd-4gb-lui-5.2.90.img.xz
./makeSD.sh /dev/sdb mele-sd-4gb-lui-5.2.90.img
You can get the script on github.
Bear in mind that this kind of tools can be dangerous and wipeout your system if you use the wrong device or there is a bug in the script. So use it at your own risk.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
|Support CNX Software - Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples|