diskutil list 查看U盘盘符:
lapommedeMacBook-Pro:~ lapomme$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
: GUID_partition_scheme *251.0 GB disk0
: EFI EFI 209.7 MB disk0s1
: Apple_CoreStorage Macintosh HD 250.1 GB disk0s2
: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
: Apple_HFS Macintosh HD +249.8 GB disk1
Logical Volume on disk0s2
E2BD4617-5A22-46A9-A6F4-D54E3EE92BBC
Unencrypted
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
: CAM *62.0 GB disk2
diskutil eraseVolume 格式化U盘卷
lapommedeMacBook-Pro:~ lapomme$ sudo diskutil eraseVolume FAT32 UDISKNAME /dev/disk2
Started erase on disk2 CAM
Unmounting disk
Erasing
bytes per physical sector
/dev/rdisk2: sectors in FAT32 clusters ( bytes/cluster)
bps= spc= res= nft= mid=0xf0 spt= hds= hid= drv=0x00 bsec= bspf= rdcl= infs= bkbs=
Mounting disk
Finished erase on disk2 UDISKNAME
diskutil eraseDisk 格式化U盘
lapommedeMacBook-Pro:~ lapomme$ sudo diskutil eraseDisk FAT32 NAME MBRFormat /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk2s1 as MS-DOS (FAT32) with name NAME
bytes per physical sector
/dev/rdisk2s1: sectors in FAT32 clusters ( bytes/cluster)
bps= spc= res= nft= mid=0xf8 spt= hds= hid= drv=0x80 bsec= bspf= rdcl= infs= bkbs=
Mounting disk
Finished erase on disk2
UDISKNAME是格式化后的U盘的名称
linux下:
列出磁盘列表:fdisk -l
格式化:
mkfs -t
$ mkfs -t vfat /dev/sdb1
mkfs.vfat 3.0.13 (30 Jun 2012)
格式化为fat32格式
mkfs -V -t
$ mkfs -V -t vfat /dev/sdb1
mkfs (util-linux 2.20.1)
mkfs.vfat /dev/sdb1
mkfs.vfat 3.0.13 (30 Jun 2012)
创建文件系统,并显示信息,此处-V必须放在-t前面