In preparation for our Alaska trip, Veronika received three free 64 GiB SD memory cards for her camera from a very nice, local cameraman. There was a problem, though. Her Nikon D80 camera had some trouble using them. The camera would prompt to format the cards, which she obliged, but following the format the camera showed zero pictures remaining. I thought that was a little strange until I did some Google searching. I realized that her camera can’t use a file system that has more than 32 GiB of storage.

Well, “that’s easy,” I thought. So I resized the partitions to just below 32 GiB, formatted them as FAT32, and tried again. It worked! Here’s the process I used on my Mac:

$ sudo fdisk -e /dev/disk3
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> print
Disk: /dev/disk3    geometry: 7585/255/63 [121864192 sectors]
Offset: 0    Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0C  256   0   1 - 1023 254  63 [      8192 -  121856000] Win95 FAT32L
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
fdisk: 1> erase
fdisk:*1> edit 1
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
Partition id ('0' to disable)  [0 - FF]: [0] (? for help) 0B
Do you wish to edit in CHS mode? [n] 
Partition offset [0 - 121864192]: [63] 
Partition size [1 - 121864129]: [121864129] 60932000
fdisk:*1> print   
Disk: /dev/disk3    geometry: 7585/255/63 [121864192 sectors]
Offset: 0    Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0B    0   1   1 - 1023 254  63 [        63 -   60932000] Win95 FAT-32
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
fdisk:*1> write
Writing MBR at offset 0.
fdisk: 1> quit

$ sudo diskutil eraseVolume ms-dos "ALASKA 1" /dev/disk3s1
Started erase on disk3s1
Unmounting disk
Erasing
newfs_msdos: /dev/rdisk3s1: newfs_exfat should be used for SDXC media
512 bytes per physical sector
/dev/rdisk3s1: 60902208 sectors in 1903194 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=63 drv=0x80 bsec=60932000 bspf=14869 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk3s1 ALASKA 1

Of course, use the proper block device. You can easily find what it is by running ls /dev/disk*, plugging in the device, and executing the same command again. The new device is the proper one to use.

This technique could be extended to other types of memory cards and devices. I have an 8 GiB CompactFlash card at home that I may try to hack to use in my Cisco devices as well.

If you try this for yourself and discover it doesn’t work under some circumstances, please let me know. I’d be interested in knowing more details.