FAT16 partitioning with size limit

Discussion in 'OS X Mavericks (10.9)' started by macstatic, Apr 7, 2017.

  1. macstatic macrumors 6502a

    Joined:
    Oct 21, 2005
    #1
    I need to partition a CF memory card to FAT16 standards for cross compatibility between my Mac and a vintage computer (for file-transfers), but the partition needs to be 32 MB or smaller (obviously my CF-card isn't that small!).

    I've found out that Disk Utility doesn't do FAT16 (did it support this in earlier versions of OSX? I seem to recall it did, also 720KB floppy disks), but read this and this online info which explains how to do it from the terminal command line. If I've understood it right, this is what I should do (from the Terminal window)

    First, figure out the disk identifier (look for the same name of the disk as you see on the Finder desktop):
    Code:
    mount
    (an easier option IMHO is simply open up Disk Utility, click on the CF-card drive (the list over all attached drives on the left hand side) and click on the "Info" button on the top of the window. It should be something like "disk5" meaning the drive path would in this example be /dev/disk5).

    Next, issue the entire command to partition said drive (be 100% sure you've got the right drive so you don't erase another one instead) to a single FAT16 partition sized at 32 MB :
    Code:
    diskutil partitiondisk /dev/disk5 1 MBRFormat "MS-DOS FAT16" "USB_CARD" 32M
    So why does this still partition the card to the full, available size instead of just 32 MB?
    This is the feedback I'm getting when I issue the above command:
    Code:
    Started partitioning on disk5
    Unmounting disk
    Creating the partition map
    Waiting for the disks to reappear
    Formatting disk5s1 as MS-DOS (FAT16) with name USB_CARD
    512 bytes per physical sector
    /dev/rdisk5s1: 501144 sectors in 62643 FAT16 clusters (4096 bytes/cluster)
    bps=512 spc=8 res=1 nft=2 rde=512 mid=0xf8 spf=245 spt=32 hds=32 hid=63 drv=0x80 bsec=501669
    Mounting disk
    Finished partitioning on disk5
    /dev/disk5
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *256.9 MB   disk5
       1:                 DOS_FAT_16 USB_CARD                256.9 MB   disk5s1
    
     
  2. keysofanxiety macrumors 604

    keysofanxiety

    Joined:
    Nov 23, 2011
    #2
    Could you partition the drive normally through Disk Utility and make one a 32MB partition, and the other partition the rest of the drive? Then run the eraseDisk command rather than the partition command, which should hopefully just erase that 32MB partition into the format you want.

    Doesn't matter about the format for now; the 32MB partition can be FAT32 as it'll be getting erased again later.

    Once you've formatted/partitioned your drive in Disk Utility to your satisfaction (should be much more intuitive than through the Terminal!), you can run diskutil list in Terminal and note the identifier rather than the entire disk. The identifier you're looking for will of course be the 32MB volume, probably called disk5s1 or disk5s2.

    Also the identifier should be written the end of the command, rather than right at the start. For instance, if the identifier of the 32MB partition is called disk5s1, the command would look like:

    diskutil eraseDisk 1 MBRFormat "MS-DOS FAT16" "USB_CARD" /dev/disk5s1

    I'll be honest though, I'm winging this heavily as I haven't any experience with what you're trying to do. I don't even touch Terminal for formatting. So forgive me if it doesn't work or if I'm coming across as a massive buffoon; at the very least, hopefully something I've said might inspire another idea :oops:
     
  3. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #3
    It's a good idea, but I get the following error message for some reason:

    Code:
    $ diskutil eraseDisk 1 MBRFormat "MS-DOS FAT16" "USB_CARD" /dev/disk5s1
    Unknown partition scheme: MS-DOS FAT16
    $ 
    Is there a way I could do all of this in one step?
     
  4. keysofanxiety macrumors 604

    keysofanxiety

    Joined:
    Nov 23, 2011
    #4
    OK, could you try to unmount the 32MB partition in Disk Utility? Not eject, just unmount. Then in Terminal try:

    newfs_msdos -F 16 "USB_CARD" /dev/disk5s1

    Any luck? If not, just try:

    newfs_msdos -F 16 /dev/disk5s1
     

Share This Page