Skip to content

Instantly share code, notes, and snippets.

@ikuwow
Created September 30, 2017 06:02
Show Gist options
  • Save ikuwow/f65d9cc42aae12be713d8cd0b4dd3ed4 to your computer and use it in GitHub Desktop.
Save ikuwow/f65d9cc42aae12be713d8cd0b4dd3ed4 to your computer and use it in GitHub Desktop.
Macでディスクのパーティション形式をMBRからGPTに変える ref: http://qiita.com/ikuwow/items/4bc3923d8f7f8bfb2da2
$ diskutil eraseDisk JHFS+ SecretDisk GPT /dev/disk3
Started erase on disk3
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk3s2 as Mac OS Extended (Journaled) with name SecretDisk
Initialized /dev/rdisk3s2 as a 931 GB case-insensitive HFS Plus volume with a 81920k journal
Mounting disk
Finished erase on disk3
$ diskutil eraseDisk
Usage: diskutil eraseDisk format name [APM[Format]|MBR[Format]|GPT[Format]]
MountPoint|DiskIdentifier|DeviceNode
Completely erase an existing whole disk. All volumes on this disk will be
destroyed. Ownership of the affected disk is required.
Format is the specific file system name you want to erase it as (HFS+, etc.).
Name is the (new) volume name (subject to file system naming restrictions),
or can be specified as %noformat% to skip initialization (newfs).
You cannot erase the boot disk.
Example: diskutil eraseDisk JHFS+ UntitledUFS disk3
$ diskutil info "Secret Disk" | grep Device\ Node
Device Node: /dev/disk3s1
diskutil eraseDisk JHFS+ SecretDisk2 /dev/disk3s1 GPT
$ diskutil eraseDisk JHFS+ SecretDisk2 /dev/disk3s1 GPT
Unknown partition scheme: /dev/disk3s1
IkuosMacmini:imgs2pdf degawaikuo$ diskutil eraseDisk JHFS+ SecretDisk2 /dev/disk3s1
A volume was specified instead of a whole disk: /dev/disk3s1
Specify a whole disk, or instead use diskutil eraseVolume to erase a volume on a specific partition
$ diskutil eraseDisk JHFS+ SecretDisk2 GPT /dev/disk3s1
A volume was specified instead of a whole disk: /dev/disk3s1
Specify a whole disk, or instead use diskutil eraseVolume to erase a volume on a specific partition
$ diskutil partitionDisk /Volumes/SecretDisk2 2 GPT JHFS+ JHFS+
/Volumes/SecretDisk2 does not appear to be a whole disk
diskutil eraseDisk JHFS+ SecretDisk2 GPT /dev/disk3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment