Formatting fat32

From LinuxNewbie

When I began to format an external hard drive I ran in to a problem with it formatting at full capacity. Keeping in mind I want it to work natively in Windows and Linux and since the "normal" format on most memory cards and external drives is fat32, that is what I was attempting.
IMPORTANT: If you use serial ata (sata), scsi drives or have multiple usb drives attached your drive name will be different. It will not be /dev/sda.

First, I must partition.

fdisk /dev/sda1

To get a list of partitions, type "p" (print)

Command (m for help): p

Disk /dev/hda: 6448 MB, 6448619520 bytes
15 heads, 63 sectors/track, 13328 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       13328     6151005    c  W95 FAT32 (LBA)

This is an example, and the math won't add up on the Blocks in my example.
My drive did not already have a table. To remove the partition you use "d".
To add a new partition, use "n". Since this is the only partition, chose primary and make it partition 1

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
Partition number (1-4): 1

Then use "t" to change the type to "c" (W95 FAT32 (LBA)).
Then use "w" to write the changes and return to a command prompt.

To format:

mkdosfs -F 32 /dev/sda1

This means format FAT32, and the first sda device (presuming this is the one you partitioned), the first partition.
This takes only a moment and you are done. Not so hard, huh?