Mike's PBX Cookbook

Formating FAT16

How to format a Compact Flash card to the older FAT16 file system (often required for older hardware) using a Mac.

1. Connect the CF card to the Mac using a USB card reader.
2. Open the terminal, and type diskutil list to list the connected devices:

$ diskutil list
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                            NONAME                 *1.0 GB     disk3   ← this one! 

3. Identify the external drive, and use its 'device identifier' in the following command:

diskutil partitiondisk /dev/disk3 1 MBR "MS-DOS FAT16" "NONAME" 0B

The arguments are as follows:

Note: list the supported partition types with the command: diskutil listFilesystems
MS-DOS (8-bit FAT), MS-DOS FAT12, MS-DOS FAT16, MS-DOS FAT32 and ExFAT are supported.

CAUTION! This procedure refers to disk3, but your device identifier can be different. Check it first!

For example:

$ diskutil partitionDisk /dev/disk3 MBR "MS-DOS FAT16" "NONAME" 0B
Started partitioning on disk3
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk3s1 as MS-DOS (FAT16) with name NONAME
512 bytes per physical sector
/dev/rdisk3s1: 2001344 sectors in 62542 FAT16 clusters (16384 bytes/cluster)
bps=512 spc=32 res=1 nft=2 rde=512 mid=0xf8 spf=245 spt=32 hds=128 hid=2 drv=0x80 bsec=2001886
Mounting disk
Finished partitioning on disk3
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *1.0 GB     disk3
   1:                 DOS_FAT_16 NONAME                  1.0 GB     disk3s1
$

A specific size:

To create a specific size drive, eg 64 Meg:

  1. Two partitions, NONAME1 (64meg) and NONAME2 (all remaining space):

    diskutil partitionDisk /dev/disk3 MBR "MS-DOS FAT16" "NONAME1" 64M "MS-DOS FAT16" "NONAME2" 0B

  2. One 64meg partition, the remainder as free space (free space still requires a name in quotes):

    diskutil partitionDisk /dev/disk3 MBR "MS-DOS FAT16" NONAME 64M free "" 0B

Though "MS-DOS FAT16" is shown, change this string to "MS-DOS FAT32" to create a FAT32 partition.
 - list the supported partition types with the command: diskutil listFilesystems

Use diskutil list to display the partition scheme:

$ diskutil list disk3
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *1.0 GB     disk3
   1:                 DOS_FAT_16 NONAME                  64.0 MB    disk3s1

Note, disk3 refers to the entire disk, whereas disk3s1 refers to partition 1 on disk 3. The letter 's' means 'slice' (partition).
When finished, unmount and remove the disk (or "eject" it in the finder):

$ diskutil unmountdisk disk3
Unmount of all volumes on disk3 was successful

You can do the same thing in Windows, by using the diskpart command.

Alternate method:

Unmount the disk, and use the following command to reformat the first partition:

sudo newfs_msdos -F 16 /dev/disk3s1

The F option specifies the FAT type, which can be 12, 16, or 32. Type man newfs_msdos for other option details.