Repair Permissions

This is the most simple of maintenance tasks and one of the most overlooked, many people will take their machines to shops as they believe their machine has a serious problem, which can usually be fixed by this one task.

To do a permissions repair you have 2 options, using the Disk Utility app (recommended for most users), or using the command line, which is just as easy, but some people may not be that comfortable doing it this way.

So first, I’ll go through the Disk Utility method, this application is located in /Applications/Utilities

Double click on the application to start it up, now on the left hand side you will have a list of drives connected to your machine currently, on a MacBook Air you may only have your main hard drive listed, on a Mac Pro you may have several hard drives, a couple of SuperDrives, maybe some external USB drives etc.

The one you want to focus on is your system drive, this is usually the top one, but you want to click on the Volume, not the actual hard drive, the volume is usually just underneath with the same hard drive icon, but slightly indented from the edge, on a standard Apple installation this will be called Macintosh HD but it can be named anything.

Click on the Volume (Macintosh HD) and on the right hand side of the window you will have a few tabs, choose the First Aid one and at the bottom click Repair Permissions.

This will chug away for a while, if you do this regularly then it will only take a few minutes, but if you have never done it then it could take many hours.

Once done I’d recommend rebooting your machine and you should notice an improvement in performance, the reason for rebooting afterwards is I’ve found that quite often some applications or services that had issues starting up before the permissions repair
will end up in some sort of crashed state, so the repair won’t appear to have resolved anything, rebooting causes all of these items to restart and as they should now have the correct permissions and will be able to run correctly, thus not crashing, and not causing a system slowdown

Next I will run through the command line guide to this.

Open Terminal which is located in /Applications/Utilities

type

sudo diskutil repairPermissions /

this will prompt you for your admin password and will again chug away until done, you will recieve a better idea of its progress as it has a progress bar with a percentage completed, which the GUI option doesn’t have

All thats left to say is make sure you do this regularly, After every major software update or installation should be fine

I have done a video running through a Repair Permissions here

Firmware Password Utility

As every good System Administrator should, I set firmware passwords on all my macs.

But one of the frustrations caused by this security precaution is when you are trying to boot a mac into Target Disk Mode, you need to first boot from an installation disk and then run the Firmware Password Utility

To get around this, I create a copy of the Firmware Password Utility on all macs (you could put one on a USB if you wish)

This is done by by following these steps

1. Insert a Mac OS X Installation DVD into your Mac

2. Open Terminal and type the following

cp - R "/Volumes/Mac OS X Install DVD/Applications/Utilities/Firmware Password Utility.app" ~/Desktop

3. Now you can run the utility from your desktop

Also, if you are setting up multiple macs and you wish to have them all use the same firmware password, you can do the following to push it to all machines

1. Set it manually on 1 machine using the utility mentioned above

2. Open Terminal and type the following

sudo nvram security password

you will get an output similar to this

security-password %cd%f8f%bd%98%87%c5%

This is your encoded firmware password, you can now deploy this via Apple Remote Desktop, SSH, or a script.

Please note, this will only work on Intel Macs

To deploy it to other Macs, enter the following into Terminal either locally, via SSH, ARD or other deployment solutions

sudo nvram security-password %cd%f8f%bd%98%87%c5%
 sudo nvram security-mode=command

Tips for speeding up your Mac

1. Hard Drive Space
You should keep a minimum of 10% of your Hard Drive free to ensure smooth running of your machine, I normally aim for 15-20% free, so I still have a bit of space to play with

If you are unsure of whats exactly is taking up your hard drive then you can use a utility like DaisyDisk (Available on the Mac App Store) to track down those space hogs.

2. Clear Your Desktop
Lots of people use their Desktop as the store for all their files, this increases the amount of time it takes to startup as all of the preview icons need to load, so by storing these files elsewhere in the filesystem then you will improve startup times

3. Disable Login Items
Lots of items starting at login will also slow down your machine, and often, these will continue to run in the background, taking up memory and utilising the processor unnecessarily, to prevent this, do the following

Open System Preferences

