# Ubuntu – Delete Ubuntu dual boot on Mac w/ rEFInd

dual-bootmacosxpartitioningrefindubuntu-gnome

I installed Ubuntu-Gnome 16.10 using 8 GB Swap and nearly 42 GB main partition on my Macbook Pro and then changed the DE to Unity. I want now to delete the whole Ubuntu thing and free my 50 GB space so that I can add them to my macOS partition. I used rEFInd to install Ubuntu.

Can anybody tell me step-by-step what should I do to delete Ubuntu and how to make one big partition as in the beginning?

# Removing Ubuntu

1. Open up Disk Utility from /Applications/Utilities.
2. Click on your hard drive in the left-hand sidebar (the drive, not the partition) and go to the "Partition" tab. Find the Ubuntu partition you want to remove (you probably labeled them when you first created them).
3. Click on the partition you want to remove, then click the small minus button at the bottom of the window. This will remove the partition from your system.
4. Click the corner of your Mac partition and drag it down so it fills up the free space left behind. Click Apply when you're finished.

Your Mac may take a minute to perform the necessary processes, but when it's done, your system will be back to its original Macintosh self. If you had rEFInd installed on your system, you can leave it there—it isn't going to hurt anything, but if you want to completely remove it do the following steps.

# Removing rEFInd

As stated in the official documentation,

I recommend stopping here, because the procedure for completely removing rEFInd from a Mac depends on your installation method and tends to be challenging for many Mac users, who are unfamiliar with the necessary command-line tools.

Basically, if you just want your Mac back, just follow the procedure before this and leave rEFInd alone. But, if you want to completely remove rEFInd, then continue.

1. You must first determine where rEFInd is installed. This can be any of several locations:
• If you installed rEFInd 0.8.3 or earlier with the default options, or if you used the --notesp option with rEFInd 0.8.4 or later, it will be /EFI/refind on your main partition.
• If you installed rEFInd 0.8.4 or later with the default options, or if you used the --esp option with rEFInd 0.8.3 or earlier, it will be in EFI/refind or EFI/BOOT on the ESP.
• If you used the --ownhfs option to refind-install, rEFInd will be in the System/Library/CoreServices directory on the volume you specified.
• If you installed rEFInd manually, it will be wherever you put it.
• In all cases, there could be duplicate (inactive) rEFInd files in unexpected places. This is particularly true if you tried installing rEFInd multiple times, each with different options to refind-install. Thus, if you delete rEFInd and it still comes up, you may have deleted the wrong files. (Note that dragging files to the Trash may have no effect, though—at least, not until you empty the Trash.)
2. If necessary, mount the ESP or rEFInd-specific HFS+ volume, as described in Installing rEFInd Manually Using Mac OS X. (The mountesp script that comes with rEFInd will handle this task.)
3. Verify that rEFInd is installed in the directory noted in step #1. If a refind.conf file is present, rEFInd is almost certainly installed in that directory. If not, it's not rEFInd there and you should not proceed. Be extra cautious about deleting the System/Library/CoreServices directory, since that's the default location of the OS X boot loader! Never delete this directory from your OS X root (/) partition, only from the partition you specified to refind-install using the --ownhfs option.
4. Once you've identified the rEFInd directory, delete it, or at least the rEFInd boot file. This file may be called refind_x64.efi, bootx64.efi, boot.efi, or conceivably something else. You may need to use sudo rm at the command line to accomplish this task, as in sudo rm -r /Volumes/ESP/EFI/refind.

All credit for this information goes to the sources cited below.

Sources