I can't shrink my OS X Yosemite partition [duplicate]
I recently reformatted my machine and am trying to shrink my OS X partiton to make room for a linux partition, following instructions at http://www.makeuseof.com/tag/install-linux-macbook-pro/ . I am at the Resize Partitions step, and when I opened up Disk Utility, there was no way for me to drag the existing partition to shrink its size and create free space.
When looking at the GUI, the normal resize handle is missing, and the help text sounds much more restrictive than it has in the past.
Solution 1:
Essentially you have a CoreStorage Volume Group instead of an old-style partition scheme. You shouldn't use Disk Utility to modify the CSVG.
To shrink your CoreStorage Volume Group to get some unallocated space to install Linux or EFI-Windows just use an undocumented diskutil command:
diskutil cs resizeStack LVUUID size
The command expands or shrinks the whole CoreStorage Volume Group including the physical volume(s), the logical volume family and the logical volume in one step to the desired size.
Beware: The command is vastly undocumented and as such potentially destructive.
Preparation:
- Backup your data.
- Detach any external drive (especially your external Time Machine backup drive).
-
Restart to Internet Recovery Mode by pressing alt cmd R at startup.
The prerequisites are the latest firmware update installed, either ethernet or WLAN (WPA/WPA2) and a router with DHCP activated.
On a 50 Mbps-line it takes about 4 min (presenting a small animated globe) to boot to a recovery netboot image which usually is loaded from an apple/akamai server.I recommend ethernet because it's more reliable. If you are restricted to WIFI and the boot process fails, just restart your Mac until you succeed booting.
Alternatively you may start from a bootable installer thumb drive (Mavericks or Yosemite) or a thumb drive containing a full system (Mavericks or Yosemite). The disk identifiers may differ then. So check the human readable names and sizes and change the commands below accordingly.
Get an overview:
-
Open in the menubar Utilities/Terminal
First you should get an overview of your disks and the partition layout:
-
Enter
diskutil list
Example listing (but I took the list provided by you in your question and included the netboot device):/dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *250.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_CoreStorage Macintosh HD 249.1 GB disk0s2 3: Apple_Boot Recovery HD 650.1 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: Apple_partition_scheme *1.3 GB disk1 1: Apple_partition_map 30.7 KB disk1s1 2: Apple_HFS OS X Base System *1.3 GB disk1s2 /dev/disk2 #: TYPE NAME SIZE IDENTIFIER 0: Apple_HFS Macintosh HD *249.1 GB disk2 /dev/disk3-disk13 ...belong to the OS X Base System (your recovery system you booted to previously)
Disk0 is your main internal disk device (SSD) containing an EFI-partition (dis0s1), one CoreStorage partition (disk0s2) and Boot OS X (disk0s3).
Disk1 is a logical disk created by booting to the netboot image which contains a recovery system (OS X Base System = disk1s2) similar to the Recovery HD.
Disk2 is also a logical disk residing in disk0s2 and it contains the CoreStorage stack.
-
Enter
diskutil cs list
Example listing:CoreStorage logical volume groups (1 found) | +-- Logical Volume Group 57932797-4AC8-4475-9836-82394CEBF536 ========================================================= Name: LogicalVolumeGroup Status: Online Size: 249150200320 B (249.1 GB) Free Space: 353689600 B (353.7 MB) | +-< Physical Volume 68F90B2B-4004-4044-AFFB-9D3854006D2A | ---------------------------------------------------- | Index: 0 | Disk: disk0s2 | Status: Online | Size: 249183200320 B (249.1 GB) | +-> Logical Volume Family 9B947A52-7496-46CA-BFA5-A87DD47249FE ---------------------------------------------------------- Encryption Status: Unlocked Encryption Type: None Conversion Status: NoConversion Conversion Direction: -none- Has Encrypted Extents: No Fully Secure: No Passphrase Required: No | +-> Logical Volume 86417B41-6400-4F81-8F7C-43AA243CDAEE --------------------------------------------------- Disk: disk2 Status: Online Size (Total): 249001915136 B (249.0 GB) Conversion Progress: -none- Revertible: No LV Name: Macintosh HD Volume Name: Macintosh HD Content Hint: Apple_HFS
Modify CoreStorage stack:
-
Resize the CoreStorage volume with
diskutil cs resizeStack LVUUID size
with LVUUID: UUID of the logical volume and size: the final size of your CoreStorage volume.
Examples:
diskutil cs resizeStack 86417B41-6400-4F81-8F7C-43AA243CDAEE 200g
to shrink it to 200 GB
diskutil cs resizeStack 86417B41-6400-4F81-8F7C-43AA243CDAEE 100000m
to shrink it to 100,000 MB (=100 GB)
diskutil cs resizeStack 86417B41-6400-4F81-8F7C-43AA243CDAEE 0g
to expand it to the full available size (0g is a magic number here).
Your Recovery HD should be moved automatically - regardless of whether shrinking or expanding the CS volume - to the very end of it (right after the CoreStorage volume).
Enter
exit
and quit Terminal.- Open Disk Utility and check your shrinked CoreStorage volume for errors.
- Quit Disk Utility.
- Reboot to your main volume.
- Now you have ~(250 GB - size) GB of unallocated space and may install Linux.
P.S. I recommend to revert to the old-style partition scheme before installing Linux with Grub/rEFInd. You need a full Time Machine backup of your main volume though.
Delete CoreStorage stack:
To revert to the old-style volume delete the Logical Volume Group instead of modifying the CoreStorage stack:
Enter
diskutil cs delete LVGUUID
with LVGUUID = UUID of the Logical Volume Group found in one of the previous steps. Quit Terminal.Open Disk Utility and partition the SSD. Quit Disk Utility.
Open Restore From Time Machine Backup and restore your data.