Formatting SD Card on Ubuntu

This is a post just to remind me about the steps needed to format an SD Card on Ubuntu 9.10. I just got a class 4 8GB Kingston SD Card to replace the 1GB Stock SD Card on my G1. Since I’m using a rooted ROM (this one to be precise), I need an ext+fat+swap partition setup on my SD Card. I needed to format the new card identical to the old one and copy the old data onto the new card.

First of all, Ubuntu has a very weird delayed write mechanism that writes data to plugged in devices only when you eject or unmount them. So, if you write something to the card and pull it out, there’s a very good chance that it doesn’t show up. I haven’t seen this anywhere before, especially when using gentoo earlier.

GParted doesn’t display my card which is /dev/sdb. (Update in comments below) So, I decide to use the command line for this. There are three command line utilities for formatting, i.e. fdisk, cfdisk, sfdisk.

cfdisk gives you a UI so that you can select everything using arrow keys. But for some reason, when creating the partitions, it kept creating them as /dev/sdb1p1, /dev/sdb1p2 and /dev/sdb1p3 instead of /dev/sdb1, /dev/sdb2, /dev/sdb3. This kept the disk from showing up when listing the partition table with sudo fdisk -l. Didn’t really investigate why it was doing that. Checked out sfdisk, but the commands are different and looked like I’d need to learn a bit more before I could use it.

So, finally came down to fdisk which is quite handy once you get used to it. Important commands are ‘m’ which displays all the commands and ‘p’ which prints the partition table. So, first created the partitions using ‘n’ and setting them up as 7.4GB win95 fat32 (code ‘b’), 500MB ext3 (code ’83’), remaining 30+MB swap (code ’82’). The file system type can be set using ‘t’ and the codes obtained using ‘L’. The partition table is written using ‘w’.

Now, we need to format the different partitions with the corresponding file systems. This is done as follows:

  • Fat32: sudo mkfs.vfat /dev/sdb1
  • Ext3: sudo mke2fs -j /dev/sdb2 (the -j is required for ext3. Omit it for ext2)
  • Swap: sudo mkswap /dev/sdb3

Once this is done, you should immediately be able to see the different partitions in Nautilus.

Frustrated with gmail offline on ubuntu

I’m so tired of gmail’s bugginess with gears on Ubuntu.  It behaves in the most erratic and unpredictable manner. Ironically, the problem arose when I was sending a mail while I was online and was almost a disaster. Email attachments are not attached always when sending with offline enabled. I found this out the hard way. Also, every now and then I see a pop-up message saying “Google gears is not compatible with your build …” yada yada yada. Sometimes it works, sometimes it doesn’t. I’m also a heavy user of google docs offline, but this unreliability is killing me. So, as of today, I’m off to Thunderbird 3 for all my offline email solutions.

With google docs, I really like the idea of one copy with multiple editors and being able to edit docs offline. But with google gears being so buggy on ubuntu and with Google officially declaring there will be no further development on gears, I don’t know if I can keep using it. If anyone knows of a similar arrangement that works with OpenOffice docs or with any online doc editor with good offline capabilities, please let me know.


After googling for Google docs alternatives, I found the following websites:

Apparently, Zoho is a suite of rich office applications which provides both online and offline editing of documents. The interface looks very good and it appears to have many more features than google docs. Although offline editing is limited to the most recent 25 docs that you edited, it still looks very promising. Unfortunately, it uses google gears as well which leaves me at the mercy of that bug-ridden utility. But nonetheless, as of today, I’m going to start using Zoho and see how it works as an alternative to google docs!