First, look at the partition table:
~ $ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 999.7 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD +999.3 GB disk1
Logical Volume on disk0s2
03C9C615-4A75-4F55-BFE2-3D1EFAD7519E
Unlocked Encrypted
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *7.8 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Microsoft Basic Data NCS1002 7.6 GB disk2s2 |
~ $ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 999.7 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD +999.3 GB disk1
Logical Volume on disk0s2
03C9C615-4A75-4F55-BFE2-3D1EFAD7519E
Unlocked Encrypted
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *7.8 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Microsoft Basic Data NCS1002 7.6 GB disk2s2
In my case, the USB drive is /dev/disk2
.
I want to reformat the device to an MBR-formatted FAT32 partition. To do that, run this command:
sudo diskutil eraseDisk FAT32 {NAME} MBRFormat /dev/disk2 |
sudo diskutil eraseDisk FAT32 {NAME} MBRFormat /dev/disk2
where NAME is the name you want to give to the disk.
For example:
~ $ sudo diskutil eraseDisk FAT32 NCS1002 MBRFormat /dev/disk2
Password:
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk2s1 as MS-DOS (FAT32) with name NCS1002
512 bytes per physical sector
/dev/rdisk2s1: 15210832 sectors in 1901354 FAT32 clusters (4096 bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2 drv=0x80 bsec=15240574 bspf=14855 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk2 |
~ $ sudo diskutil eraseDisk FAT32 NCS1002 MBRFormat /dev/disk2
Password:
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk2s1 as MS-DOS (FAT32) with name NCS1002
512 bytes per physical sector
/dev/rdisk2s1: 15210832 sectors in 1901354 FAT32 clusters (4096 bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2 drv=0x80 bsec=15240574 bspf=14855 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk2
Verify the partition table again:
~ $ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 999.7 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD +999.3 GB disk1
Logical Volume on disk0s2
03C9C615-4A75-4F55-BFE2-3D1EFAD7519E
Unlocked Encrypted
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.8 GB disk2
1: DOS_FAT_32 NCS1002 7.8 GB disk2s1 |
~ $ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 999.7 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD +999.3 GB disk1
Logical Volume on disk0s2
03C9C615-4A75-4F55-BFE2-3D1EFAD7519E
Unlocked Encrypted
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.8 GB disk2
1: DOS_FAT_32 NCS1002 7.8 GB disk2s1