Mac 下格式化U盘

 

diskutil list 查看U盘盘符:

 1 lapommedeMacBook-Pro:~ lapomme$ diskutil list
 2 /dev/disk0 (internal, physical):
 3    #:                       TYPE NAME                    SIZE       IDENTIFIER
 4    0:      GUID_partition_scheme                        *251.0 GB   disk0
 5    1:                        EFI EFI                     209.7 MB   disk0s1
 6    2:          Apple_CoreStorage Macintosh HD            250.1 GB   disk0s2
 7    3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
 8 /dev/disk1 (internal, virtual):
 9    #:                       TYPE NAME                    SIZE       IDENTIFIER
10    0:                  Apple_HFS Macintosh HD           +249.8 GB   disk1
11                                  Logical Volume on disk0s2
12                                  E2BD4617-5A22-46A9-A6F4-D54E3EE92BBC
13                                  Unencrypted
14 /dev/disk2 (external, physical):
15    #:                       TYPE NAME                    SIZE       IDENTIFIER
16    0:                            CAM                    *62.0 GB    disk2

diskutil eraseVolume 格式化U盘卷

1 lapommedeMacBook-Pro:~ lapomme$ sudo diskutil eraseVolume FAT32 UDISKNAME /dev/disk2
2 Started erase on disk2 CAM
3 Unmounting disk
4 Erasing
5 512 bytes per physical sector
6 /dev/rdisk2: 121080896 sectors in 1891889 FAT32 clusters (32768 bytes/cluster)
7 bps=512 spc=64 res=32 nft=2 mid=0xf0 spt=32 hds=255 hid=0 drv=0x00 bsec=121110528 bspf=14781 rdcl=2 infs=1 bkbs=6
8 Mounting disk
9 Finished erase on disk2 UDISKNAME

 

diskutil eraseDisk 格式化U盘 

 1 lapommedeMacBook-Pro:~ lapomme$  sudo diskutil eraseDisk FAT32 NAME MBRFormat /dev/disk2
 2 Started erase on disk2
 3 Unmounting disk
 4 Creating the partition map
 5 Waiting for the disks to reappear
 6 Formatting disk2s1 as MS-DOS (FAT32) with name NAME
 7 512 bytes per physical sector
 8 /dev/rdisk2s1: 121080896 sectors in 1891889 FAT32 clusters (32768 bytes/cluster)
 9 bps=512 spc=64 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2 drv=0x80 bsec=121110526 bspf=14781 rdcl=2 infs=1 bkbs=6
10 Mounting disk
11 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前面

posted @ 2016-08-30 02:26  魚魚  阅读(2734)  评论(0编辑  收藏  举报