Power to the People of Iran



Hello...
..and welcome to eeeGadgets! This blog is dedicated to everything associated with the wide (and interesting) field of mobile computing. The main focus is on presenting all the various hardware modifications I made to my eeePC, but I will also give short reviews of other interesting Mobile Internet Devices I come across. Further I want to share some tips and tricks I found out to be helpful in getting the most performance out of Ubuntu linux...
On the right side under "LABELS" you can navigate between various assorted article categories. Also, on the very bottom of the site you will find some useful weblinks, as well as a small broadband connection speed test (which can be very useful sometimes).
If you want to, you can subscribe to my RSS news feed too, to be always up to date about my latest articles - simply click on "subscribe now!" in the little box on the right side. Alternatively, you can subscribe to my simple email newsletter by clicking here.
For questions, feedback, suggestions, criticism and everything else, don't hesitate to contact me:
emailfuerdennis@web.de

....have fun reading!

If you like my site and want to support me , you can always donate to my personal "coffee funds" using the PayPal "donate" button further down on the right! :)
Dennis

Thursday, March 26, 2009

HowTo: formatting SD cards using linux

Its nice to see that during the past year, the number of linux distributions custom tailored to fit the needs of netbooks has increased dramatically. While this is a great advancement, it cannot be denied that this is mainly the merit of one linux distribution - ubuntu linux, on which most of nowadays "netbook linux" are based (ubuntu in turn is debian-based, btw).
While these custom netbook linux flavors usually come equipped with all the device drivers you'll need for your netbook, there's one thing that is missing (at least in Ubuntu 8.04 or "Ubuntu eee"): an easy possibility of formatting SD memory cards with the usual FAT16 (or the faster FAT32) file system with the card reader that is built into all eeePC models - but sometimes you just need an empty and freshly formatted SD card, for example to "burn" the newest ubuntu ISO image onto and install right from the SD card (which is quite handy if you don't have a DVD/CD drive).

So, what to do? The easiest way I found is to use the command line tool "mkdosfs" for this purpose.

In order to have "mkdosfs" format your SD card so you can use it in your camera or MP3 player, we first need to find out how the SD card reader drive is currently called on your system, this is done by simply inserting your SD card, waiting a few seconds until your PC has recognized it, opening up a terminal window and typing

sudo df

which gives an output similar to the following


So in my case "/dev/sdb1" is how the SD card reader is called: I know I have an empty 4GB SD card inserted, and "Available:3981704" and "1K-Blocks:3981708" tell me that the last entry (almost) matches this size and is almost empty too, so this is my device I'm looking for.

Next step needed is to unmount your sd card since you cannot format any storage devices while they are mounted:

sudo umount /dev/sdb1

and then format the SD card (of course this erases all previous data stored on it) with either FAT16 or FAT32 as you need:

sudo mkdosfs /dev/sdb1 -F16
(for formatting with FAT16)

or

sudo mkdosfs /dev/sdb1 -F32
(for FAT32)

Now you just need to re-mount the SD card (easiest way is to simply take it out and re-insert) and you're ready to store your data on it again.

In future ubuntu versions it will most probably be possible to format SD cards with graphical GUI and mouse clicks too (like it should be), but any ubuntu 8.04 user having tried to format SDs with FAT file system can still benefit from this howto I bet.

8 comments:

Anonymous said...

Dennis, thx for your clear description. It worked though there seems to be a but: My card is 2GB. Somehow ubuntu only detects 1GB. And when I use the above method, 1GB is formatted. When I try to copy my MP3's to it, it says that there is no space left after some 416MB. Any idea?

Dennis said...

Strange - I don't have this problem with formatting 2GB SD cards. Maybe your sd card is defect?

Anonymous said...

Possibly. somehow ubuntu only sees one partition and when I try to copy my MP3s to the SD Card, it puts it on top of each other. Never seen a thing like it. One music starts and after a couple of seconds another music starts while the originals on the HD all play fine.

Anonymous said...

It gets even weirder: partition editor says sde1 is fat16, fdisk says it's fat32. Is it possible to have created to partitions with the same name but with different formatting?

Dennis said...

http://www.amazon.com/SanDisk-Memory-SDSDB-2048-A11-Retail-Package/dp/B0009RGLSE

A brand new 2GB sd card from well-known producer, costs $4.34 excl. s + h
May be the easier way ;)

Dennis said...

oh - and if I recall correctly, Linux isn't able to read FAT32 at all. Maybe try to re-format the whole as one single FAT16 partition with windows, then have a look at it with linux too. Maybe it helps, who knows.

Smith said...

Hi friends,

this post is very useful and very interesting to read, Really this blog is nice information about blu ray techniques,Keep it up.
SD Cards

Dennis said...

Oh, I think I never wrote anything about Blu Ray at all - you're sure you didn't mix up things a bit maybe?

Broadband Connection Test:

Just click on "Speedtest starten" to evaluate your actual downlink in MBit/sec (takes 10 seconds approx.)


(c) dsl-speed-messung.de - DSL Speed Test