Why does the macOS Photos library get corrupted?
Short answer: The Photos app stores your images in a .photoslibrary package — a special folder that macOS shows as a single file. Inside it, an SQLite database (a structured data file) tracks every photo, album, face tag, and edit. When the Mac loses power while Photos is writing to this database — or while iCloud Photo Library is syncing new images — the database is left in an incomplete state. The photos themselves are untouched; only the index is broken. Photos then cannot read the library on the next launch and shows an error or simply freezes at the loading screen.
How to fix a corrupted macOS Photos library
Step 1: Run Photos First Aid (the built-in repair tool)
Apple ships a hidden repair tool inside Photos. Hold Option + Command on your keyboard while clicking the Photos icon in the Dock. A dialog appears offering Repair Library. Click it — Photos will scan the SQLite database, identify corrupted records, and repair or rebuild them. The repair can take 5–30 minutes depending on library size. Do not close the MacBook or disconnect power during this process. For a Photos library over 100 GB, plug into mains and allow up to an hour. First Aid resolves corruption for the majority of cases without any data loss.
Step 2: Rebuild thumbnails separately
Sometimes the photo database is healthy but the thumbnail cache — the small preview images used to display your library grid — is corrupted. Symptoms: Photos opens but shows grey boxes instead of images, or loads extremely slowly. In Photos First Aid mode (Option + Command launch), choose Repair Thumbnails instead of full library repair. This rebuilds only the preview images, which is faster and carries zero risk to original files. After thumbnail rebuild, Photos re-generates previews in the background — normal thumbnail display can take 20–40 minutes to fully repopulate on large libraries.
Step 3: Restore from Time Machine if First Aid fails
If Photos First Aid cannot repair the database, restore the .photoslibrary file from Time Machine (Apple's built-in backup system). Open Finder, navigate to ~/Pictures, right-click the Photos Library.photoslibrary file, and choose Browse in Time Machine. Restore the most recent backup taken before the corruption occurred. See the macOS Time Machine setup guide for how to configure backups to an external drive — essential for any Photos library above 50 GB.
Step 4: The India angle — power cuts and incomplete iCloud sync
Indian users face two specific corruption triggers that do not appear in Western guides. First: power interruptions. Most Indian households and offices experience brief cuts — even a momentary blink during which the inverter switches over can interrupt an active database write. Second: iCloud Photo Library syncing large batches of photos over slow or unstable connections (BSNL, rural broadband) can stall mid-write and leave the database in an inconsistent state. The fix is operational: always keep iCloud Photo Library sync complete (green tick in Photos status bar) before shutting down, and run Photos on a device connected to a UPS. See our iCloud Drive sync stuck fix for related iCloud troubleshooting.
When to call a data recovery service
When the library package itself is inaccessible
If the .photoslibrary file shows a size of 0 KB, cannot be copied, or gives I/O errors when accessed, the underlying SSD has bad sectors or the APFS filesystem is corrupted beyond what Disk Utility can repair. A specialist can mount the drive in read-only mode and extract the Originals folder from inside the library package even when Photos cannot open it.
Typical cost for Photos library data recovery in India
Software-level recovery (SQLite repair + file extraction): ₹2,000–₹5,000. Hardware-level SSD recovery (bad sectors): ₹5,000–₹15,000. Our data recovery service page lists the current assessment process — diagnosis is free before any commitment.
Step 5: Extract originals directly if Photos cannot be opened at all
If the .photoslibrary file icon is greyed out, or if double-clicking it shows "The file is damaged and can't be opened", do not attempt further repair through Photos. Instead, right-click the .photoslibrary file in Finder and choose Show Package Contents — macOS treats the library as a folder you can browse. Navigate to Originals (or Masters on older libraries) — this folder contains all your original photo and video files, organised by year and month. Copy this entire folder to an external drive. Your original files are almost certainly intact even when Photos cannot open the database. Once you have the originals safe, create a new empty Photos library, import the Originals folder, and let Photos rebuild the library from scratch. This two-step process recovers all photos without relying on the corrupted database at all.
A note from the LRW Engineer Team
We recover Photos libraries regularly. The worst cases are always the same: no backup, no Time Machine, and a power cut mid-sync on a library of 30,000+ wedding photos. The originals are almost always recoverable because SQLite corruption only affects the index, not the image files. But the extraction takes hours of careful work. The moral: Time Machine to an external drive is cheaper than any recovery job we charge.