默认情况下,无法使用Mac自带对U盘进行分区操作
但是我们可以使用命令行工具进行操作
第一步,先找到要分区的磁盘
diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 250.7 GB disk0s2
/dev/disk3 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *31.5 GB disk3
1: DOS_FAT_32 我的U盘 31.5 GB disk3s1
挂载设备的U盘名字是 /dev/disk3
接下来我们对这个设备进行分区,我的要求是 分为2个区,一个占用80%,一个占用20%,其次文件系统格式为 MS-DOS FAT32,分区引导格式为MBRFormat
使用下面命令进行分区
diskutil partitionDisk /dev/disk3 MBRFormat "MS-DOS FAT32" PAN1 80% "MS-DOS FAT32" PAN2 20%
diskutil partitionDisk /dev/disk3 MBRFormat "MS-DOS FAT32" PAN1 80% "MS-DOS FAT32" PAN2 20%
Started partitioning on disk3
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk3s1 as MS-DOS (FAT32) with name PAN1
512 bytes per physical sector
/dev/rdisk3s1: 49127968 sectors in 1535249 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2048 drv=0x80 bsec=49152000 bspf=11995 rdcl=2 infs=1 bkbs=6
Mounting disk
Formatting disk3s2 as MS-DOS (FAT32) with name PAN2
512 bytes per physical sector
/dev/rdisk3s2: 12259920 sectors in 1532490 FAT32 clusters (4096 bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=49156096 drv=0x80 bsec=12283904 bspf=11973 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished partitioning on disk3
/dev/disk3 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *31.5 GB disk3
1: DOS_FAT_32 PAN1 25.2 GB disk3s1
2: DOS_FAT_32 PAN2 6.3 GB disk3s2