..

mac下格式化U盘

查看U盘所在的分区

[jukay@mac-pro]~$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +120.1 GB   disk1
                                 Logical Volume on disk0s2
                                 CDE1D658-8C57-40FD-AA38-46EFB615DE3C
                                 Unencrypted

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.9 GB    disk2
   1:                 DOS_FAT_32                         31.9 GB    disk2s1

取消挂载改分区

[jukay@mac-pro]~$ sudo umount /dev/disk2
Password:
umount: /dev/disk2: not currently mounted

mac下面没有mkfs.type这样的命令,但是有newfs_type这样的命令可以用格式化分区

[jukay@mac-pro]~$ sudo newfs_msdos /dev/disk2
newfs_msdos: warning: /dev/disk2 is not a character device
512 bytes per physical sector
/dev/disk2: 62186816 sectors in 1943338 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf0 spt=32 hds=255 hid=0 drv=0x00 bsec=62217216 bspf=15183 rdcl=2 infs=1 bkbs=6
[jukay@mac-pro]~$

大功告成!