Contribute
Register

[Guide] Avoid APFS conversion on High Sierra update or fresh install

APFS disaster finally struck. I did some minor configuration changes to my APFS HS, with trim enabled in my config.plist file, after which I decided to reboot. The result of that reboot was pages and pages of inode errors. When the scrolling inode error pages finally stopped I tried to reboot again but the scenario was identical to my first boot with pages and pages of inode errors. I then fired up my spare High Sierra on HFS+ J, reformatted the SSD "Samsung 850 EVO 500GB with APFS. Using CCC I then recloned HS back to the SSD. Recloning just over 50 GB took 12 mins. 27 secs. I then implemented the original intended changes, rebooted and everything is working just fine again. HS on APFS was active and working flawless from 27 Sept. till today, merely 7 days. Food for thought indeed, and perhaps an eye opener for those that are prepared to put all their eggs in one basket and rely entirely on High Sierra on an APFS formatted drive. After this experience I have to conclude that APFS is certainly not ready yet to be deployed in a mission critical environment.
This problem manifested itself on my Skylake build.
Cheers
There is a model check in linux that blacklists certain drives from queued TRIM commands
Code:
/* devices that don't properly handle queued TRIM commands */
    { "Micron_M500_*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*M500*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Micron_M5[15]0_*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*M550*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*MX100*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Samsung SSD 8*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "FCCT*M500*",            NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, }
https://github.com/torvalds/linux/blob/master/drivers/ata/libata-core.c
 
There is a model check in linux that blacklists certain drives from queued TRIM commands
Code:
/* devices that don't properly handle queued TRIM commands */
    { "Micron_M500_*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*M500*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Micron_M5[15]0_*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*M550*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*MX100*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Samsung SSD 8*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "FCCT*M500*",            NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, }
https://github.com/torvalds/linux/blob/master/drivers/ata/libata-core.c

So I guess the theory is that HFS+J does not use queued TRIM, but APFS does.
 
So I guess the theory is that HFS+J does not use queued TRIM, but APFS does.
It might have something to do with it. I'm also wondering if new filesystem features involve batch TRIM operations before the disk is remounted at startup.
 
There is a model check in linux that blacklists certain drives from queued TRIM commands
Code:
/* devices that don't properly handle queued TRIM commands */
    { "Micron_M500_*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*M500*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Micron_M5[15]0_*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*M550*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Crucial_CT*MX100*",        "MU01",    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "Samsung SSD 8*",        NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, },
    { "FCCT*M500*",            NULL,    ATA_HORKAGE_NO_NCQ_TRIM |
                        ATA_HORKAGE_ZERO_AFTER_TRIM, }
https://github.com/torvalds/linux/blob/master/drivers/ata/libata-core.c

Thank you vulgo for sharing this with us. Will do some research as well, have been using Linux since Slackware beta 0.98. Many moons ago that is. Am quite at home in that environment.
 
As you already know, macOS High Sierra includes a new file system APFS. If your system drive is solid state, the installer will convert from HFS+J to APFS in both a fresh install scenario and an update scenario.

Fortunately, there a ways around this automatic conversion. It is controlled by the ConvertToAPFS option in /macOS Install Data/minstallconfig.xml.


Update scenario

The update scenario is a little bit easier than the fresh install procedures, as there is a command line tool we can run that sets ConvertToAPFS false with a command line option.

After downloading the 10.13 installer, instead of running it, quit.

Then in Terminal:
Code:
/Applications/"Install macOS High Sierra.app"/Contents/Resources/startosinstall --converttoapfs NO --agreetolicense

The system will copy some files, then reboot, and you'll be able to start the installer (without APFS conversion) by booting the "Boot macOS Install from ..." option in Clover.


Fresh install scenario

Refer to this guide for an overview of the installation process from USB:
https://www.tonymacx86.com/threads/guide-booting-the-os-x-installer-on-laptops-with-clover.148093/

The process involves creating an installer USB with createinstallmedia, then booting that USB (via Clover on the same USB). You then run the installer create an HFS+J partition suitable for macOS with Disk Utility, then point the installer to that partition.

Even though you create a new HFS+J partition, if the target is an SSD, the installer will still convert it to APFS.

To avoid that, after running the installer, and upon the first reboot where you would be normally directing Clover to boot the next stage of the installer by selecting "Boot macOS Install from ...", instead boot the "install_osx" partition on USB again. When that is finished booting, choose Terminal from the Utilities menu.

Now, in Terminal, navigate to your target volume:
Code:
# list /Volumes to remind yourself of the name you gave it
ls -l /Volumes
# then change your working directory to it (in my case, I used '1013')
cd /Volumes/1013
# now change to the "macOS Install Data" directory
cd "macOS Install Data"

Now, still in Terminal, edit the minstallconfig.xml file with vi:
Code:
vi minstallconfig.xml

You will find code:
Code:
    <key>ConvertToAPFS</key>
    <true/>

Your goal is to change the true to false.

If you know how to use vi, this will not be a problem. Otherwise, follow the instructions below very carefully:
- arrow such that the cursor is at the 't' in 'true'
- press the Del key (forward delete) four times (this removes 'true')
- press i (this puts vi into insert mode)
- type 'false' (without the quotes)
- press Esc (this takes vi out of insert mode)

The result should look like:
Code:
    <key>ConvertToAPFS</key>
    <false/>

If the file looks good:
- press ':wq' (without the quotes) and press enter (':wq' saves the file and exits vi)

If the file doesn't look right, don't save it:
- press ':q!' (without the quotes) and press enter

That's it! Now you're ready to quit Terminal, reboot, and continue the installation process by booting the "Boot macOS Install from ..." partition. When you're done, you'll have a fresh install on HFS+J instead of APFS.


Background information

https://forums.developer.apple.com/thread/48793
http://www.insanelymac.com/forum/topic/324194-pre-release-macos-high-sierra/page-191#entry2497909
Hi RehabMan, amazing guide ! I have a Samsung EVO 840 120 , tried going ahead with the normal APFS but had problems booting clover from SSD, not sure if it's related but decided to wipe and start over avoiding APFS this time.

I followed your instructions to the letter as per Fresh Install, did the steps ,changed to false, wrote and quit then open the xml file again just so see the change was there, it was so quited and rebooted, started the 2nd phase and it starts normally "11 minutes remaining..." then it goes to a visual message saying:

macOS could not be installed on your computer
An error occurred installing macOS. To use Apple Diagnostics to check your Mac hardware, shut down, blah blah...

How can I help you help me?
 
Hi RehabMan, amazing guide ! I have a Samsung EVO 840 120 , tried going ahead with the normal APFS but had problems booting clover from SSD, not sure if it's related but decided to wipe and start over avoiding APFS this time.

I followed your instructions to the letter as per Fresh Install, did the steps ,changed to false, wrote and quit then open the xml file again just so see the change was there, it was so quited and rebooted, started the 2nd phase and it starts normally "11 minutes remaining..." then it goes to a visual message saying:

macOS could not be installed on your computer
An error occurred installing macOS. To use Apple Diagnostics to check your Mac hardware, shut down, blah blah...

How can I help you help me?

Off-topic.
Open a separate thread.

Read FAQ, "Problem Reporting"
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Why is it Off-Topic? Ignore the first part if so, I am saying I get an error when following this Guide.
Ignore the Clover comments, this is about Avoiding APFS and forcing it to HFS+ instead, so In-Topic I believe

Thank you.

This is not on a Laptop, it's a Desktop.

This guide does not cover all the issues that may result in your trying to install on your desktop (or laptop).
Please open a separate thread in the appropriate forum.

Your issue is likely due to an incorrect EFI/Clover, incorrect partition layout, or something else.
 
This guide does not cover all the issues that may result in your trying to install on your desktop (or laptop).
Please open a separate thread in the appropriate forum.

Your issue is likely due to an incorrect EFI/Clover, incorrect partition layout, or something else.

I truly doubt that, I am using the same USB Clover that allowed me to install HS as AFPS just fine, the problem I mentioned I had before is related to booting clover from SSD and I haven't even gotten to that part yet. As I mentioned I started over, and got this error where I did not get it before.

I am doing a fresh install, this message that came up is clearly related to my "Avoiding APFS" , the same USB works just fine if a do not alter minstallconfig.xml

But if there is no way to trace the error I guess I could just start over?

-UPDATE: I'll just start all over. Thanks!
 
Last edited:
I truly doubt that, I am using the same USB Clover that allowed me to install HS as AFPS just fine, the problem I mentioned I had before is related to booting clover from SSD and I haven't even gotten to that part yet. As I mentioned I started over, and got this error where I did not get it before.

I am doing a fresh install, this message that came up is clearly related to my "Avoiding APFS" , the same USB works just fine if a do not alter minstallconfig.xml

But if there is no way to trace the error I guess I could just start over?

-UPDATE: I'll just start all over. Thanks!

No way for me to check what you've done regarding minstallconfig.xml.
Make sure you follow the guide carefully.
If you make a mistake in editing the xml file, you will probably break the install.
Editing XML must be done carefully and exactly as described.
 
Back
Top