0

When I installed OSX Mavericks, I left free space after my system partition in case I wanted to install a second OS there. This has proved unnecessary — I've never modified the partition table — and I'd like to integrate that space into my system partition.

In theory, this can be done quite easily with Disk Utility. However, this does not seem to work for me. When I select the Partition tab for the drive in Disk Utility, I see a small unnamed partition at the top, followed by my system partition, followed by blank space. There is a pull-tab at the bottom right of the system partition. I can pull that tab down to fill the empty space with the system partition. However, when I hit Apply and confirm, the message "Preparing to partition disk" shows up next to a barber-pole wait indicator and never goes away.

Answers to other questions suggest that this issue can be resolved by running Verify and Repair on both the system partition and the drive on which it is located. Verify on the partition shows no errors; Verify on the drive indicates that it doesn't have an EFI partition — a problem which Repair proves unable to fix.

Running $ diskutil list from the command line reveals the following partitions:

  • 0: The GPT
  • 1: The small partition is labeled Microsoft Reserved; I gather that this is set up by OSX install to facilitate possible later Boot Camp installation.
  • 2: There is an EFI partition (!) located between the Microsoft Reserved partition and the system partition
  • 3: system partition
  • 4: Recovery partition

diskutil doesn't explicitly indicate the location of these partitions, so I installed the brew package gptfdisk and ran sgdisk -p, which confirmed that the Recovery partition is located direction after system.

SO: My hypothesis is that Disk Utility is unable to grow the system partition because there is a partition immediately following it. If this is the case, I'm confused as to why the OSX installer would put it there instead of at the end of the disk. But anyway: if this is really the issue, what's the easiest, and preferably free, way to move it to the end of the disk? I could use dd to get it there, but I'm unaware of any tools that can reliably edit the partition table. (sgdisk could do this, but the brew version is 0.8.something, so I don't really trust it.)

Are there any special things I need to keep in mind when changing the partition table? There seems to be something wrong with it already (given the EFI issue).

It's looking like I'll need to set up a rescue boot disk, so recommendations on those are gladly accepted.

EDIT: Question is a tome already but somebody asked for output so here it is:

$ diskutil list /dev/disk0
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *512.1 GB   disk0
   1:         Microsoft Reserved                         134.2 MB   disk0s1
   2:                        EFI EFI                     209.7 MB   disk0s2
   3:                  Apple_HFS system                  319.2 GB   disk0s3
   4:                 Apple_Boot Recovery HD             650.1 MB   disk0s4

$ sudo gpt -r show /dev/disk0
Password:
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34      262144      1  GPT part - [GUID REDACTED]
      262178        2014         
      264192      409600      2  GPT part - [GUID REDACTED]
      673792   623464448      3  GPT part - [GUID REDACTED]
   624138240     1269760      4  GPT part - [GUID REDACTED]
   625408000   374807183         
  1000215183          32         Sec GPT table
  1000215215           1         Sec GPT header

$ sudo fdisk /dev/disk0
Disk: /dev/disk0        geometry: 62260/255/63 [1000215216 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 - 1000215215] <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   
9
  • 1
    What had posted so far is great, but it would be easier if you would run the following commands in a Terminal window and copy/paste the results to your posted question. The commands are diskutil list, sudo gpt -r show /dev/disk0 and sudo fdisk /dev/disk0. None of these commands will change your computer. Some will ask for your login password. This is normal. Jul 28 '15 at 20:13
  • @DavidAnderson: hmm maybe I did more customization of the partition scheme than I remembered. Is it normal to not be able to grow the system partition using Disk Utility when the Recovery partition directly follows it? What's the proper procedure to grow the system partition in that case?
    – intuited
    Jul 29 '15 at 9:26
  • The Microsoft Reserved partition was not created by any OS X software. It should not exist on your Mac. The Recovery HD partition correctly occurs after the system partition. The Disk Utility relocates Recovery HD partition when the system partition is resized. So your hypothesis is wrong. Most likely the existence of the 'Microsoft Reserved' partition is causing the Disk Utility application to hang. Jul 29 '15 at 9:29
  • It IS normal to grow/shrink a Mac OS Extended partition (48465300-0000-11AA-AA11-00306543ECAC) whether or not it is followed by a Recovery partition (426F6F74-0000-11AA-AA11-00306543ECAC). You have to choices. Either remove the Microsoft reserved partition and see if that fixes the problem. Or, backup the system and Recovery HD partitions to an external device, repartition the disk, then restore from back up. (You probably should backup regardless of your choice.) Jul 29 '15 at 9:50
  • Are you sure you waited long enough? It does take quite sometime for the Disk Utility to move the Recovery Partition to the end of the disk. The actual enlarging of the system partition takes no time at all. Jul 29 '15 at 10:02
1

I ended up setting up an Ubuntu USB boot drive, rebooting into Ubuntu, and using gparted to write a new partition table that changed the partition type of the Microsoft Recovery to ext4 and named it. I also formatted that partition to ext4.

After rebooting back into my OSX install, I was able to resize the system partition. Yay!

You must log in to answer this question.

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