1

I had my system dual-booted with Ubuntu 14.04. However, I found myself not using it enough to warrant the storage space. I deleted the ubuntu partition and the ubuntu swap partition.
However, am now facing two problems that I have struggled to solve.

  1. I have been unable to reclaim the disk space from the deleted partitions. I've tried booting into recovery mode Command+R and repairing the disk. The disk repairs successfully, but still remains the same size, and will not let me increase the partition size.

  2. The system is still trying to use the grub bootloader. In order to boot to OS X I have to hold down the Option key on startup. This issue is more of an annoyance, but I would love to figure out how to solve it.

Is any of this possible without a fresh install of the OS?

Edit: Screenshot of partition table below. Also, using OSX 10.10.3 Yosemite.

Screenshot of partition table in Disk Utility

Edit: Could this have anything to do with the Recovery HD below by osx's hard drive on the partition list? Is it safe to remove the recovery hd given that CMD + R reboots are now an online process?

Edit: Output of requested commands below:

diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            245.4 GB   disk0s2
   3:                  Apple_HFS Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *137.4 MB   disk1
   1:        Apple_partition_map                         32.3 KB    disk1s1
   2:                  Apple_HFS VirtualBox              137.4 MB   disk1s2

    sudo gpt -r show /dev/disk0
          start       size  index  contents
              0          1         PMBR
              1          1         Pri GPT header
              2         32         Pri GPT table
             34          6
             40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
         409640  479330712      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      479740352     262144
      480002496    1269536      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      481272032  143870383
      625142415         32         Sec GPT table
      625142447          1         Sec GPT header

    sudo fdisk /dev/disk0
    Disk: /dev/disk0    geometry: 38913/255/63 [625142448 sectors]
    Signature: 0xAA55
             Starting       Ending
     #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    ------------------------------------------------------------------------
     1: EE 1023 254  63 - 1023 254  63 [         1 -  625142447] <Unknown ID>
     2: 00    0   0   0 -    0   0   0 [         0 -          0] unused
     3: 00    0   0   0 -    0   0   0 [         0 -          0] unused
     4: 00    0   0   0 -    0   0   0 [         0 -          0] unused
10
  • First, delete the grub if you have an EFI partition or an EFI folder in the root directory. Next, edit the question and add what error it exactly shows when you try to expand the HD and use the free space.
    – John K
    May 12, 2015 at 7:25
  • 1.) Your OS version, please 2.) By "will not let me increase the partition size," do you mean the drag-to-resize partitioning icon is grayed out and unusable, or that attempts to re-partition result a text-based error? 3.) How did you originally set up your dual-boot configuration? Boot Camp, DIY formatting, Mac Utility, Linux utility? The difference among them is .. well.. it can make for quite a difference, indeed.
    – Doc G.
    May 12, 2015 at 8:51
  • The advice presented in the initial response to your question could prove a tad vexing should you follow through on it without paying attention to your location and the contents thereof, as the Mac also uses an EFI partition for its own boot partition. Deleting it would necessitate a full OS re-installization, and that's a situation you're nowhere close to at the moment.
    – Doc G.
    May 12, 2015 at 9:19
  • Apologies for some of the confusion. Operating System - 10.10.3 Yosemite. It will not let me increase the partition size as in I cannot drag my OSX partition down. I'll include a screenshot of my current partition table in an edit in a second (although when I tried to partition I was booted in recovery mode). I used a tutorial for installing ubuntu that had me install from a live disk and use GParted to create new partitions for the install. I'm quite new at this so please let me know if I can better answer your questions above.
    – Gil
    May 12, 2015 at 11:12
  • Is there any other information I can provide that would assist in the answering of this question? I'm still unable to solve my problem.
    – Gil
    May 13, 2015 at 4:06

1 Answer 1

1

The disk giving you problems uses the GUID partition table (GPT) to define the its layout. You provided me with the relevant contents of this table when you posted the output from the command sudo gpt -r show /dev/disk0. These values appear to be correct, except for the entry with an index of 3. This entry is shown below.

      480002496    1269536      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

The start and size values of 480002496 and 1269536, respectively, are OK, but the contents should be GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC.

To correct the problem you need to boot to OS X Internet Recovery and enter the following commands in a Terminal window.

gpt  -r  show  /dev/disk0
diskutil  unmountDisk  /dev/disk0
gpt  remove  -i  3  /dev/disk0
diskutil  unmountDisk  /dev/disk0
gpt  add  -i  3  -b  480002496  -s  1269536  -t  426F6F74-0000-11AA-AA11-00306543ECAC  /dev/disk0

Once completed, you can boot back to OS X and open the Disk Utility application. The "Recovery HD" partition should no longer appear. You will need to move the slider on the "Macintosh HD" partition as far down as it will go. Click the "Apply" button to recover the free space.

Note: The "Recovery HD" partition has not been deleted. Normally, it is hidden by the Disk Utility application. The partition will still appear when using the diskutil list command. When you move the slider down be aware the Disk Utility application will have to relocate the "Recovery HD" partition to the end of the disk. This can take a while, so be patient after clicking the "Apply" button.

Example Using a Flash Drive

I tested the procedure using a flash drive. Before fixing, the flash drive appeared as such:

1

Using similar Terminal commands resulted in:

2

This allowed me to move the slider as such:

4

Clicking the "Apply" button produced:

5

In your case, the small free space shown above will not appear. (This is not free space, it is the space taken by the hidden partitions.)

3
  • This was incredibly well explained and very thorough. I can't thank you enough.
    – Gil
    May 16, 2015 at 15:34
  • @GC123UNC: Ok, but did it work. May 16, 2015 at 15:36
  • yes, it worked great.
    – Gil
    May 16, 2015 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .