Skip to content

Instantly share code, notes, and snippets.

@pastleo
Last active August 2, 2020 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pastleo/c683997b91475054bb7f16faa721d330 to your computer and use it in GitHub Desktop.
Save pastleo/c683997b91475054bb7f16faa721d330 to your computer and use it in GitHub Desktop.
make a exfat usb that can be used in macos and (hopefully) windows
#!/bin/bash
set -e
# https://en.wikipedia.org/wiki/ExFAT
# https://unix.stackexchange.com/questions/460155/mac-os-cannot-mount-exfat-disk-created-on-ubuntu-linux
# Preparation:
# pacman -S parted exfat-utils
# Tested on macOS Catalina
if ! [ -b "$1" ]; then
echo "$1 is not a block device"
exit 255
fi
echo "USB: $1"
echo parted -s -a optimal $1 mktable gpt mkpart fat32 0% 100% set 1 msftdata on
parted -s -a optimal $1 mktable gpt mkpart fat32 0% 100% set 1 msftdata on
echo mkfs.exfat -n usb "$1"1
mkfs.exfat -n usb "$1"1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment