asgerssc

Q: Merge Partitions disk0s2 and disk0s4 (leaving disk0s3)

Dear all,

 

As the title says, I need to merge disk0s2 and disk0s4 without touching disk0s3 as the latter is my recovery partition. I have not dared to try, but I guess I cannot use this command in terminal since it also merges disk0s3:

 

diskutil mergePartitions JHFS+ NewName disk0s2 disk0s4

 

right now when I type the "diskutil list" command I get this:

 

asger$ diskutil list

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *320.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:                  Apple_HFS Macintosh HD            278.5 GB   disk0s2

   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

   4:                  Apple_HFS BOOTCAMP                40.6 GB    disk0s4


As I am using El Capitan, disk utility does not work either because apple changed it to a useless poor beta like program on El Capitan.

 

I have considered just typing the above merge command and then somehow reinstall the Apple_Boot Recovery HD, But I really don't want to go down that road if possible.

 

And no, Bootcamp assistant can't do it since the Bootcamp partition is already erased and formatted into JHFS+.

 

Any suggestions?

MacBook Pro, OS X El Capitan (10.11.1), early 2011

Posted on Feb 24, 2016 4:01 AM

Close

Q: Merge Partitions disk0s2 and disk0s4 (leaving disk0s3)

  • All replies
  • Helpful answers