Click on Users & Groups

Click on your account in the window on the left

Click on the Login Items tab to the right

Click on the items you no longer wish to run at startup, such as iTunes helper, VM Fusion helper and click on the minus button at the bottom of the window to remove them.

4. Disable Dashboard
I haven’t used Dashboard since 10.4, so I tend to disable it, you can do this by opening a Terminal window and typing the following

defaults write com.apple.dashboard mcx-disabled -boolean YES

then

killall Dock

This will fully disable Dashboard so you will not even be able to run it manually by clicking on the icon in /Applications, to re-enable it if you change your mind then you can do type the following into a Terminal window

defaults write com.apple.dashboard mcx-disabled -boolean NO

then

killall Dock

5. Repair Permissions
I recommend repairing permissions after every software update, but most people don’t have time to do get round to this as well, until the machine becomes slow and unresponsive.

To do this, navigate to /Applications/Utilities

Open Disk Utility

Click on your startup volume (Usually named Macintosh HD)

Click on the First Aid tab and click on Repair Permissions at the bottom of the screen

6. Repair Disk
Sometimes disks will develop directory structure corruption over time, this isn’t a problem if dealt with promptly, but in the worst cases will need attention from a specialist application such as diskwarrior.

To check if your drive needs this doing you can run a verify disk from Disk Utility, as follows

Open Disk Utility (from /Applications/Utilities)

click on your startup volume

click on the First Aid tab and click on Verify Disk

If all is well you will receive a green message signalling the drive is fine

If its not then you will recieve a red message stating the cause of the error

To run a repair disk you will need to boot from a non system drive, such as a Mac OS X Installation Disk, or a home made Bootable USB

Once you have booted from one of those then you will need to run Disk Utility again, and this time click on your startup volume and choose First Aid, then click on Repair Disk.

This may need running more than once, although my recent experiences have shown that it will keep running until it has resolved the issues.

7. OnyX
Finally I use OnyX to clear out a few caches and log files, I’d recommend sticking with the default options with this app, a free download from Titanium Software, just make sure you download the version that matches your Operating System, if you are unsure which OS you are running then you can find out by clicking on the Apple Icon in the top left corner of the screen and clicking on About This Mac

8. Add more RAM
Put as much RAM as you can afford into your mac, I’d recommend the minimum on the following Operating Systems

10.4 (Tiger) – 1GB

10.5 (Leopard) – 2GB

10.6 (Snow Leopard) – 2GB

10.7 (Lion) – 4GB

9. Reboot
A lot of people hardly ever reboot their macs, and for some unknown reason are even strongly against doing this, even though the majority of the time a reboot fixes a lot of issues, I’d always choose this option on a slow running mac, in case there are some applications that have been closed but refuse to release the RAM for the OS to reuse

Create a bootable Lion USB key

To make a bootable Lion USB key, you will need the following

1. A USB Key, minimum 8GB, I use these
2. The Install Mac OS X Lion App

Ok, so first, you need to start up your Mac

Now plug the USB key into your Mac

Next you will need to open Disk Utility, this is located in /Applications/Utilities

Format the USB Key so that it is Mac OS X Journaled and make sure you choose the ‘GUID Partition Table’ option, otherwise you will not be able to boot a Mac from it.

Then you need to locate ‘Install Mac OS X Lion.app’ which should be in /Applications

If you have deleted it since installing then you can redownload it by opening the App Store, then hold down ALT and click on Purchases, this will enable you to redownload it by clicking Install

Click on the ‘Install Mac OS X Lion.app’ to run it, click on ‘Continue’ then Agree to the license and you will be shown your main hard disk, under that there is an option to ‘Show All Disks’ click on that and choose your USB key, click on ‘Install’ and the process will begin, you will then have to restart the machine so the installation can complete, this usually takes around 40 minutes

After this has finished you will be able to boot from your USB key into a full Mac OS Environment, and providing you keep this OS fully updated then you should be able to use it to boot up any Mac.

Once it is fully patched, you can install any additional tools that you use for troubleshooting machines.