USB Key Labelled EFI Boot

If you have created a Mac OS X bootable USB Key and it shows up as EFI Boot when you are at the boot selection menu then you can rectify this via the following Terminal command

sudo bless --folder /Volumes/VOLUMENAME/System/Library/CoreServices --bootefi

replace VOLUMENAME with the name of your USB Volume, so I named my 10.8 Key ‘Mountain’, so my command would be

sudo bless --folder /Volumes/Mountain/System/Library/CoreServices --bootefi

then enter your admin password and reboot

Hold down ALT to get back to the boot selection menu and you should now have the VOLUMENAME displayed under the USB Device, rather than EFI Boot

How do you wipe an old MacBook Air?

So, I was asked this the other day, and it can be quite tricky, basically, you need to boot from an installation disk and run Disk Utility to erase the disk.

Now as the MacBook Air doesn’t have FireWire then Target Disk Mode is pretty much out of the question (although this is now an option on Thunderbolt equipped MacBook Airs), so we will have to either try a remote disk option, or boot from USB.

In this guide I will run through the steps required to complete this task using a bootable USB key, but if you wish to go the Remote Disk option then more info can be found on Apples Support Site at http://support.apple.com/kb/HT2129

For this you will need

  1. An 8GB USB key or Hard Drive (or larger)
  2. A Retail Operating System Disk
  3. A Mac with a Superdrive

Ok, so first of all if you have any data on the USB key, make a backup of any data you have on your USB key

On your Superdrive equipped Mac, insert your Operating System Disk & USB key and open Disk Utility

In Disk Utility, click on the OS Disk and then click on the ‘New Image’ icon at the top of the window, pick a name and save it to your Desktop

Once the image is created it will appear in the left hand window of Disk Utility, click on it and then click on ‘Images’ in the menu bar at the top of the screen and choose ‘Scan Image for Restore’

Once that has verified your image, click on your USB key in the left hand window and and choose the ‘Restore’ tab in the main window.

Next drag the image you created to the ‘Source’ field and drag the USB key to the ‘Destination’ field, tick the box that says ‘Erase Destination’ and click on ‘Restore’.

This will erase your USB key and replace it with the contents of your image, so all of the files on the OS disk will be transferred to the USB key, with the end result being a bootable USB key

Once this has completed, eject the USB key and plug it in to your MacBook Air and hold down the ALT key whilst powering it on, you should be presented with the option to boot from the hard drive or the USB key, if you have set a firmware password though you will need to enter this to gain access to the boot menu

When you have booted from the USB key it will vary depending on which OS you have created it from, but usually you will have to agree to a license agreement to get to the pre installation screen, at the top of the screen you should see a Utilities menu, you must click on this and run Disk Utility.

When you are in Disk Utility click on the hard drive you wish to erase, then click on the erase tab, you can then choose which type of deletion you require, I would choose the highest security option, which involves multiple passes of the hard drive, but this can take several days depending on hard drive size, if you don’t have the time then choose a lower security option, but remember more secure = many hours = less chance of data being recovered.

Cloned Image Clean Up

If you have created an image of a Mac to deploy onto other Macs then you will need to clean the machine of certain user & machine specific files

To do this, you will need to mount the image on another machine and in Terminal enter the following

sudo rm /Volumes/MacHD/Users/username/Send Registration
 sudo rm -rf /Volumes/MacHD/Users/username/Desktop/*
 sudo rm -rf /Volumes/MacHD/Users/username/Downloads/*
 sudo rm -rf /Volumes/MacHD/Users/username/Library/Caches/*

Replace username with the name of any and all of the user accounts on the image

sudo rm -rf /Volumes/MacHD/Documentation/old_*
 sudo rm -rf /Volumes/MacHD/Library/Caches/*
 sudo rm -rf /Volumes/MacHD/System/Library/Caches/*
 sudo rm -rf /Volumes/MacHD/Library/Managed Preferences/*
 sudo rm -rf /Volumes/MacHD/Users/Shared/*
 sudo rm -rf /Volumes/MacHD/private/etc/ssh_host*
 sudo rm -rf /Volumes/MacHD/private/var/db/volinfo.database
 sudo rm -rf /Volumes/MacHD/private/var/vm/swap*
 sudo rm -rf /Volumes/MacHD/private/var/vm/sleepimage

In these examples, my image Volume is named MacHD, always make sure your image Volume is not named the same as your currently booted system volume, otherwise you could end up deleting these files from the wrong volume

Hide a volume

To hide a volume in Mac OS X 10.6 you will need to do the following

First, Install the Developer Tools (You can find these on the Mac OS X Installation Disc that came with your machine, or you can download Xcode from the Mac App Store).

Once you have done this Open a Terminal Window and type the following

sudo SetFile -a V /Volumes/VolumeName

replace VolumeName with the name of the volume you wish to hide

then type

sudo reboot

when the machine has rebooted you will notice that the volume no longer appears either on the desktop, or in a Finder window

to reveal a previously hidden volume just type the same command but use a lower case v

eg.

sudo SetFile -a v /Volumes/VolumeName

A common use for this would be to hide a volume with sensitive data on, although this will not encrypt any data so is not the best method for confidential items.

Hide a Bootcamp volume from OS X

To hide a bootcamp volume in Mac OS X 10.6 you will need to do the following

First, Open Disk Utility, highlight the Windows partition, click on info and note down the UUID

Open TextEdit & create a file called fstab.txt & save it to the root of the OS X partition, enter the following text into it

UUID=EnterUniqueIdentifierHere none ntfs ro,noauto 0 0

For FAT32 formatted partititons, replace ‘ntfs’ with ‘msdos’

Save & quit TextEdit

Open Terminal, rename & move the file to /etc, do this by typing the following

cd /
sudo mv fstab.txt /etc/fstab

Reboot the machine & log in, you should no longer see the Boot Camp partition on the desktop