Skip to content

Instantly share code, notes, and snippets.

@tristan-k
Created July 27, 2011 16:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tristan-k/1109679 to your computer and use it in GitHub Desktop.
Save tristan-k/1109679 to your computer and use it in GitHub Desktop.
Mac OS X Lion 10.7.0 Substitue "Recovery HD"
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *250.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh_HD 249.2 GB disk0s2
3: Apple_Boot 650.0 MB disk0s5
$ diskutil eraseVolume HFS+ Blank /dev/disk0s5
Started erase on disk0s5
Unmounting disk
Erasing
Initialized /dev/rdisk0s5 as a 620 MB HFS Plus volume
Mounting disk
Finished erase on disk0s5 Blank
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *250.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh_HD 249.2 GB disk0s2
3: Apple_HFS Blank 650.0 MB disk0s5
$ diskutil mergePartitions HFS+ Macintosh_HD disk0s2 disk0s5
The chosen disk supports resize; disregarding your new file system type and volume name
Merging partitions into a new partition
Start partition: disk0s2 Macintosh_HD
Finish partition: disk0s5 Blank
Started partitioning on disk0
Merging partitions
Waiting for the disks to reappear
Growing disk
Finished partitioning on disk0
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *250.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh_HD 249.7 GB disk0s2
$ diskutil cs list
No CoreStorage logical volume groups found
$ diskutil cs convert disk0s2 -passphrase mysecret
Started CoreStorage operation on disk0s2 Macintosh_HD
Resizing disk to fit Core Storage headers
Creating Core Storage Logical Volume Group
Attempting to unmount disk0s2
Switching disk0s2 to Core Storage
Couldn't unmount disk0s2; converted volume won't appear until it's unmounted
Core Storage LVG UUID: 53E2A042-7A1A-4964-9621-0E82E7F02D76
Core Storage PV UUID: A66721E5-0EF9-432A-A52E-A13540EFF008
Core Storage LV UUID: 185BA4C9-15D3-4D59-9C54-F783A70D23DD
Finished CoreStorage operation on disk0s2 Macintosh_HD
Encryption in progress; use `diskutil coreStorage list` for status
$ diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 53E2A042-7A1A-4964-9621-0E82E7F02D76
=========================================================
Name: Macintosh_HD
Sequence: 1
Free Space: 0 B (0 B)
|
+-< Physical Volume A66721E5-0EF9-432A-A52E-A13540EFF008
----------------------------------------------------
Index: 0
Disk: disk0s2
Status: Online
Size: 249715376128 B (249.7 GB)
$ diskutil list/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *250.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh_HD 249.7 GB disk0s2
3: Apple_Boot Boot OS X 134.2 MB disk0s3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment