So I started up Disk Utility and erased my BOOTCAMP partition and set the format to OS X Extended (Journaled)
.
This is how my partitions look like now:
As you can see, I have a BOOTCAMP partition (129 GB), my mac partition (362 GB) and I have 8 GB of unused space. How can I merge all of this with my mac partition? I heard that I should be able to click "-" when BOOTCAMP is selected and then expand my mac partition to use the unused space, but as you can see, I can not click the "-" button. My mac partition is "Journaled, Encrypted" by the way.
Best Answer
You can't simply merge a Bootcamp partition or empty space and a FileVault volume with Disk Utility (Boot Camp Assistant should handle this though). You first have to remove the Bootcamp partition and then expand the FileVault volume.
To remove the Bootcamp partition and resize the CoreStorage Volume Group (containing the FileVault volume) the Mac has to be booted to Internet Recovery Mode. Recovery Mode is not sufficient because the Recovery HD has to be moved. The actual boot volume or partition can't be moved.
Preparation:
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 into 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 (preferably Yosemite or El Capitan) or a thumb drive containing a full system (preferably Yosemite or El Capitan).
Remove bootcamp partition and expand CoreStorage Volume Group
Booted to Internet Recovery Mode open Utilities → Terminal in the menubar and enter:
diskutil list
to get the disk identifiers anddiskutil cs list
to get a CoreStorage listing. Below I assume that your main disk has the disk identifier disk0 and the CoreStorage Logical Volume disk2.First you have to remove the Bootcamp partition:
To remove a partition with
gpt
the disk (and all related disks like the inherent CoreStorage volume) has to be unmountedThen you have to resize the Logical Volume Group:
in your case:
and enter your passphrase if asked.
Then resize the stack:
in your case:
Enter
exit
and quit Terminal