To resolve this issue, you'll need to boot into Internet Recovery Mode, reformat your Mac's internal hard drive, and then reinstall macOS.
The issue likely arose from an incorrect formatting of the internal hard drive, causing the "Macintosh HD" partition to disappear. Since your Mac no longer has a functional macOS installation, you're encountering the folder with a question mark during the boot process.
Take the following steps to fix the problem:
- Shut down your Mac.
- Press the power button, then immediately press and hold the Option + Command + R keys.
- Release the keys when you see the spinning globe.
- In the macOS Utilities window, select "Disk Utility" and click Continue.
- Click View > Show All Devices, if available.
- Select the top-level disk and click Erase.
- Name your internal drive Macintosh HD.
- Select APFS as the format if running macOS High Sierra or later; otherwise, choose Mac OS Extended (Journaled).
- Keep the scheme GUID Partition Map.
- Click Erase.
- After the erase process is finished, close Disk Utility.
- Select "Reinstall macOS" and follow the instructions on the screen to install the operating system.
If Internet Recovery Mode doesn't allow you to erase the drive as well, you can do it by booting from an external bootable drive.