Formatting cards Howto ---------------------- Q: My cards are formatted when I get them, so why would I want to format them in a different way ? A: The answer is quite simple : Most cards come formatted as fat (dos or windows file-system), If you want to use them on linux, you'd better format them as ext2 (or ext3) because unix uses filetypes that can't be used on fat-formatted file-systems. The best example of this are symlinks. To install ipkgs to a card or to compile from source, the card has to be formatted ext2 or ext3. Q: Can I just reformat the card ? A: Yes and no. If you just reformat the card, you won't be able to access it from your windows computer. If you don't need this, you can just reformat. If you still want to be able to access (a part of) it from a windows computer, you'd better repartition the card first. Repartitioning: --------------- The goal of repartitionning is dividing the card into seperate filesystems. The command we use for this is "fdisk". Make sure the card you want to repartition is unmounted: # umount /mnt/cf (for cf-card) # umount /mnt/card (for sd-card) # umount /mnt/ide (for internal disk) The cards or the internal disk might already be divided, then you'll have to unmount more filesystems, use "df" to see what is mounted. Repartitionning sd-card: fdisk /dev/mmcda (on C3100, check with df to know what it is on your system) fdisk /dev/mmcd/disc0/disc (on C860, check with df to know what it is on your system) Repartitionning cf-card: fdisk /dev/hda Repartitionning internal disk: fdisk /dev/hdc The commands in fdisk : 2 after the prompt: p (to see what partition is there) after the prompt: d (if applicable, to remove the existing partition) after the prompt: 1 (for the number of the partition) after the prompt: n (to create a new partition) after the prompt: p (to make it primary) after the prompt: 1 (chooses partition #1) after the prompt: (to choose default start at 1) after the prompt: (to use the default end sector) after the prompt: v (to verify the partition) after the prompt: t (to change the partition type) after the prompt: 1 (select partition #1) after the prompt: 83 (selects ext2) or 6 (selects fat) after the prompt: w (writes the partition and the program exits) Formatting the cards -------------------- To format the first partition of an SD-card as ext2: mkfs.ext2 /dev/mmcda1 (on C3100) mkfs.ext2 /dev/mmcd/disc0/part1 (on C860) To format the second partition of a CF-card as fat : mkfs.msdos /dev/hda2 I hope you're seeing the logic in this. To remount the sd-card with two partitions again (on C3100): # mount /dev/mmcda1 /mnt/card # mount /dev/mmcda2 /mnt/card2 (create this dir first using "mkdir /mnt/card2") The same way you can do this for CF-cards or harddisks. To remount the sd-card with two partitions again (on C860): # mount /dev/mmcd/disc0/part1 /mnt/card # mount /dev/mmcd/disc0/part2 /mnt/card2 (create this dir first using "mkdir /mnt/card2") If you created the mountpoints, you can also just pull out the card and re-insert it. The different partitions should mount automatically. (don't try this way with the internal hard-disk). MAKE SURE NOTHING FROM THE CARD IS MOUNTED BEFORE YOU PULL IT OUT. Have fun.