I know this probably shouldn’t be on the NixOS discourse, but would anyone happen to know what settings gnome disks uses to format exfat filesystems compared to mkfs.exfat? When using disko, which uses sgdisk, which uses mkfs to format an exfat filesystem on the first partition of a usb, I can’t seem to access it on Android, but when formatting using gnome disks or Windows, it works fine.
I can’t figure out what gnome-disk-utility uses but there are two packages that provide the mkfs.exfat command in nixpkgs. You can see disko uses pkgs.exfatprogs so try the other one pkgs.exfat and see if that works as desired.
If that doesn’t help then compare the partition table generated by using gnome-disk-utility to what disko generates by running a command like sudo gdisk -l /dev/sdz to inspect exactly how the disk has been partitioned.
Interesting… The codes seem to be different for the partition that works, 0700, compared to the one that doesn’t, 8300. I’m not particularly well-versed in this area; what do the codes mean, and where can I learn more about them?
Those are the partition type codes, 8300 is “Linux filesystem” and 0700 “Microsoft basic data”, the operating system will use the code to determine what type of filesystem is likely to be on that partition. When the disk is detected on Android the partition type would have been set as 0700 so Android knows to look for a few types of Windows filesystems, one of which is exfat so it gets detected properly. Changing the partition type code can be done without effecting the data stored on the partition so you could format using disko and then run a command like sudo sgdisk --typecode 0700 /dev/sda1 to change the partition type and it should then be detected on Android.
Setting the partition mode to 0700 in my disko configuration worked perfectly. Thank you kindly for the help.