How to fix slow shutdown and startup times.

Startup spinnerAre you suddenly experiencing slower then usual startup/shutdown times? It’s normal for your mac to take slightly more time to boot as you fill it up with documents and applications. But if one day, all of the sudden you experience a drastic change in startup times, it could be a sign of a problem. Here are 5 possible solutions in the order of likeliness.

Is your hard drive nearly full?

It is good practice to have at least 10-15% free on a hard drive, on any computer. If you filled your mac up to the brim, it will perform slower because it has to deal with many more files. It will also write much slower as it will take longer to find free space on the disk. If this is the case, try to free up some space. Magnetic hard disk drives are affected to a greater degree than solid state drives because the their disk-like nature. The first few Gigabytes are written on the outer most edge of the spinning disk, and the last Gigabytes are closest to the center. The rotation speed remains constant; therefore the read/write performance is slower for additional files.

Delete unneeded files, and move less frequently needed files to external storage. Your Downloads folder likely has many large files you no longer need. Also check out my previous post on jDiskReport that will show you what is taking up all your disk space.

Disk Permissions

Macs and other operating systems that share Unix roots use a clever file permissions system for file security. It specifies who can read/write/execute what files. Sometimes file permissions can go wrong, either by user action or software bugs, and incorrect permissions have the potential to slow down your system.

To verify and repair your disk permissions go ahead and open Disk Utility. Select your system disk from the menu on the left, and click on the Repair Disk permissions. There is no harm of doing this check even if permissions is not the cause of your problem.

Varify disk permissions with Disk Utility

Disk verification

On the same screen as Disk Permissions verification, you have the option to verify the physical integrity of your disk. If your disk showing signs of wearing out and it is anticipated to fail, this tool will let you know.

Select your system disk, and click on the Verify Disk button. Note: This may take some time, and your computer may be unresponsive during this test. If problems are found you can attempt to repair the disk with the Repair Disk button. If your disk can not be repaired, you may need to replace your internal hard drive.

Is your OS X partition set as the default startup partition?

If you have more than one disk partition on your computer (if you installed Windows via BootCamp, for example), or if you previously had more than one partition, it is possible that your mac is not set to boot from your OS X partition by default. This will cause it to look for another boot partition that is not present during start up before finally deciding to boot from your mac partition. This may add a few seconds to your startup time.

Select your system disk to be your default startup disk.

To make sure, open Settings and then click on Startup Disk. Make sure that your Mac OS X partition is selected (it will be highlighted in blue), if not click on it to select it.

Reset PRAM

The PRAM on a mac is a temporary storage that holds various system settings and configurations. In rare cases, some of those settings be get corrupted, and a reset of PRAM may be a solution.

To reset PRAM, turn off your mac. Then hold down Command, Option, P and R right after your press the power button to turn it back on again.

You wont lose any of your documents or other files stored on your disk, but it will reset things like volume level and alarm clock settings. To read a more details about PRAM reset visit Apple’s documentation.

User directory ownership.

Finally if all of the above doesn’t solve your problem. It could be a weird problem with the ownership of your root directory. In this case the root directory is no longer owned by the root account. This causes confusion for the system, and adds a significant amount of time to startup and shutdown times. It’s very rare, and I don’t fully understand the cause of this bug, nor could I find an explanation online. It happened to me under OS X 10.6.5, and the following solution reduced my shutdown time from 10+ seconds back to 2 seconds.

Here is the solution I found on MacRumors forums:

Enter these three command into Terminal in the following order:

sudo chown root:admin /

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

Note: You will be asked for your password after the first command. The particular commands above will not break your system, even if you are not affected by this bug. But always be extra careful of what you enter into terminal with sudo.  It has the potential to break your system if you enter the wrong commands.