IT Support & Help Desk Fundamentals Module 4 – Operating systems: install, update and recover
Install, reinstall and erase macOS
Reinstall macOS from Recovery without losing files, erase a Mac for its next owner, handle Activation Lock, and revive a Mac that will not start.
What you will learn
- Start any Mac in macOS Recovery and reinstall macOS without erasing the disk
- Prepare a Mac for its next owner with Erase All Content and Settings
- Check and clear Activation Lock before a Mac changes hands
- Recognise when a Mac needs a firmware revive or restore from a second Mac
- Choose between a reinstall, an erase and a firmware restore from the symptoms
Before you start
What you’ll learn · Before you start
What you will learn
- Start any Mac in macOS Recovery and reinstall macOS without erasing the disk
- Prepare a Mac for its next owner with Erase All Content and Settings
- Check and clear Activation Lock before a Mac changes hands
- Recognise when a Mac needs a firmware revive or restore from a second Mac
- Choose between a reinstall, an erase and a firmware restore from the symptoms
Before you start
On this page
A Mac on the bench carries three questions: can it be mended without losing the user’s files, is it going to someone else, and does it start at all? Those answers pick one of five paths, and only two of them erase the disk. A reinstall from macOS Recovery: The small macOS kept on a Mac for repairs. From it you can reinstall macOS, restore a Time Machine backup, repair or erase the disk in Disk Utility, reset a forgotten login password and open Terminal. replaces the system files and leaves every account and document in place. Erase All Content and Settings wipes a Mac for its next owner in one pass, on macOS Monterey 12 or later with Apple silicon or the T2 chip. An older Mac is erased in Disk Utility and then reinstalled. A Mac that shows nothing at all is revived, or as a last resort restored, from a second Mac over a USB-C cable.
You will read a Mac’s version and chip from a recorded session, step through a reinstall that keeps the data, work a handover in the order that protects files, check Activation Lock before anything is erased, and apply one rule order to nine support calls.
Which Mac is this, and which macOS does it run?
Three facts belong in the ticket before anyone touches a menu: the installed version of macOS, whether the Mac runs on Apple silicon or an Intel processor, and whether a backup exists. The first two take one read-only session on the Mac itself:
from session import run
# The three facts to write into the ticket before any reinstall: which macOS is installed (name, version and build),
# whether the Mac runs on Apple silicon (arm64) or an Intel processor, and the kernel the installed system boots.
# Every command here only reads the system; nothing is installed, erased or changed.
run("""
sw_vers
uname -m
sysctl -n hw.optional.arm64
uname -s -r
""") Output
$ sw_vers ProductName: macOS ProductVersion: 26.7.1 BuildVersion: 25G241 $ uname -m arm64 $ sysctl -n hw.optional.arm64 1 $ uname -s -r Darwin 25.6.0
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 mac_session.py
sw_vers names the system, its version and its build, which is the number Apple’s release notes use. uname -m
prints the processor family: arm64 means Apple silicon: Apple's own processors for the Mac, reported as arm64 by uname -m. Such a Mac starts macOS Recovery from its power button, and its firmware can be revived or restored from a second Mac., and x86_64 means an Intel
processor. sysctl -n hw.optional.arm64 is the same answer as a flag: it prints 1 on Apple silicon and nothing at
all on an Intel Mac. The Mac in the session runs macOS 26.7.1, build 25G241, on Apple silicon with the Darwin 25.6.0
kernel.
The chip decides three things later in this lesson: which keys start Recovery, whether the Mac has the one-click erase feature, and whether its firmware can be revived from another Mac. So it is worth one command, not a guess from the case or the model name.
The installed version matters for a second reason. Apple’s security releases page lists the latest macOS as 27.0.1 and publishes security updates for three versions at a time: macOS Golden Gate 27, macOS Tahoe 26 and macOS Sequoia 15. The Mac in the session, on 26.7.1, is one major version behind the current one and still inside that window. A reinstall from Recovery gives you back the version that is installed, not the newest one, so moving a Mac to a newer major version is a separate job: see updates, patches and drivers.
The third fact has no command behind it: ask the user. The Time Machine menu in the menu bar shows when the last backup finished, and a Mac whose answer is “never” changes the order of the whole job, because the safe steps come before the useful ones. On a Mac with FileVault turned on, the login password is also the only way into the data, so a user who cannot remember it is a very different ticket from one whose Mac merely boots to a grey screen.
Write the three facts down first
Version and build, chip, and when the last backup finished. Every later decision quotes one of them, and a ticket that records them can be continued by someone else without starting the diagnosis again.
macOS Recovery starts differently on each chip
Recovery is a small macOS stored on the Mac itself, with the tools that cannot run while the ordinary system is running: Reinstall macOS, Restore From Time Machine, and Disk Utility for repairing or erasing the startup disk, with other utilities such as Terminal in the menu bar at the top of the screen.
Getting into it is where most tickets stall, because the two chips need different actions. On a Mac with Apple silicon, shut the Mac down, then press and hold the power button until the screen says “Loading startup options”; release it, click Options, then Continue. On an Intel Mac, press and release the power button and immediately hold Command-R until a logo or a spinning globe appears. If macOS will not shut down first, hold the power button for up to 10 seconds until the Mac turns off.
Two more prompts follow on both chips: which volume to recover, usually Macintosh HD, and a user whose login password you know. Step through the whole path, from a cold Mac to a system that starts again with its files untouched:
The drawing shows the whole scene; its 8 steps are listed below.
Every step as text
- Turn it off first. Recovery starts from a Mac that is off. If macOS will not shut down normally, hold the power button (the Touch ID button on a laptop that has one) for up to 10 seconds until the Mac turns off.
- The chip decides the keys. On a Mac with Apple silicon, press and hold the power button until the screen says "Loading startup options", release it, then click Options and Continue. On an Intel Mac, press and release the power button and immediately hold Command-R until a logo or a spinning globe appears.
- Which disk, and whose password. Recovery asks which volume to recover, usually Macintosh HD, and then for a user whose login password you know. Without that password this is where the job stops and becomes a password reset instead.
- The window of utilities. Recovery is its own small system. Its window offers Restore From Time Machine, Reinstall macOS and Disk Utility, which repairs or erases the startup disk, and the menu bar adds other utilities such as Terminal.
- Check the disk first. Open Disk Utility and run First Aid on the container and the volume first. A reinstall writes a fresh copy of macOS onto a disk it trusts; errors found here change the plan, because copying onto a failing disk wastes the time you have.
- When First Aid reports errors. If First Aid cannot repair the volume, go back to the utilities and get the data out first: restore from the Time Machine backup, or copy the files off with another Mac, before any install touches the disk again.
- Reinstall, without erasing. Reinstall macOS replaces the system files and leaves the users, their files and their settings in place. It asks for the disk to install on and needs the network and power for the download, which on a slow line is the longest part of the job.
- The same Mac, a new system. The Mac restarts to the ordinary login box with the same accounts and the same files. Nothing was erased, so there is nothing to restore: the ticket closes with the version installed and the time it took.
The step that catches people out is the password prompt. Recovery wants a login password of an account on this Mac, not an Apple Account password. When nobody has it, the work becomes a password reset: Apple’s instructions are to click “Forgot all passwords?” at that prompt, then prove ownership with a recovery key or the Apple Account previously used with the Mac. Do that only on a Mac your organisation or the user in front of you owns, and record who authorised it.
An Intel Mac has one extra route. If its built-in Recovery is damaged, it falls back to Internet Recovery, shown as a spinning globe, and two key combinations force that on purpose: Option-Command-R and Shift-Option-Command-R. Each also changes which version of macOS the reinstall offers, so they are worth knowing when a Mac must land on a particular version. A warning symbol on the globe, or a numbered error such as -2001F, points at the network rather than the Mac.
Three habits save the second visit on an Intel Mac. Use the built-in keyboard of a laptop rather than an external one, because the keys have to be read before macOS loads; with an external keyboard, wait a few seconds after pressing the power button and prefer a wired one made for a Mac. Attach Ethernet, or pick a network from the Wi-Fi menu, when Internet Recovery asks for one. And if the Mac has been set to start from Windows with Boot Camp, set it back to starting from macOS before trying the key combination at all, because the firmware is looking at the other disk.
Checkpoint
Check: The version and the chip · Starting macOS Recovery
A reinstall from Recovery keeps every file
Reinstall macOS writes a fresh copy of the operating system over the one on the disk. Accounts, documents, settings and installed apps stay where they are, which is why it is the first thing to try when a Mac boots to a grey screen, loses its login window, or behaves as though system files are damaged. It is not a cure for everything: it will not recover a forgotten password, repair a failing disk, or remove a configuration profile pushed by a management service.
| What a reinstall replaces | What it leaves alone |
|---|---|
| The macOS system files and the recovery system | Every user account and its home folder |
| The built-in apps that ship with macOS | Documents, photos, mail and app data |
| Nothing else on the disk | Installed apps, printers and network settings |
The table is also the warning: because a reinstall leaves the data, it does nothing to prepare a Mac for a new owner. That is a different path, two sections down.
Back up first anyway, whenever the disk can still be read. Time Machine is built in, and Apple’s guidance is a backup disk with at least twice the storage of the Mac, used for backups only: a 1 TB Mac wants a 2 TB disk. Its schedule is hourly backups for the past 24 hours, daily backups for the past month and weekly backups for every month before that, with the oldest deleted when the disk fills. Run First Aid in Disk Utility before the install as well, as the figure above shows: a reinstall onto a disk with errors spends an hour writing files that may not survive.
Erasing when a reinstall would have done
Wrong: a Mac quits apps at random, so the technician erases the disk, reinstalls and spends the afternoon restoring a backup. Right: run First Aid, then reinstall over the data, which keeps the files and the settings. Erase only when the Mac is changing hands, or when First Aid cannot repair the volume and the data is already safe elsewhere.
One tool belongs in this section rather than the next. A bootable installer on a USB drive, made with
createinstallmedia, is not needed to upgrade or reinstall macOS at all; Apple describes it for the cases where the
usual methods fail, or where several Macs must be installed without downloading the installer each time. A 32 GB flash
drive is more than enough, and it is erased in the making.
Checkpoint
Check: A reinstall that keeps the data
Erase All Content and Settings is the handover tool
When a Mac goes to a new owner, a colleague or a trade-in, the job is the opposite of a reinstall: the system should stay and everything personal should go. Erase All Content and Settings does that in one pass from inside macOS. Apple’s conditions are exact: macOS Monterey 12 or later, on a Mac with Apple silicon or the Apple T2 Security Chip. Everything older takes the manual route below.
The button lives in System Settings: click General in the sidebar, scroll down on the right, click Transfer or Reset, then Erase All Content and Settings. On macOS Monterey 12 itself the same feature sits in the System Preferences menu. The Mac then asks for two different passwords, and the order surprises people: first the login password of an administrator of this Mac, then the Apple Account password, because the erase signs the Mac out of Apple services. If a message offers to sign back in to iCloud, Apple’s instruction is to ignore it and continue.
Follow the whole handover, including where the files are saved and where an older Mac turns off the main road:
The drawing shows the whole scene; its 8 steps are listed below.
Every step as text
- Save the files first. An erase is the one step with no way back, so the files leave the Mac first: a Time Machine backup to an external disk, or a transfer straight to the next Mac. Apple advises a backup disk of at least twice the Mac's own storage.
- An unfinished repair blocks it. On a Mac with Apple silicon running macOS 26 or later, Apple asks you to open Repair Assistant first and check for an unfinished repair. A part moved from another Mac can still be tied to its old owner's Apple Account.
- Where the button lives. Open System Settings, click General in the sidebar, scroll down on the right and click Transfer or Reset. Erase All Content and Settings is there, on a Mac that can use it.
- Two different passwords. The Mac asks for the login password of an administrator of this Mac, and then for the Apple Account password, because the erase signs the Mac out of Apple services. If a prompt offers to sign back in, Apple says to ignore it and carry on.
- The Mac does the work. Apps, data and settings go, and the installed version of macOS stays: there is no download and no installer. On the way back up the Mac may ask for a Bluetooth keyboard or a Wi-Fi network so that it can activate.
- Leave it out of the box. The Mac restarts to the setup assistant, exactly as a new one does. For a Mac you are handing on, do not work through it: hold the power button until the Mac turns off, so the next owner gets the first screen.
- An older Mac takes the long road. Without that button the work is manual: sign out of iCloud and iMessage, unpair Bluetooth accessories whose names carry a person's name, then start from Recovery, erase the disk in Disk Utility and reinstall macOS.
- Same ending, more steps. After the reinstall the Mac also restarts to the setup assistant; press Command-Q to shut it down instead of setting it up. On an Intel Mac, resetting NVRAM clears settings kept outside the disk.
Two conditions in the figure are easy to miss. On a Mac with Apple silicon running macOS 26 or later, Apple asks you to check Repair Assistant for an unfinished repair first, because a part moved from another Mac can still be tied to its old owner’s Apple Account. And if the Mac reports that other volumes must be erased first, Windows was probably installed with Boot Camp: remove it and its partition with Boot Camp before erasing.
What makes this path quick is that the installed macOS stays: there is no download and no installer, so a handover takes minutes rather than the hour a reinstall needs on a slow line. The Mac restarts into the setup assistant, and for a Mac you are passing on, Apple’s advice is not to work through it. Hold the power button until the Mac turns off, and the next owner gets the first screen, exactly as a new Mac does.
The manual route for an older Mac is six steps rather than one: sign out of iCloud and then iMessage, unpair or rename Bluetooth accessories that carry someone’s name, start from Recovery, erase the disk in Disk Utility, reinstall macOS, press Command-Q at the setup assistant, and on an Intel Mac reset NVRAM so that settings kept outside the disk go too. In Disk Utility that erase is of the whole APFS: Apple File System, the format macOS installs onto from macOS 10.13 on. Apple lists strong encryption, space sharing and snapshots among its features. More in “Operating systems, editions and support dates” volume group, not one volume of it, or the Mac is left with orphaned data volumes.
Checkpoint
Check: Erase All Content and Settings
Activation Lock decides whether a Mac can be set up
Activation Lock: A Mac feature that follows Find My: while it is on, the owner's Apple Account password or the device passcode is required before anyone can turn Find My off, erase the Mac, or reactivate and use it. is the reason a second-hand Mac sometimes cannot be used at all. Turning on Find My enables it, and from then on the owner’s Apple Account password or the device passcode is required before anyone can turn off Find My, erase the Mac, or reactivate and use it. Apple’s requirements for the feature are a Mac with Apple silicon or the T2 chip, macOS Catalina 10.15 or later, the default security policy (Full Security, or Secure Boot with external media disallowed on a T2 Mac), and two-factor authentication on the Apple Account.
The owner clears it themselves, in one of two ways. On a Mac they can sign in to: System Settings, their name, iCloud, See All, then Find My Mac, turned off with their Apple Account password. On a Mac that is offline, lost or already in someone else’s hands: sign in at iCloud.com/find, select the Mac and click Remove. A Mac managed by an organisation is different again: the device management service that enrolled it clears the lock, which is why company Macs should be enrolled before they are handed to staff rather than after.
| The Mac is yours to erase | The Mac is not yours |
|---|---|
| Sign out of Find My, then erase, then hand it on | Stop: the Mac cannot be activated without its owner |
| Lost the password? Use Apple’s account recovery | Ask the seller or owner to remove it at iCloud.com/find |
| Managed Mac? The device management service clears it | No proof of purchase, no owner reached: it is not usable |
The second column is a support boundary, not a puzzle to solve. There is no legitimate technician’s trick for a Mac locked to another person’s Apple Account, and treating one as a challenge wastes hours and risks handling stolen property. Apple’s own route is an Activation Lock support request with proof of purchase, and that is where such a ticket goes.
One more case looks like a lock and is not quite one. A Mac repaired with a part taken from another Mac can carry a part still tied to that Mac’s owner, which is why Apple asks owners of Apple silicon Macs on macOS Tahoe 26 or later to check Repair Assistant for an unfinished repair before erasing or passing the Mac on. A workshop that swaps parts between machines, as a school or a repair bench does, should record which part went where, because the Mac will ask about it later.
Check the lock before money or time is spent
Before buying used Macs for a team, or accepting one back from a leaver, confirm that Find My is off and the Mac reaches its own setup assistant without asking for an Apple Account. A Mac that asks is worth nothing until its owner removes it, and that check costs two minutes.
Checkpoint
Check: Activation Lock
A Mac with no sign of life needs a second Mac
Rarely, a Mac with Apple silicon or the T2 chip loses the firmware that starts it. Apple names the symptoms: an exclamation point in a circle, a blank screen that nothing else explains, a status light showing the firmware recovery pattern, or an installation that fails for no other reason. A power cut during a macOS installation is one documented cause, and no key combination on the Mac itself can fix it, because the part that reads the keys is the part that is broken.
The repair is done by a second Mac. It can be any model on macOS 14 or later, online, with around 32 GB of storage available for what it downloads, and the two Macs are joined by a USB-C to USB-C cable that carries data as well as charge. A Thunderbolt 3 cable will not do, the cable must go straight into both Macs rather than through a hub, and on the affected Mac it must be in the DFU port with nothing in its other USB ports. Both Macs stay on power throughout.
The drawing shows the whole scene; its 8 steps are listed below.
Every step as text
- What this looks like. A Mac with Apple silicon or the T2 chip starts to an exclamation point in a circle, or to a blank screen that nothing else explains. Apple names a power failure during a macOS installation as one cause.
- The second Mac. The firmware cannot be rewritten by the Mac itself, so another Mac does it. Any model will do, on macOS 14 or later, online, with about 32 GB of spare storage for the files it downloads. Both Macs stay on power throughout.
- The cable is a real condition. A USB-C to USB-C cable that carries data as well as charge, plugged straight into both Macs and not through a hub. A Thunderbolt 3 cable does not work for this, which is the most common reason the next screen never appears.
- One port, no others. The cable goes into the affected Mac's DFU port and nothing else is plugged into its other USB ports. On a laptop with a MagSafe port, use MagSafe for power so that no USB port is taken.
- The keys, and the proof. A laptop enters DFU mode with Control, Option, Shift and the power button on its built-in keyboard, a desktop by holding the power button while plugging the power back in. It worked when the second Mac shows a DFU window in the Finder.
- Revive keeps the data. In that window, Revive Mac rewrites the firmware and the recovery system and leaves the disk alone. Apple says to try it first: it is faster than restoring and it does not erase the Mac. Keep the second Mac awake until it finishes.
- Restore erases the disk. If reviving cannot bring the Mac back, Restore Mac puts it back to factory settings, so the disk is erased. That is the moment the backup matters: without one, the user's files end here.
- Finishing either way. A revived Mac restarts and asks for a volume and a login password. A restored Mac starts into setup, or on a T2 Mac into Internet Recovery, where macOS is installed again and a Time Machine backup can be restored.
The order in that figure is the whole point. Reviving rewrites the firmware and the recovery system and leaves the disk alone; Apple’s page says to try it first because it is faster and it does not erase the Mac. Restoring puts the Mac back to factory settings, which erases everything on it, and is for a Mac that reviving could not bring back. One of them is a repair, the other is a repair plus a data-loss conversation, so they are never offered to a user as interchangeable.
Two practical details save callbacks. The proof that DFU mode: Device firmware update mode: the state in which a Mac's firmware can be rewritten by a second Mac over a USB-C cable. The Mac's own screen stays blank and the second Mac shows a DFU window in the Finder. worked is a DFU window in the Finder of the second Mac, showing “Mac” in the sidebar and “Mac DFU Mode” on the right; if it does not appear, Apple’s first suggestions are the Finder’s sidebar setting for devices, then the timing of the key presses, then a different cable. And on a managed network the second Mac needs to reach Apple’s network, 17.0.0.0/8, so a proxy, firewall or VPN that blocks it will stop a revive halfway.
Getting into DFU mode is also the step people practise least, and it differs by shape of Mac. A laptop is held at Control, Option, Shift and the power button together on its own built-in keyboard, with the timings Apple gives for Apple silicon and for T2 Macs. A desktop needs no keys at all: unplug it from power, hold the power button, and keep holding while you plug the power back in. Both keep the cable in the DFU port and every other USB port empty, which is worth checking twice before deciding that the Mac is beyond a revive.
Checkpoint
Check: Reviving and restoring firmware
One rule order for nine calls
Each path above is simple on its own. The skill is picking one in the first minutes of a call, from what the user can tell you. This program holds nine calls as data, applies the conditions of Apple’s articles in a fixed order, and prints the path and a short reason code for each:
"""Picks the path for nine Mac calls: reinstall, erase, reset a password, or revive the firmware from another Mac.
The conditions are Apple's own (support articles 102518, 102541, 102664 and 108900). The first rule that matches a
call wins, so the order in recommend() is the order a technician works in: what is not ours to change, then a Mac
that will not start at all, then the disk, then whether the Mac is being handed on, and only then the everyday
reinstall that keeps the data.
"""
CALLS = [
{
"name": "Lab iMac: login password unknown",
"chip": "apple-silicon", "macos": 26, "starts": "desktop", "disk": "healthy",
"purpose": "keep-user", "lock": "ours", "tried_revive": False, "blocked": "login-password",
},
{
"name": "Finance iMac: First Aid reports errors",
"chip": "t2", "macos": 15, "starts": "desktop", "disk": "errors",
"purpose": "keep-user", "lock": "ours", "tried_revive": False, "blocked": None,
},
{
"name": "MacBook Pro: system files damaged",
"chip": "apple-silicon", "macos": 26, "starts": "recovery-only", "disk": "healthy",
"purpose": "keep-user", "lock": "ours", "tried_revive": False, "blocked": None,
},
{
"name": "MacBook Air: handed to a new joiner",
"chip": "apple-silicon", "macos": 26, "starts": "desktop", "disk": "healthy",
"purpose": "hand-on", "lock": "ours", "tried_revive": False, "blocked": None,
},
{
"name": "Intel MacBook Air, no T2: being sold",
"chip": "intel", "macos": 12, "starts": "desktop", "disk": "healthy",
"purpose": "hand-on", "lock": "ours", "tried_revive": False, "blocked": None,
},
{
"name": "Intel iMac: flashing question mark",
"chip": "intel", "macos": 15, "starts": "recovery-only", "disk": "not-found",
"purpose": "keep-user", "lock": "ours", "tried_revive": False, "blocked": None,
},
{
"name": "Used Mac: another owner's Apple Account",
"chip": "apple-silicon", "macos": 15, "starts": "desktop", "disk": "healthy",
"purpose": "keep-user", "lock": "other-apple-account", "tried_revive": False, "blocked": None,
},
{
"name": "Managed MacBook Air: a leaver's lock",
"chip": "apple-silicon", "macos": 26, "starts": "desktop", "disk": "healthy",
"purpose": "hand-on", "lock": "managed", "tried_revive": False, "blocked": None,
},
{
"name": "Power cut in an update: dead screen",
"chip": "apple-silicon", "macos": 26, "starts": "no", "disk": "healthy",
"purpose": "keep-user", "lock": "ours", "tried_revive": False, "blocked": None,
},
]
# What each path does to what is on the disk, so a ticket can say it before the work starts.
ERASES = {
"erase-all-content-and-settings",
"erase-then-reinstall",
"restore-firmware-in-dfu",
}
def erase_all_ready(call):
"""True when the Mac meets Apple's conditions for Erase All Content and Settings (article 102664)."""
return call["macos"] >= 12 and call["chip"] in ("apple-silicon", "t2")
def recommend(call):
"""Return the path to take for one call, and the short reason code that explains it."""
if call["lock"] == "other-apple-account":
return "stop-and-reach-the-owner", "LOCK-NOT-OURS"
if call["lock"] == "managed":
return "clear-lock-in-device-management", "LOCK-MANAGED"
if call["starts"] == "no":
if call["tried_revive"]:
return "restore-firmware-in-dfu", "REVIVE-DID-NOT-HELP"
return "revive-firmware-in-dfu", "FIRMWARE-REVIVE-FIRST"
if call["disk"] == "not-found":
return "check-disk-in-recovery", "NO-STARTUP-DISK"
if call["disk"] == "errors":
return "first-aid-then-back-up", "DISK-ERRORS-FIRST"
if call["purpose"] == "hand-on":
if erase_all_ready(call):
return "erase-all-content-and-settings", "ERASE-FEATURE-READY"
return "erase-then-reinstall", "NO-ERASE-FEATURE"
if call["blocked"] == "login-password":
return "reset-password-in-recovery", "PASSWORD-ONLY"
return "reinstall-over-the-data", "KEEP-THE-DATA"
print(f"{'Call':39} {'Path':31} Reason")
print("-" * 92)
for call in CALLS:
path, reason = recommend(call)
print(f"{call['name']:39} {path:31} {reason}")
erasing = [c["name"] for c in CALLS if recommend(c)[0] in ERASES]
print()
print(f"Erases the disk: {len(erasing)} of {len(CALLS)} calls; the other {len(CALLS) - len(erasing)} leave it as it is.")
for name in erasing:
print(f" back up first: {name}")
print()
print("The new joiner's MacBook Air, with one field changed:")
handover = CALLS[3]
for chip, macos in (("apple-silicon", 26), ("t2", 12), ("intel", 12), ("apple-silicon", 11)):
other = dict(handover, chip=chip, macos=macos)
path, reason = recommend(other)
print(f" {chip:13} macOS {macos:>2} -> {path:31} {reason}")
print()
revived = dict(CALLS[8], tried_revive=True)
print("The dead screen, after a revive that did not finish:", " / ".join(recommend(revived)))
print("Keeping the data is the last rule: every other path is a rule that matched before it.") Output
Call Path Reason -------------------------------------------------------------------------------------------- Lab iMac: login password unknown reset-password-in-recovery PASSWORD-ONLY Finance iMac: First Aid reports errors first-aid-then-back-up DISK-ERRORS-FIRST MacBook Pro: system files damaged reinstall-over-the-data KEEP-THE-DATA MacBook Air: handed to a new joiner erase-all-content-and-settings ERASE-FEATURE-READY Intel MacBook Air, no T2: being sold erase-then-reinstall NO-ERASE-FEATURE Intel iMac: flashing question mark check-disk-in-recovery NO-STARTUP-DISK Used Mac: another owner's Apple Account stop-and-reach-the-owner LOCK-NOT-OURS Managed MacBook Air: a leaver's lock clear-lock-in-device-management LOCK-MANAGED Power cut in an update: dead screen revive-firmware-in-dfu FIRMWARE-REVIVE-FIRST Erases the disk: 2 of 9 calls; the other 7 leave it as it is. back up first: MacBook Air: handed to a new joiner back up first: Intel MacBook Air, no T2: being sold The new joiner's MacBook Air, with one field changed: apple-silicon macOS 26 -> erase-all-content-and-settings ERASE-FEATURE-READY t2 macOS 12 -> erase-all-content-and-settings ERASE-FEATURE-READY intel macOS 12 -> erase-then-reinstall NO-ERASE-FEATURE apple-silicon macOS 11 -> erase-then-reinstall NO-ERASE-FEATURE The dead screen, after a revive that did not finish: restore-firmware-in-dfu / REVIVE-DID-NOT-HELP Keeping the data is the last rule: every other path is a rule that matched before it.
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 mac_recovery.py
Runs on this device, in your browser. The first run downloads Python (about 13.5 MB), which is kept for the next runs.
Your run, in this browser
Read the order of the rules in recommend() rather than the list of paths: what we have no right to change comes first, then a
Mac that will not start, then the disk, then whether the Mac is being handed on, and the reinstall that keeps the data
is the default at the end. Two of the nine calls erase the disk, so two tickets need a backup before any work starts
and seven do not.
Three rows show why the order is not cosmetic. The lab iMac whose login password nobody knows comes out as
PASSWORD-ONLY, not as an erase, because its disk is healthy and its data is wanted: the fix is a reset in Recovery,
and erasing would be an expensive way to avoid asking for proof of ownership. The finance iMac answers
DISK-ERRORS-FIRST even though the user asked for a reinstall, because the disk rule sits above every rule that
writes to it. And the managed MacBook Air returns LOCK-MANAGED rather than a handover erase, which sends the
technician to the device management service rather than to System Settings.
The reason codes are what belongs in the ticket. A path says what you will do; a code says which condition decided it,
so the next person can agree or disagree with the decision instead of guessing at it. NO-ERASE-FEATURE records that
a chip and a version were both checked. FIRMWARE-REVIVE-FIRST records that the Mac showed no sign of life and that
nobody has given up on the data yet.
The block near the end of the output changes one field of the new joiner’s MacBook Air at a time, and the answer flips
between ERASE-FEATURE-READY and NO-ERASE-FEATURE exactly where Apple’s conditions say it should: an Apple silicon
or T2 Mac on macOS 12 or later gets the one-pass erase, an Intel Mac without T2 and a Mac on macOS 11 do not. The same
three questions drive this table, which rules paths out as you answer them:
Answer the questions above: the table then marks what fits your case and says why the rest does not.
| Path | Keeps the files | Works on a dead Mac | Clean for a new owner | Needs nothing extra |
|---|---|---|---|---|
| Reinstall over the data Started from: Recovery, on this Mac | Good replaces the system files only: users, data and settings stay | Poor needs a Mac that can still start into Recovery | Poor every account and file of the last person is still there | Mixed needs the network and power for the download, which can be long |
| Erase All Content and Settings Started from: System Settings | Poor erases apps, data and settings; back up or transfer first | Poor runs inside macOS, so the Mac must start normally | Good signs out of Apple services and ends at the setup assistant | Good no download and no installer: the installed macOS stays |
| Erase then reinstall Started from: Recovery, on this Mac | Poor the disk is erased, so everything on it is gone | Mixed works whenever Recovery still starts | Mixed sign out of iCloud and iMessage by hand before erasing | Mixed downloads macOS again, and the longer route has six stages |
| Revive the firmware Started from: a host Mac, DFU mode | Good updates the firmware only, and does not erase the Mac | Good made for a Mac that shows an exclamation mark or nothing | Poor the old owner's data and accounts are untouched | Poor a second Mac on macOS 14 or later and a USB-C data cable |
| Restore the firmware Started from: a host Mac, DFU mode | Poor erases the Mac and puts it back to factory settings | Good the step after a revive that could not fix the firmware | Good factory state, then the setup assistant asks for an account | Poor the same second Mac and cable, plus about 32 GB of spare storage |
How the answers decide
- “Who will use this Mac next?” The same person, with their files: rules out Erase All Content and Settings, Erase then reinstall and Restore the firmware. Erasing to fix software throws away the files a reinstall over the data would have kept, and the ticket then needs a restore as well.
- “Who will use this Mac next?” Someone else, or it is being sold: rules out Reinstall over the data and Revive the firmware. A reinstall and a revive both leave the accounts, files and signed-in services of the last person in place, which is not a handover.
- “How far does the Mac start up?” Nothing, or a warning symbol: rules out Reinstall over the data, Erase All Content and Settings and Erase then reinstall. Nothing on the Mac can run, so the firmware has to be rewritten from a second Mac over USB-C with the Mac in DFU mode.
- “How far does the Mac start up?” To the login box or the desktop: rules out Revive the firmware and Restore the firmware. Reviving and restoring are for firmware that no longer starts the Mac; a Mac that reaches its login box has a working one.
- “How far does the Mac start up?” Only into Recovery: rules out Erase All Content and Settings and Revive the firmware. Erase All Content and Settings is a button inside macOS, not a Recovery tool, and a Mac that reaches Recovery has firmware that works.
- “Whose Apple Account does the Mac ask for?” Another person we cannot reach: rules out Erase All Content and Settings, Erase then reinstall, Restore the firmware and Reinstall over the data. Activation Lock asks for the owner's Apple Account password before anyone may erase or reactivate the Mac, so only its owner or Apple can clear it.
- “Who will use this Mac next?” Someone else, or it is being sold and “How far does the Mac start up?” To the login box or the desktop: adds a caveat to Erase All Content and Settings. The feature needs macOS Monterey 12 or later on Apple silicon or a T2 Mac: an older Mac takes the manual route instead.
Key idea
Decide in this order: a lock that is not yours stops everything, a Mac that will not start needs a second Mac, a Mac changing hands is erased, and everything else is a reinstall that keeps the files.
Checkpoint
Check: Choosing the path
Practise: the path for three calls
Write the decision for the three calls that matter most on a help desk: a Mac being handed on, a Mac that will not start, and a Mac locked to someone else’s Apple Account. The sample tests check each rule, including the one that refuses a value it does not recognise instead of erasing a Mac by accident.
Write the rules in the order the prompt gives them and return as soon as one matches. That order is the lesson’s whole argument in four lines of code: an impossible job is recognised before a destructive one, a destructive one before a safe one, and the safe reinstall is what is left when nothing else applies. Then take the self-check, which asks about the conditions, the two password prompts and the paths from both figures.
Exercise · Easy · Python
Choose the path for three Mac handover and startup calls
Write recovery_path(call) so that it returns the path a technician should take for one call, as a string. A call is a dictionary with the keys chip ("apple-silicon", "t2" or "intel"), macos (the installed major version, such as 26), starts ("desktop" or "no"), purpose ("keep-user" or "hand-on"), lock ("ours" or "other-apple-account") and tried_revive (True after a revive that did not finish).
Apply the rules in this order and return the first one that matches:
lockis"other-apple-account": return"stop-and-reach-the-owner". Nothing else is possible on a Mac that is locked to someone else's Apple Account.startsis"no": return"revive-firmware-in-dfu", or"restore-firmware-in-dfu"whentried_reviveisTrue. Reviving comes first because it does not erase the Mac.purposeis"hand-on": return"erase-all-content-and-settings"when the Mac can use that feature, which needs macOS 12 or later on a Mac with Apple silicon or the T2 chip, and"erase-then-reinstall"when it cannot.- Otherwise return
"reinstall-over-the-data", the reinstall that keeps the files.
A purpose that is neither "keep-user" nor "hand-on" raises ValueError, so a typo in a script never erases a Mac by accident.
Starter code · recovery_path.py
def recovery_path(call):
"""Return the path for one call: a reinstall, an erase, or a firmware revive or restore."""
return "reinstall-over-the-data" The sample tests · test_recovery_path.py
from recovery_path import recovery_path
OURS = {"chip": "apple-silicon", "macos": 26, "starts": "desktop", "purpose": "keep-user", "lock": "ours", "tried_revive": False}
def test_hand_on_a_mac_that_can_erase_itself():
"""sends a modern Mac being handed on to Erase All Content and Settings"""
call = dict(OURS, purpose="hand-on")
assert recovery_path(call) == "erase-all-content-and-settings"
assert recovery_path(dict(call, chip="t2", macos=12)) == "erase-all-content-and-settings"
def test_hand_on_an_older_mac():
"""erases an older Mac from Recovery instead, then reinstalls"""
call = dict(OURS, purpose="hand-on", chip="intel", macos=12)
assert recovery_path(call) == "erase-then-reinstall"
assert recovery_path(dict(call, chip="apple-silicon", macos=11)) == "erase-then-reinstall"
def test_a_mac_that_will_not_start():
"""revives the firmware first, and only restores after a revive that did not finish"""
dead = dict(OURS, starts="no")
assert recovery_path(dead) == "revive-firmware-in-dfu"
assert recovery_path(dict(dead, tried_revive=True)) == "restore-firmware-in-dfu"
def test_a_lock_that_is_not_ours():
"""stops at a Mac locked to another person's Apple Account, whatever else the call says"""
assert recovery_path(dict(OURS, lock="other-apple-account")) == "stop-and-reach-the-owner"
assert recovery_path(dict(OURS, lock="other-apple-account", purpose="hand-on")) == "stop-and-reach-the-owner"
def test_everything_else_keeps_the_data():
"""falls back to the reinstall that leaves the files in place"""
assert recovery_path(OURS) == "reinstall-over-the-data"
assert recovery_path(dict(OURS, chip="intel", macos=15)) == "reinstall-over-the-data"
def test_an_unknown_purpose_is_refused():
"""refuses a purpose it does not know instead of guessing"""
try:
recovery_path(dict(OURS, purpose="wipe-it"))
except ValueError:
return
raise AssertionError("recovery_path with purpose 'wipe-it' should raise ValueError") A hint
Check the rules in the order the prompt lists them and return as soon as one matches, so a lock that is not yours is answered before anything that erases. Write the conditions for Erase All Content and Settings as one small helper that returns True or False: call["macos"] >= 12 and call["chip"] in a tuple of the two chips that support it. Check the purpose value itself before the rules that use it, so an unknown value raises ValueError rather than falling through to a reinstall.
Results of the sample tests
| Test | Result | Details |
|---|
What your code printed
The sample tests run on this device, in your browser (Pyodide): nothing is sent to mysmartcopilot.com. The first run downloads Python (about 13.5 MB), which is kept for the next runs. A check in your browser is feedback for you, not proof that the code is right for every input.
Practice that adapts to you
Practise this lesson
14 questions about 7 ideas of this lesson. Each answer is explained at once, and what you get right is kept in this browser.
Interview questions
Warm-up (fresher): how do you start macOS Recovery, and what does the Mac ask for once it is there?
It depends on the chip, so read that first. On a Mac with Apple silicon, shut it down, hold the power button until “Loading startup options” appears, release it and click Options, then Continue. On an Intel Mac, press and release the power button and immediately hold Command-R until a logo or spinning globe appears. Recovery then asks which volume to recover, usually Macintosh HD, and for a user whose login password you know; that is a macOS login password, not an Apple Account password. If no one has it, the ticket turns into a password reset through “Forgot all passwords?”, which needs a recovery key or the Apple Account previously used with the Mac. Once in, Recovery offers Reinstall macOS, Restore From Time Machine and Disk Utility, with other utilities such as Terminal in the menu bar.
Warm-up (fresher to 2-5 years): a user wants their Mac “reset”. Which two very different jobs could that mean?
Ask what should survive. If the Mac stays with them and software is broken, the job is Reinstall macOS from Recovery: it replaces the system files and keeps accounts, documents, apps and settings, so nothing has to be restored afterwards. If the Mac is going to someone else, the job is Erase All Content and Settings from System Settings, which removes data, apps and settings, signs the Mac out of Apple services and leaves it at the setup assistant with the installed macOS still in place. The first needs no backup to be safe, though you take one anyway; the second is irreversible, so files are backed up or transferred before it starts. Confusing them either loses a day restoring files, or hands the next owner the last person’s data.
Two harder calls follow: a returned Mac nobody can activate, and a Mac that died mid-update with unsaved work on it. Write down the one thing you would check first, then see whether the model answer starts there:
Model answers open with any pass: ₹79 for 1 week ($2.99), one payment that never renews.
-
Fresher to mid
A MacBook Air comes back from a colleague who has left. At setup it asks for that person's own Apple Account, and the Mac was never enrolled in your device management service. A new starter needs a laptop on Monday. What do you do, in what order, and what do you promise?
-
Mid to senior
A designer's MacBook Pro with Apple silicon lost power during a macOS update. It now starts to an exclamation point in a circle. The newest Time Machine backup is six weeks old and this week's work is only on the disk. You have a second Mac. What do you do, and in what order?
Flashcards · 6 cards
Recall it, then check
Say the answer to yourself before you look: recalling it is what makes it stick.
-
What do you read first on a Mac you are about to reinstall or erase?
The macOS version with sw_vers and the chip with uname -m. The chip decides the Recovery keys, the one-pass erase and whether a second Mac can revive its firmware.
-
How is macOS Recovery started on Apple silicon and on an Intel Mac?
On Apple silicon, shut down, hold the power button until Loading startup options appears, then click Options. On an Intel Mac, press the power button and at once hold Command-R until a logo or a spinning globe appears.
-
What does Reinstall macOS from Recovery keep?
Every account, document and setting, because it replaces only the system files. That makes it the first fix for damaged software and the wrong tool for a handover.
-
What does Erase All Content and Settings need, and where does it leave the Mac?
macOS Monterey 12 or later on an Apple silicon or T2 Mac, the login password and then the Apple Account password. It leaves the Mac at the setup assistant, with nothing to download.
-
A Mac brought to the desk is locked to someone else's Apple Account. What happens to it?
It goes back to its owner, or to Apple's support request, never to a workaround. Activation Lock needs the owner's password or passcode before anyone can turn off Find My, erase the Mac or reactivate it.
-
How is a Mac with no sign of life brought back?
From a second Mac on macOS 14 or later, over a USB-C data cable, with the dead Mac in DFU mode. Revive it first; restore it, which erases it, only if reviving fails.
Key takeaways
- Read the installed version with
sw_versand the chip withuname -mbefore anything else, because the chip decides the Recovery keys, the one-pass erase and whether firmware can be revived from a second Mac. - Recovery starts by holding the power button on Apple silicon and with Command-R on Intel, and it asks for a macOS login password, which turns a forgotten-password call into a reset through “Forgot all passwords?”.
- Reinstall macOS replaces the system files and keeps every account, document and setting, so it is the first fix for damaged software and the wrong tool for a handover.
- Erase All Content and Settings needs macOS Monterey 12 or later on an Apple silicon or T2 Mac, asks for the login password and then the Apple Account password, and leaves the Mac at the setup assistant with no download needed.
- Activation Lock requires the owner’s Apple Account password or passcode before anyone can turn off Find My, erase or reactivate a Mac, so a Mac locked to someone else goes back to its owner or to Apple’s support request, never to a workaround.
- A Mac that shows no sign of life is revived from a second Mac on macOS 14 or later over a USB-C data cable in DFU mode, and only restored, which erases it, when reviving fails.
Terms in this lesson
- Activation Lock
- A Mac feature that follows Find My: while it is on, the owner's Apple Account password or the device passcode is required before anyone can turn Find My off, erase the Mac, or reactivate and use it.
- Apple silicon
- Apple's own processors for the Mac, reported as arm64 by uname -m. Such a Mac starts macOS Recovery from its power button, and its firmware can be revived or restored from a second Mac.
- DFU mode
- Device firmware update mode: the state in which a Mac's firmware can be rewritten by a second Mac over a USB-C cable. The Mac's own screen stays blank and the second Mac shows a DFU window in the Finder.
- macOS Recovery
- The small macOS kept on a Mac for repairs. From it you can reinstall macOS, restore a Time Machine backup, repair or erase the disk in Disk Utility, reset a forgotten login password and open Terminal.
References
- How to start up from macOS Recovery (Apple)
- Erase your Mac and reset it to factory settings (Apple)
- What to do before you sell, give away, trade in, or recycle your Mac (Apple)
- Activation Lock for Mac (Apple)
- How to revive or restore Mac firmware (Apple)
- If you forgot your Mac login password (Apple)
- Create a bootable installer for macOS (Apple)
- Back up your Mac with Time Machine (Apple)
- Apple security releases (Apple)
Report a problem with this lesson
Kept only in this browser. Your Learn progress