The Z CAM E2 Is a Picky Eater
Despite the suggestions in the Z CAM Facebook group to format storage media using GPT, I could never get my E2-M4 to accept any of the GPT/exFAT drives I formatted in Disk Utility on macOS Monterey (12.1).
TL;DR (for the technically inclined): For drives to work with the Z CAM E2, the exFAT partition should be formatted with 512 bytes per sector and 2048 sectors per cluster (1048576 bytes per cluster). On macOS, this can be done by running this command (make sure to replace the volume identifier, /dev/rdisk3s1
in this example, with your own) in Terminal:
sudo newfs_exfat -R -S 512 -a 8064 -b 1048576 -c 2048 -n 1 /dev/rdisk3s1
When I first received the Z CAM E2-M4, I had an Anker “PowerExpand 8-in-1 USB-C PD 10Gbps Data Hub” (apparently now called the “Anker 555 USB-C Hub” as of this writing) to connect SD cards or a 1TB M.2 NVMe SSD in a USB-C enclosure to the camera. Though I trust a direct connection without a hub is likely to challenge me with fewer compatibility nightmares, I love having other USB ports open so I can use my iPhone as a monitor with the Z Camera app over a wired connection. Going wired just works faster and more reliably—at least in my experience—than connecting over Wi-Fi. I’d venture to guess I would’ve never spent the time and effort to figure all this out if I were just a little less stubborn about wanting use a hub… or if Z CAM’s documentation were more comprehensive, even more than the (finally!) recently published User Manual v0.4 for Firmware 0.98.
Funnily, the E2 is a picky eater. Upon plugging in external storage formatted with a GPT and an exFAT partition to its USB-C port, the M4 would prompt me to “optimize” the drive; otherwise, it would disable recording like a rebellious child refusing to eat their veggies. After I accepted this fate, the camera would swiftly reformat the connected drive with an MBR instead of a GPT (ah, the child sprung for the candy). For a long while, I never gave this turn of events a second thought. That is, until I parted with my trusty ol’ Anker USB-C hub and came to own a new one: the LDLrui 7-in-1 USB-C Hub.
Armed with this new USB-C hub, I plugged a borrowed SD card in one day, and as expected, the prompt to reformat popped up. That’s when the blessings by Z CAM’s engineers of my setup ended.
“Failed to format card!”
It seems the M4 cannot format any storage media connected through my new USB-C hub. Connected directly, the camera offers no complaints and successfully reformats my external SSD; connected through the hub, no such luck. Now, this formatting silliness was really beginning to push my cortisol (and sadness) levels.
Logically, I decided to dig a little deeper and find out exactly how Z CAM was formatting my USB-C SSD to be ”optimized” in the hopes I might at last be able to format drives on macOS and have them just work once connected to the camera. Long story short: a few boot sector reads and hours of tabbing between exFAT file system specification sections later, I determined how to format exFAT volumes to Z CAM’s taste on macOS.
Formatting Guide
- Launch the Terminal app (use Spotlight or find it in Applications > Utilities).
- If you have not yet installed Homebrew on your Mac, install Homebrew first.
- With Homebrew installed, we can now install GPT fdisk:
alex@apfelstrudel ~ % brew install gdisk
- Next, we need to find the device node of the drive. Note you won't get visual feedback as you type your password; press return after you input your password and hope you didn't make a typo.
alex@apfelstrudel ~ % sudo diskutil list Password: /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *250.1 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 249.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +249.8 GB disk1 Physical Store disk0s2 1: APFS Volume macOS - Data 167.2 GB disk1s1 2: APFS Volume Preboot 439.6 MB disk1s2 3: APFS Volume Recovery 1.1 GB disk1s3 4: APFS Volume VM 2.1 GB disk1s4 5: APFS Volume macOS 16.4 GB disk1s5 6: APFS Snapshot com.apple.bless.3DAC... 16.4 GB disk1s5s1 /dev/disk3 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 GB disk3
The external drive is the one I want to format, so for this example my device node will be /dev/disk3. Your identifier may be different, so make sure to replace the following disk IDs with your own, or else you might overwrite data on other drives!
Open the raw device using gdisk.
alex@apfelstrudel ~ % sudo gdisk /dev/rdisk3 GPT fdisk (gdisk) version 1.0.8 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT.
- At the prompt for a command, create a new GPT and confirm.
Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): y
- Now, add a Microsoft basic data (type code 0700) partition. We will use the defaults for most of the options by leaving them blank and pressing return.
Command (? for help): n Partition number (1-128, default 1): First sector (34-1966046, default = 2048) or {+-}size{KMGTP}: Last sector (2048-1966046, default = 1966046) or {+-}size{KMGTP}: Current type is AF00 (Apple HFS/HFS+) Hex code or GUID (L to show codes, Enter = AF00): 0700 Changed type of partition to 'Microsoft basic data'
- Write the new partition table to disk.
Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/rdisk3. Warning: The kernel may continue to use old or deleted partitions. You should reboot or remove the drive. The operation has completed successfully.
- Eject, unplug, and reconnect the drive.
- Finally, format the partition to exFAT as follows to make the Z CAM E2 happy. Notice the device node has "s1" appended to indicate we want to format the first (and only) partition we just made.
alex@apfelstrudel ~ % sudo newfs_exfat -R -S 512 -a 8064 -b 1048576 -c 2048 -n 1 /dev/rdisk3s1 Partition offset : 2048 sectors (1048576 bytes) Volume size : 1963999 sectors (1005567488 bytes) Bytes per sector : 512 Bytes per cluster: 1048576 FAT offset : 128 sectors (65536 bytes) # FAT sectors : 128 Number of FATs : 1 Cluster offset : 256 sectors (131072 bytes) # Clusters : 958 Volume Serial # : 6222ac55 Bitmap start : 2 Bitmap file size : 120 Upcase start : 3 Upcase file size : 5836 Root start : 4
- And we’re done. Now get out there with your happy Z CAM and take some beautiful shots!