Remove macOS from a APFS container

apfsdisk-utilitymojavepartition

I'm interested in taking a look as macOS Mojave but am not willing to install it on my main production machine. However, I do not have another Mac to hand so have found myself upon this guide from Apple, walking you through the steps to install macOS Mojave on a seperate APFS volume on your normal Mac, easing many of the risks associated with running Beta software.

Whilst the guide makes it quite clear how to install Mojave on this new APFS volume, my question is: when I am done with macOS Mojave, how exactly would I remove this separate APFS volume and give it back to my normal installation of macOS High Sierra? Is this something easily done from Disk Utility or is is a slightly more complicated process involving the use of Terminal?

Thank you in advance for any help,
Kind regards, Rocco

Best Answer

This answer is a continuation of my answer to the question: APFS - Is it possible to install 2 macOS versions inside one APFS container?

You can use Disk Utility under High Sierra to remove the APFS volume containing Mojava. However, removing Mojave also requires steps where commands are issued in a Terminal application window. Below are the steps I used to remove the Mojava.

  1. Open the Disk Utility application.
  2. Get the file system UUID of the Mojave 1 volume . Right click the icon labeled Mojava 1 in the Disk Utility application and select Get Info. In my case, the file system UUID is 0FF6C520-6C07-40ED-9AED-FD6E28A6E406.
  3. Use Disk Utility to remove the APFS volume containing Mojava. Right click on the icon labeled Mojava 1 in the Disk Utility application and select Delete APFS Volume....
  4. Boot to macOS Recovery.
  5. Open a Terminal application window.
  6. Enter the command below to disable System Integrity Protect (SIP) on next restart.

    sudo  csrutil  disable
    
  7. Boot back to High Sierra.

  8. Open a Terminal application Window.

  9. Enter the commands below to remove Mojava from APFS Volume Preboot.

    diskutil  mount  disk2s2
    cd /Volumes/Preboot
    rm  -Rf  0FF6C520-6C07-40ED-9AED-FD6E28A6E406
    cd  ~
    diskutil  unmount  disk2s2
    
  10. Enter the commands below to remove Mojava from APFS Volume My Recovery.

    diskutil  mount  disk2s3
    cd  "/Volumes/My Recovery"
    rm  -Rf  0FF6C520-6C07-40ED-9AED-FD6E28A6E406
    cd  ~
    diskutil  unmount  disk2s3
    
  11. Reset the SIP settings, by entering the command given below.

    sudo  csrutil  clear
    
  12. Restart the Mac