Page 1 Next
  • by JimmyCMPIT,

    JimmyCMPIT JimmyCMPIT Feb 24, 2016 5:06 AM in response to asgerssc
    Level 6 (8,606 points)
    Mac OS X
    Feb 24, 2016 5:06 AM in response to asgerssc

    backup your computer with Time Machine

     

    boot into recovery mode

    OS X: About OS X Recovery - Apple Support

     

    reformat the drive

    reinstall the OS from recovery mode which will restore the OS that shipped with your computer or use an bootable installer of OS 10.11

    https://support.apple.com/en-us/HT201372

     

    either way your recovery partition will be recreated if it is not destroyed.

  • by Barney-15E,Helpful

    Barney-15E Barney-15E Feb 24, 2016 10:02 AM in response to asgerssc
    Level 9 (50,924 points)
    Mac OS X
    Feb 24, 2016 10:02 AM in response to asgerssc

    You cannot merge discontinuous partitions, even using diskutil. They must be adjacent on the disk.

  • by asgerssc,

    asgerssc asgerssc Feb 24, 2016 5:12 AM in response to Barney-15E
    Level 1 (0 points)
    Feb 24, 2016 5:12 AM in response to Barney-15E

    Okay. So I can't get back the 40 GB unless I reformat the disk?

  • by Barney-15E,

    Barney-15E Barney-15E Feb 24, 2016 5:19 AM in response to asgerssc
    Level 9 (50,924 points)
    Mac OS X
    Feb 24, 2016 5:19 AM in response to asgerssc

    You may be able to merge 2,3, and 4, but you'd then have to reinstall the OS to restore the Recovery partition which I'm not sure is possible.

    I Haven't ever uninstalled Windows using bootcamp assistant, but that appears to be the way it should have been done.

  • by asgerssc,

    asgerssc asgerssc Feb 24, 2016 5:24 AM in response to JimmyCMPIT
    Level 1 (0 points)
    Feb 24, 2016 5:24 AM in response to JimmyCMPIT

    Thanks, but I really want to avoid this since it is so time consuming until I am absolutely sure it cant be done in any other way

  • by asgerssc,

    asgerssc asgerssc Feb 24, 2016 5:40 AM in response to Barney-15E
    Level 1 (0 points)
    Feb 24, 2016 5:40 AM in response to Barney-15E

    I think you are right about boot camp was the right way. Do you think I can convert 4 into free space and then resize 2?

  • by Barney-15E,

    Barney-15E Barney-15E Feb 24, 2016 5:41 AM in response to asgerssc
    Level 9 (50,924 points)
    Mac OS X
    Feb 24, 2016 5:41 AM in response to asgerssc

    man diskutil specifically states it is not possible. I dont know if any third-party disk partitioning will do it.

  • by keg55,Solvedanswer

    keg55 keg55 Feb 24, 2016 10:01 AM in response to asgerssc
    Level 6 (8,514 points)
    Mac OS X
    Feb 24, 2016 10:01 AM in response to asgerssc

    If you have the Install OS X El Capitan.app file hang onto it. Otherwise download it but don't install it. Quit the installer instead. Download the Recreate Recovery Creator 3.8 utility. This will recreate your Recovery HD from the Install OS X El Capitan.app file. Note - this utility does not work with Fusion drives or Corestorage volumes.

     

    Back up your system first!

     

    You can try to erase both disk0s3 and disk0s4 with Terminal.

    diskutil eraseVolume JHFS+ ErasedDisk1 disk0s3

    diskutil eraseVolume JHFS+ ErasedDisk2 disk0s4

     

    Then merge the partitions with Terminal.

    diskutil mergePartitions JHFS+ ErasedDisk3 disk0s3 disk0s4      <---- this should show ErasedDisk3 as disk0s3 afterwards. Do a diskutil list afterwards to confirm.

    diskutil mergePartitions JHFS+ "Macintosh HD" disk0s2 disk0s3

     

    Last, run the Recreate Recovery Creator utility using your Install OS X El Capitan.app file. This utility will ask where you want to create the Recovery HD - select the Macintosh HD and ask where the installer app is. You will also see some buttons to click 10.7 10.8 button and 10.9 button. Click the 10.9 button. The developer has never updated the 10.9 button to include 10.10 and 10.11. After you run this utility and Quit it do a diskutil list again and hopefully you see your Macintosh HD and Recovery HD without the Bootcamp partition.

  • by JimmyCMPIT,

    JimmyCMPIT JimmyCMPIT Feb 24, 2016 5:44 AM in response to asgerssc
    Level 6 (8,606 points)
    Mac OS X
    Feb 24, 2016 5:44 AM in response to asgerssc

    I don't know if you really can with what you have in front of you. I would think the straightforward approach is start with the clean slate and restore from a backup to rule out any 3rd party pitfalls.

  • by asgerssc,

    asgerssc asgerssc Feb 24, 2016 5:56 AM in response to keg55
    Level 1 (0 points)
    Feb 24, 2016 5:56 AM in response to keg55

    Thank you! Is Install OS X El Capitan.app necessary for recreate recovery creator 3.8 to work? I get another thought: If I delete the recovery HD and then update from 10.11.1 to 10.11.3 will it maybe create a new recovery partition?

  • by keg55,

    keg55 keg55 Feb 24, 2016 5:58 AM in response to asgerssc
    Level 6 (8,514 points)
    Mac OS X
    Feb 24, 2016 5:58 AM in response to asgerssc

    asgerssc wrote:

     

    Thank you! Is Install OS X El Capitan.app necessary for recreate recovery creator 3.8 to work? I get another thought: If I delete the recovery HD and then update from 10.11.1 to 10.11.3 will maybe create a new one?

    Yes, the installer app is required for the utility to work.

     

    If you update from 10.11.1 to 10.11.3 using the Install OS X El Capitan.app file, then yes, it will recreate the Recovery HD for you without having to use the utility. The FULL OS X installers always create or rewrite the Recovery HD. BUT if you UPDATE using the 10.11.3 Update or Combo Update, the Recovery HD will not be recreated.

  • by asgerssc,

    asgerssc asgerssc Feb 24, 2016 6:06 AM in response to keg55
    Level 1 (0 points)
    Feb 24, 2016 6:06 AM in response to keg55

    So, Is what you say that should not press "update" in app store but go to the el capitan page and press download, and then run the Install OS X El Capitan.app file. And that this will recreate the recovery partition whereas the update option will not?

  • by keg55,

    keg55 keg55 Feb 24, 2016 6:38 AM in response to asgerssc
    Level 6 (8,514 points)
    Mac OS X
    Feb 24, 2016 6:38 AM in response to asgerssc

    So, Is what you say that should not press "update" in app store but go to the el capitan page and press download, and then run the Install OS X El Capitan.app file. And that this will recreate the recovery partition whereas the update option will not?

    Correct.

     

    But, also BEFORE you run the app file, save it somewhere so you have it for the future if needed. After it downloads and you see the installer screen, don't click Continue yet. Instead, go into your /Applications folder and copy the Install OS X El Capitan.app file to some other folder like your /Downloads folder. After the copy, click the Continue button on the installer screen.

  • by asgerssc,

    asgerssc asgerssc Feb 24, 2016 10:00 AM in response to keg55
    Level 1 (0 points)
    Feb 24, 2016 10:00 AM in response to keg55

    Thank you so much! This worked flawlessly. Look at this:

     

    diskutil list

    /dev/disk0 (internal, physical):

      #:          TYPE NAME                               SIZE      IDENTIFIER

      0:          GUID_partition_scheme                   *320.1 GB  disk0

      1:          EFI EFI                                 209.7 MB  disk0s1

      2:          Apple_CoreStorage Macintosh HD          319.2 GB  disk0s2

      3:          Apple_Boot Recovery HD                  650.0 MB  disk0s3


    Thanks to all of you!

Page 1 Next