This guide is for troubleshooting macOS in the scenario that it can’t boot up.
I have personally encountered a couple of times, frightening scenarios, where my mac somehow could not boot up, or get stuck during login etc. macOS provides many “secret” modes to help to troubleshoot.
Knowing them will be handy in time of crisis.
You will need to hold down certain keys when your machine is powered on to enter these modes. When you hear the startup sound and see the Apple logo, you may release the keys.
Hold Command + Option + P + R
Parameter RAM stores default values, and it could get corrupted for some reasons.
This is The Number 1 troubleshooting resolution. Always try this first.
Similar to resetting PRAM, but SCM involves cutting off power, hence it is different for MacBook and iMac. Read this.
Hold Command + V
If resetting fails, use verbose mode to identify what is causing the problem.
This will boot without loading third-party drivers and startup programs.
Single User Mode
Hold Command + S
In single user mode, you have access to terminal, so you can run certain tools to troubleshoot.
# Check and repair file system for consistency /sbin/fsck -fy
Apple Hardware Test
You can perform a short test (around 3 min), or an extended test (around 1 hour).
Special case: If you encountered
4HDD/11/40000000: SATA(0,0), it could be a false positive. You can disable looping by pressing L before starting the test. I encountered this, but I still managed to “fix” it - the SSD is not damaged in my case. So don’t worry too much on this error.
Hold Command + R
If all else failed, you can try reinstalling macOS.
You can startup from other device such as external drive. It is possible to load the entire OS in an external drive, and boot from there.