August 10, 2019
This week’s music:
Because of a flaw in the way that Time Machine restores Mail data, Macintosh Mail.app can fail to run.
Time Machine is the backup application built into macOS.
It comes with the operating system and is a must use feature for every Macintosh user.
Time Machine copies the entire boot drive onto an external volume (like a hard drive, flash drive or network share).
Initially, Time Machine copies everything from the boot drive to the backup drive.
After that, Time Machine does an incremental backup adding new and changed files every hour that the computer is on and not sleeping.
Time Machine keeps hourly backups for a day, daily backups for a week and weekly backups going all the way back to the first backup.
Each of the backup snapshots are shown on the backup drive as complete pictures of the boot drive.
A client of mine made a mistake in mail.
He inadvertently attached the entire content of his home folder to an email composition.
Mail.app dutifully copied the entire home folder into a temporary file preparing to send this 100 GB attachment.
Unfortunately, this filled the boot drive to it’s capacity.
When a boot drive is completely filled there remains no scratch space for programs to run.
This causes all the applications and the operating system to freeze.
My client forced off his computer.
When he tried to start the computer, it would not start.
There was no room left on the hard drive to start even the login screen.
What to do?
Luckily, he had a current Time Machine backup.
i restored his boot drive from a backup that was done one day before the incident.
- Start up the computer in Rescue mode (hold command-R at startup)
- Select “Restore from Time Machine Backup” from the available options in macOS Utilities.
- Click “Continue”, then click “Continue” on the Restore Your System Page.
- Select the Time Machine backup drive.
- Select the backup date you wish to restore.
- Click “Continue.”
Time Machine erased his boot drive and restored it to be exactly as it was on the backup date.
Everything was there.
He had to sign back into some of his accounts, but all the data, Desktop, Dock, files and folders were restored.
Then he ran Mail.app.
After a Time Machine restore Mail.app must import the contents of the ~/Library/Mail folder.
This it began to do.
But then the import failed.
“An error occurred during the import. Make sure you have available space in your home folder and try again.”
There was plenty of space on his boot drive.
A look at the Console (where logs are recorded) showed multiple permissions errors before the import failure.
Time Machine appends hidden permissions, called ACLs (Access Control Lists), to protect the backup drive from tampering.
These ACLs do not always get changed properly during a restore.
One of the things that can be done under these circumstances is to reassign permissions to the ~/Library/Mail folder and delete some preference files. This is technical and may not solve the problem.
A simpler, more direct way of solving the problem is to drag the Mail folder from the backup drive into its correct location (~/Library/Mail) on the boot drive.
The act of copying files into a home folder sets the correct permissions automatically.
This i did.
Once the Mail folder was copied onto the boot drive, Mail.app imported everything correctly.
Life is good.
The lesson here is that computers and applications are flawed and subject to error.
The solution is to identify the problem and correct it in the least invasive manner possible.