Using diskutil to format U disk under mac

brief introduction

People who have used win32diskimage know that the u disk will become several partitions after being mirrored with that object, and some partitions cannot be mounted, and the disk management tool of Mac can not deal with this problem well, but there is no good partition tool under Mac. If there is one that can be recommended to me, I directly use fdisk to partition under linux, and I use Di under windows Skynius, I can only use diskutil under mac

Format u disk with diskutil

First, check how many disks are there in your current system

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_APFS Container disk1         121.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +121.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            91.8 GB    disk1s1
   2:                APFS Volume Preboot                 44.9 MB    disk1s2
   3:                APFS Volume Recovery                522.8 MB   disk1s3
   4:                APFS Volume VM                      1.1 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *124.2 GB   disk2
   1:       Microsoft Basic Data                         243.7 KB   disk2s1
   2:                        EFI NO NAME                 2.9 MB     disk2s2
   3:                  Apple_HFS PVE                     683.5 MB   disk2s3
   4:       Microsoft Basic Data                         307.2 KB   disk2s4

You can see that there are three disks. The last one is our u disk. Just input the following command to format it

diskutil partitionDisk /dev/disk2 MBR FAT32 UNTITLED 0b

In this way, you can format it into fat32 format

Welcome to Bboysoul's blog www.bboysoul.com

Have Fun

Keywords: Operation & Maintenance Mac Linux Windows

Added by jester626 on Tue, 12 Nov 2019 01:29:32 +0200