Translations of this page:

Formatting Secure Digital Cards

Formatting your SD(Secure Digital) card is fairly simply. In the default OS “Xandros” it can only be done from the command line, which you can bring up with <Alt><Ctrl><T>.

The Easy GUI way

This section needs fixing.

NOTE This section describes how to PARTITION the card NOT format it, and possibly should be moved to different page.

Also this is NOT a gui utility cfdisk is a TERMINAL partitioning utility.

For beginners you may want to try to use the GUI'ed formatting utility:

*initial 2 steps shown to me here http://forum.eeeuser.com/viewtopic.php?id=5548 by HaaTa

Press “Ctrl+Alt+T” to get to the command line then type:

sudo -i

to ensure you have admin privileges

/dev/sdb should be your SD card. To be sure in console type:

df -h

which will show you a menu to verify which device is mounted where… We'll continue with /dev/sdb as your MMC/SD card reader Type:

/sbin/cfdisk /dev/sdb

This will bring up the 'cfdisk' console, where you can use arrows to move back and forth between the options listed at the bottom. For a clean format it FAT32 mode:

Use the up and down arrows to switch to any of the paritions shown and use the side arrow keys to select delete, confirm. Wait for the utility to finish the operation, and then repeat for any other defined parition.

Now you should be on the only partition showing (FS type: free space)

  • Select 'New' and hit enter
  • Select primary and hit enter
  • If you want only one partition, the size shown should equal the total size available, so just hit enter
  • Select the 'bootable' flag and hit enter
  • Move the cursor to the right until you reach “type” and hit enter
  • This shows the options, hit 'any key' to display the rest of the options, and where it says “Enter filesystem type” type in '0c' (that's a zero not an O)and hit enter.
  • Move the cursor to the “Write” option, hit enter, type yes, and hit enter

Wait 10 sec for it to finish, and then quit.

Congratulations, you're done! Reboot and everything should show up properly.

Alternatively, you can use the individual command line methods as shown below.

The Command Line way

Windows Fat32

Fat32 is best for general compatibilty for both windows, linux, and Mac. It is however limited to roughly 4 gig file sizes, and NO permission/ownership flags.

First become a “super user”

sudo -i

Xandros auto mounts the SD card when it's first inserted, so you will need to unmount it.

umount /dev/sdb1

Now that our SD card is unmounted we can format it.

mkdosfs -F 32 -n XXX /dev/sdb1

Replace “XXX” in the above with the volume name you want. If you want spaces, put the name in quotes. A volume name can be up to 11 characters in length. If you don't want a volume label, omit the ”-n XXX” entirely.

The characters ”<NAME>” will be used in the other sections below to stand for your chosen volume name.

Windows Fat16

Fat16 should be used when you need isolinux or any other bootloader/program that doesn't support fat32. You should note that it's limited to roughly 4 gig PARTITION and file sizes, and NO permission/ownership flags.

First become a “super user”

sudo -i

Xandros auto mounts the SD card when it's first inserted, so you will need to unmount it.

umount /dev/sdb1

Now that our SD card is unmounted we can format it.

mkdosfs -F 16 -n <NAME> /dev/sdb1

Linux Ext2

Ext2 is a good file system for linux when its used on the sd card. It should be noted however that in windows ext2 requires special drivers to use, so if you are going to be using the card in windows as well either find/install said drivers or use a different file system.

First become a “super user”

sudo -i

Xandros auto mounts the SD card when it's first inserted, so you will need to unmount it.

umount /dev/sdb1

Now that our SD card is unmounted we can format it.

mkfs.ext2 -L <NAME> /dev/sdb1

Finally, we will change the way the system has to mount the SD card so that the access to it is faster (otherwise, you will notice it is very slow due to the ext2 original settings). For this, just edit the file /sbin/probedevice:

sudo kwrite /sbin/probedevice

Find the following line:

*Ext2*)            options="ext2,rw,user,sync,suid,dev,exec";;

and modify it so it becomes:

*Ext2*)            options="ext2,rw,user,noatime,suid,dev,exec";;

Note that for Eee PC 900 the usbstorageapplet that automounts the removable devices, does not follow the above. One way to deal with it, is to use a manual script such as the one below, to remount your ext2/ext3 devices:

#!/usr/bin/perl

@mtab=`sudo cat /etc/mtab`;

foreach (@mtab) {
    if (/(.+) \/media\/(.): ext/) {
        system "sudo umount $1";
        system "sudo mount $1 /media/$2: -o rw,noatime";
    }
}

save the file giving it any name you want (e.g. “sd” ), then do a

chmod 777 sd
sudo cp sd /usr/bin/

Now, the command “sd” will remount your ext devices with the options “rw,noatime”. If you only wish the script to remount a specific device (e.g. /dev/sdc1 for the SD drive), you can add the device in the first parenthesis of the matching expression. So the if line would be:

    if (/(.+sdc1) \/media\/(.): ext/) {

Linux Ext3

The primary differences between ext2 and ext3 is that ext3 is a journaled file system. Although journaled file systems are considered superior to non-journaled file systems, It is not generally suggested for small flash based media.

First become a “super user”

sudo -i

Xandros auto mounts the SD card when it's first inserted, so you will need to unmount it.

umount /dev/sdb1

Now that our SD card is unmounted we can format it.

mkfs.ext3 -L <NAME> /dev/sdb1

Linux Minix

Minix is an older and fairly compact file system, so it will generally take less space. It should be noted that minix can not be read or written to by windows

First become a “super user”

sudo -i

Xandros auto mounts the SD card when it's first inserted, so you will need to unmount it.

umount /dev/sdb1

Now that our SD card is unmounted we can format it.

mkfs.minix /dev/sdb1

Others

Eeepc Xandros also supports cramfs(mkfs.cramfs) however it is designed to create compressed images rather then formatting a partition.

Further reading

The help command:

man mkdosfs

explains all the gory details of the mkdosfs command, and will be interesting reading if you have unusual formatting needs (for example, formatting a 4G card as fat16 for use in some digital cameras, bad block checking, etc.)

For detailed information about the mkfs.* commands, run

man mkfs
 
howto/format_sd.txt · Last modified: 2008/06/03 15:13 by ecuador
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
This website is no longer under a Creative Commons license.
All rights are reserved by Eeeuser.com and each individual author
If you want to reproduce content, all individual contributers must be identified and you must seek permission from Eeeuser.com