Step-by-step CF/SD fdisk/formatting for newbies

From OESF

Step by step instructions for formatting CF/SD/MMC cards

To format a CF card as FAT16 (for flashing)

Note that those with Sharp ROMs will probably need to download fdisk from killefiz (try here http://www.killefiz.de/zaurus/showdetail.php?app=205). Those running OZ 3.2 may find that fdisk crashes out with a bus error, in this case, remove the current version and install the one from the unstable feed.

Then, running as root (for those with one of the new Sharp ROMs) do the following in a terminal:

umount /media/cf
fdisk /dev/hda (it will ask you for a command)
d (this will delete a partition)
1 (this will delete partition #1)
n (this will create a new partition)
p (this will create it as a Primary partition)
1 (Choses partition 1)
Enter (to take default start cylinder)
Enter (to take default end cylinder)
v (this will verify that the partition has been created)
t (to change partition type)
1 (to select partition 1)
6 (to select FAT-16)
w (this will save the table and exit the fdisk program)


Then from the terminal:

mkfs.msdos /dev/hda1 (this will format the partition with the FAT-16 file system)
mount /dev/hda1 /mnt/cf (this should mount the CF card, and show the CF card symbol on the icon tray at the bottom of the display).


To format an SD/MMC card as ext2

umount /media/card
fdisk /dev/mmcda (it will ask you for a command)
d (this will delete a partition - note that some SD disks may not have a partition to begin with, in this case skip straight to pressing 'n' to create a new one)
1 (this will delete partition #1)
n (this will create a new partition)
p (this will create it as a Primary partition)
1 (Choses partition 1)
Enter (to take default start cylinder)
Enter (to take default end cylinder)
v (this will verify that the partition has been created)
t (to change partition type)
1 (to select partition 1)
83 (to select ext2)
w (this will save the table and exit the fdisk program)


Then from the terminal:

mkfs.ext2 /dev/mmcda1 (this will format the partition with the ext2 file system)
mount /dev/mmcda1 /mnt/card

It should be fairly self-evident that to format a CF card as ext2 (or an SD card as FAT 16) swap the 83 and 6 in the appropriate places above.