How to Create a Time Machine Backup to a Network Drive

Let’s say you have a home NAS (Network Area Storage), a router with a hard drive, or even an old Windows machine with a lot of disk space lying around. You want to make use of this disk space to store your Time Machine backups. You open Time Machine Preferences and the only way you can add a non-local disk is via a Time Capsule or AirPort-connected storage. Now what? If this is your problem and you have upgraded to Mac OS X Lion, there is a workaround… Keep reading.
The reason why Time Machine Preference Pane doesn’t show network drive is likely the Mac Developer’s mantra: keep simple things simple and complex things possible. Novice users, by definition, are inexperienced — they’re likely haven’t gone through the pain of losing data and discounted the value of backups. Thus to not complicate things more and make it easy for most users (especially novices) Time Machine’s preferences only cater for the two common cases:
  • Directly-attached external storage (via USB, Firewire, or Thunderbolt).
  • Time Capsule or Airport Base Station attached storage.
But with Mac OS X 10.7, Apple have now made more advanced cases possible. As with most advanced stuff, you will need to open up Terminal to do it. The secret? The new tmutil command.
Back to the HOWTO. In order to create a Time Machine backup on a network folder  you need to follow these three steps:
  1. Create a HFS+ disk image, preferably sparse disk image, and place the disk image file into its destination folder/server where it will live. It shouldn’t matter whether it is SMB (Windows) or AFP (Mac) shared folder as long as your Mac can write to it.
  2. Mount the disk image and use the tmutil command to tell where is it. Make sure that the disk image is in it’s permanent home before you use tmutil (Also, don’t change the server name or shared folder name after Time Machine use it as your backup volume).
  3. Tell Time Machine to start the backup process to make sure it works.
Still not clear? Here comes the walkthrough

Creating the Disk Image

  1. Open Disk Utility
  2. Click on New Image
  3. Set a large enough size for the disk image. Ensure that the Format is “Mac OS X Extended (Journaled)” (in other words, this will be HFS+, the  Mac’s native filesystem) and the Image Format is “sparse bundle disk image“.

    Time Machine Disk Image Settings
  4. You can set Encryption if you want but not necessary. On the other hand,encrypting the disk image is a good idea since you’re going to put it on a network that can potentially be accessed by others.
  5. Save the disk image to the shared folder. Alternatively you can save the image locally and then move it to the destination folder on a server.

Tell Time Machine to use the Disk Image

  1. Open Finder
  2. Navigate to the shared folder which you put the new disk image.
  3. Double-click on the disk image to mount it. You should see the new volume in the Finder’s sidebar
  4. Open Terminal and enter the following command :
    sudo tmutil setdestination /Volumes/{mounted-disk-image}
    Be sure to replace {mounted-disk-image} with the appropriate name for your new disk image. You will be prompted for your password, this is normal.

Do a Test Backup

  1. Click the Time Machine icon in the Menu Extras area (that’s the upper-right side of the screen) and select “Back Up Now”.
  2. Wait for 10 minutes or so for Time Machine to do its thing
  3. Open Finder, navigate to the mounted disk image, and ensure that Time Machine have created the “Backups.backupdb” folder and there is a folder inside it with the same name as your computer.
So that’s just about it. You can also use this method to save backups to non-Mac drives, like NTFS drives, if you have the appropriate drivers installed to write to those filesystems (hint: MacFUSE+NTFS-3g or Tuxera’s NTFS driver). For more information on the tmutil command, type man tmutil at the Terminal.

Install wget in Mac OS X Without Homebrew or MacPorts

Install wget in Mac OS X
The command line tool wget lets you retrieve a group of files from FTP and HTTP protocols, it’s a very useful utility for web developers and powerusers to have around because it lets you do things like perform quick and dirty site backups and even mirror websites locally.
This approach is going to build and install wget in OS X from source, this means you’ll need Xcode and the Unix dev tools (free @ Mac App Store) installed, but it has the benefit of eliminating the need of a package manager like Homebrew or MacPorts.
Assuming you have Xcode and the command line tools installed, launch Terminal and enter the following commands:
First, use curl to download the latest wget source:
curl -O
Next we use tar to uncompress the files you just downloaded:
tar -xzf wget-1.13.4.tar.gz
Use cd to change to the directory:
cd wget-1.13.4
Configure with the appropriate –with-ssl flag to prevent a “GNUTLS not available” error:
./configure --with-ssl=openssl
Build the source:
Install wget, it ends up in /usr/local/bin/:
sudo make install
Confirm everything worked by running wget:
wget --help
Clean up by removing wget source files when finished:
cd .. && rm -rf wget*
You’re all set, enjoy wget in Mac OS X.

Move data from an old Mac to a new Mac

How to use Migration Assistant with a new installation

When you first fire up your new Mac, you’ll be compelled to walk through the setup process. Early in that process you’ll be offered the opportunity to transfer data from your old Mac to the new one via a wired Ethernet connection. This is your first glimpse of OS X’s Migration Assistant.
Specifically, when installing Lion you’ll see the Transfer Information To This Mac window. Within this window you see four options—From Another Mac, From A Windows PC, From Time Machine Or Other Disk, and Don’t Transfer Now. As you’ll likely be moving data from your old Mac to your new one, select From Another Mac and click the Continue button at the bottom of the screen.

Make sure that both your Macs are connected, via Ethernet, to the same network. You can’t use a wireless network because your new Mac isn’t yet configured to use a wireless network. Launch Migration Assistant on your old Mac (found in /Applications/Utilities) and in the window that appears select To Another Mac and click the Continue button on that Mac. Enter your administrator’s password when prompted. You’ll be told that you must quit other applications. Do so by clicking Continue.
On your new Mac, your old Mac will appear in the Select The Source window. Click on it and click the Continue button. A passcode will appear on the new Mac and also, eventually, on your old Mac. Click Continue on the old Mac and a Transfer Your Information window will appear on the new Mac. (The old Mac will display a message that reads “Your other Mac is ready.”) On your new Mac you now have the option to select the kind of data you want to transfer. Your choices include Users, Applications, Settings, and Other Files and Folders onnameofoldMac.

Migration Assistant allows you to broadly choose the kind of data to transfer.

Click the triangle next to the Users entry and you can select specific user accounts you’d like to transfer. Click the triangle next to a user name and you have the further option to choose specific locations to transfer data from—Desktop, Documents, Downloads, Movies, Music, Pictures, Public, and All Other Files and Folders. Uncheck any that you don’t want to transfer and click the Continue button at the bottom of the window. A Transferring Information window appears that provides you with an estimate of how long the transfer will take.
When the transfer is done, you’ll be walked through the rest of the setup process. If you transferred a user account, you’ll see that account name in Lion’s login screen.

Other ways to use Migration Assistant

You can choose to migrate data from another computer, Time Machine backup, or another disk.

But suppose you unpacked, fired up, and configured your new Mac without having access to your old Mac. Or you simply didn’t have the time to wait for all your old data to transfer when you first booted the new Mac. Or, months later, you’ve realized there is a fair hunk of old data that you now want on your Mac. Have you lost your only chance to use Migration Assistant? Absolutely not. You can run it any time you like, provided that your Macs are on the same network. (You can transfer data over a wireless network once both Macs have access to such a network.)
Just navigate to /Applications/Utilities and launch Migration Assistant. In the Migration Assistant window that appears, choose From Another Mac, PC, Time Machine Backup, or Other Disk option and click Continue. Enter your administrator’s password and click OK. In the next window (seen here) choose from the two options—From Another Mac or PC or From a Time Machine Backup or Other Disk.
Regardless of which you choose, you’ll eventually see the same list of data sources you would have seen had you run Migration Assistant after you first installed Lion—Users, Applications, Settings, and Other Files and Folder onnameofmac/drive. Note, however, that if you attempt to move data from a user account on the old Mac with the same name as an existing user account on the new Mac—your user name is Chris on each, for example—you’ll be told that you must create a new user name to transfer the data to.

How to restore data from Time Machine in Mountain Lion

Restore a single file or folder

If you’re looking for a certain file or folder, start by connecting the external drive that you use for Time Machine backups or by making sure that you can connect to your Time Capsule. Click the Time Machine item in the menu bar at the top of your screen (it looks like a clock with an arrow running counterclockwise around it), and choose Enter Time Machine. Here, all of your saved backups will appear in chronological order. Use the visual timeline on the right side to scroll through your backups and look for specific items or folders. Older dates are indicated in pink on the timeline; the most up-to-date data on your Mac is indicated in white. (You’ll see the word ‘Now’ in bold, white letters on the timeline.)
Not sure which backup might hold the last copy of your missing file? Try running a Spotlight search in Time Machine based on keywords. You’ll see a search field in the upper right corner of each Finder window in the Time Machine view. Type in the file name or keywords from the file, and Spotlight will search through your backups to find the latest copy.
Not sure where to find the file you need? You can perform a Spotlight search in Time Machine, using the search field (circled).
Once you think that you’ve found what you’re looking for, use OS X’s Quick Look to make sure: Select the file and then press the spacebar to view the file without having to launch its parent application.
Preview a file before you restore it by using OS X’s Quick Look feature.
Select the file or folder, and press the Restore button. The file will automatically be copied to your desktop or to the file’s original folder. This may take some time, depending on the size of the transfer.

Restore an entire system

Sometimes you may want to restore your entire system from a backup—say, in the event of a crash or when your computer is misbehaving and you’d like to dial the clock back to a kinder, gentler time. If that’s the case, first connect your Time Machine drive. Then start up your Mac from the Mountain Lion recovery partition by pressing (and holding down) Command-R at startup. This launches Recovery Mode, a portion of your drive that Mountain Lion treats as a separate volume. It includes a few essential utilities for restoring files in case of a problem. For this approach to work, you must have a complete Time Machine backup that includes all system files.
The Mac OS X Utilities window appears. Select Restore From Time Machine Backup. This command will erase the destination drive—your Mac—so use it only if you’re restoring an entire volume to its original source or to a replacement drive. (Read the next section for setting up a new Mac or transferring data between Macs.)
Click Continue until you reach the Select a Backup Source window. here, select your Time Machine drive and click Continue. In the Select a Destination window, choose your Mac’s hard drive. (Using Recovery Mode erases your Mac’s hard drive before restoring from Time Machine; but once the process is finished, you’ll be able to log in and use your Mac normally).

Transfer data between Macs

Let’s say that you bought a new Mac and want to transfer all of the data from your old system to it. Or imagine that you simply want to transfer data from one Mac to another. Time Machine can help here, too, but with the assistance of another built-in Mountain Lion utility called Migration Assistant.
Use OS X’s Migration Assistant to transfer data from a Time Machine backup to a another computer.
Once your backup drive is connected, launch Migration Assistant (in your /Applications/Utilities folder). A Migration Assistant window will appear and ask how you want to transfer your information. Choose the From another Mac, PC, Time Machine backup, or other disk option and then click Continue. You may be prompted to enter your administrator’s password. Do so, if necessary, and clickContinue.
Next, you’ll be asked to quit other applications. Do so, and click Continue. In the next window, select the From a Time Machine backup or other disk option and click Continue.
Select your backup drive and enter a password for it, if necessary. Then choose which items you’d like to migrate (chances are, your choice will be to move everything). Click Continue, and your files will begin to transfer.

Vi Text Editor Commands

As a brief introduction to vi, go through the following: First, type
vi x
at the Unix prompt. Assuming you did not already have a file named x, this command will create one. (If you have tried this example before, x will already exist, and vi will work on it. If you wish to start the example from scratch, simply remove x first.)
The file will of course initially be empty. To put something in it, type the letter i (it stands for “insert-text mode”), and type the following (including hitting the Enter key at the end of each of the three lines):
The quick
fox will return.
Then hit the Escape key, to end insert-text-mode.

Going Further: Other Frequently-Used Commands

You now know how to use vi to insert text, move the cursor to text, and delete text. Technically, the bare-bones set of commands introduced above is sufficient for any use of vi. However, if you limit yourself to these few commands, you will be doing a large amount of unnecessary, tiresome typing.
So, you should also learn at least some of these other frequently-used vi commands:
     h              move cursor one character to left
j move cursor one line down
k move cursor one line up
l move cursor one character to right
w move cursor one word to right
b move cursor one word to left
0 move cursor to beginning of line
$ move cursor to end of line
nG move cursor to line n
control-f scroll forward one screen
control-b scroll backward one screen

i insert to left of current cursor position (end with ESC)
a append to right of current cursor position (end with ESC)
dw delete current word (end with ESC)
cw change current word (end with ESC)
r change current character
~ change case (upper-, lower-) of current character

dd delete current line
D delete portion of current line to right of the cursor
x delete current character
ma mark currrent position
d`a delete everything from the marked position to here
`a go back to the marked position
p dump out at current place your last deletion (``paste'')

u undo the last command
. repeat the last command

J combine (``join'') next line with this one

:w write file to disk, stay in vi
:q! quit VI, do not write file to disk,
ZZ write file to disk, quit vi

:r filename read in a copy of the specified file to the current

/string search forward for string (end with Enter)
?string search backward for string (end with Enter)
n repeat the last search (``next search'')

:s/s1/s2 replace (``substitute'') (the first) s1 in this line by s2
:lr/s/s1/s2/g replace all instances of s1 in the line range lr by s2
(lr is of form `a,b', where a and b are either explicit
line numbers, or . (current line) or $ (last line)
:map k s map the key k to a string of vi commands s (see below)
:abb s1 s2 expand the string s1 in append/insert mode to a string
s2 (see below)
% go to the "mate," if one exists, of this parenthesis
or brace or bracket (very useful for programmers!)
All of the `:’ commands end with your hitting the Enter key. (By the way, these are called “ex” commands, after the name of the simpler editor from which vi is descended.)
The a command, which puts text to the right of the cursor, does put you in insert-text mode, just like the i command does.
By the way, if you need to insert a control character while in append/insert mode, hit control-v first. For example, to insert control-g into the file being edited, type control-v then control-g.
One of vi‘s advantages is easy cursor movement. Since the keys h,j,k,l are adjacent and easily accessible with the fingers of your right hand, you can quickly reach them to move the cursor, instead of fumbling around for the arrow keys as with many other editors (though they can be used in vi too). You will find that this use of h,j,k,l become second nature to you very quickly, very much increasing your speed, efficiency and enjoyment of text editing.
Many of the commands can be prefixed by a number. For example, 3dd means to delete (consecutive) three lines, starting with the current one. As an another example, 4cw will delete the next four words.
The p command can be used for “cut-and-paste” and copy operations. For example, to move three lines from place A to place B:
1. Move the cursor to A.
2. Type 3dd.
3. Move the cursor to B.
4. Type p.
The same steps can be used to copy text, except that p must be used twice, the first time being immediately after Step 2 (to put back the text just deleted).
Note that you can do operations like cut-and-paste, cursor movement, and so on, much more easily using a mouse. This requires a GUI version of vi, which we will discuss later in this document.

AirPort Base Station Firmware Update 7.6.4

This update is available for all Apple 802.11n Wi-Fi base stations including AirPort Express, AirPort Extreme, and AirPort Time Capsule. It contains fixes that:
  • Resolve an issue that may cause AirPort Time Capsule to report that the backup disk is in use
  • Resolve an issue that may cause an IPv6 Tunnel error
  • Resolve an issue that may intermittently cause a loss in Wi-Fi connectivity with iOS devices
Note: This firmware update is for all 802.11n AirPort base stations.
For information on the security content of this update, please visit:
For detailed information on AirPort base station firmware updates, including instructions how to install the update, please visit:
For more information on using AirPort products, go to the Product Support Page at:

Mac OS X: Gray screen appears during startup

Products Affected

Mac OS X 10.4, Mac OS X 10.5, Mac OS X 10.6
Instead of seeing the Finder or the login window after startup, your computer may stop responding and the display may only show a persistent gray screen (you may also see an Apple logo, spinning gear, spinning globe, prohibitory sign, or a folder with a flashing question mark on it). Note: The below steps may not apply if a blue screen appears during start up.
Note: Some steps below may reset preference settings or registration settings.
Disconnect, test peripheral devices and network cables
Note: “Peripheral devices” refers to external devices other than what came with your Mac, such as hard drives, printers, or hubs that you connect via a USB or FireWire cable.
  1. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  2. Disconnect all peripheral devices such as external hard drives or printers (leave only the display, a keyboard, and mouse connected).
  3. Disconnect any Ethernet cables.
  4. Start up your Mac.
  • If you can start up this way, one or more of your peripheral devices (or installed software related to the device) is probably causing the gray screen issue. Connect one device, then restart your Mac to test for the issue. Repeat the process until you locate the device at issue. Make sure the device is powered if it needs to be to operate correctly. Check with the manufacturer of the device for support or possible software driver or firmware updates that may be available for the device. Try a different cable with the device if possible (such as a different USB or FireWire cable).
    Note: If you have multiple peripheral devices and the issue only occurs when they are all connected, but not when each device is the only peripheral connected, see the Additional Information section below.
  • If you are using a desktop Mac with a third-party keyboard and/or mouse device, and the issue still occurs, try starting up with an Apple keyboard and mouse connected instead. Try starting with no keyboard and mouse connected, then connect them after start up. Also, try a different USB port on your Mac.
If the gray screen issue persists with no devices connected, go to the next section (with the peripherals still disconnected).
Perform a Safe Boot
Simply performing the Safe Boot may resolve this issue.
  1. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  2. Start your Mac, then immediately hold the Shift key. This performs a Safe BootAdvanced tip: If you want to see the status of a Safe Boot as it progresses, you can hold Shift-Command-V during start up (instead of just Shift).

    : A Safe Boot takes longer than a typical start up because it includes a disk check and other operations.
  3. If your Mac starts up as expected, immediately try restarting.
If the Safe Boot does not work, or the restart after a successful Safe Boot does not work, go to the next section.
Reset the NVRAM / PRAM
  1. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  2. Reset the NVRAM / PRAM.
If the gray screen issue persists, go to the next section.
Start from your Mac OS X Install disc; use Disk Utility
  1. Insert your Mac OS X 10.4 or 10.5 installation disc (if you have discs with both versions, use whichever is closest to the Mac OS X version installed on your Mac; do not use a startup disc which came with a different Mac or which contains an earlier version of Mac OS X).
  2. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  3. Start up your Mac while holding the C key to start from the disc.
  4. Once started from the disc, choose Disk Utility from the Utility menu.
    Note: If the gray screen issue persists and you can’t start from the disc, go to the “Disconnect peripheral devices” section.
  5. In Disk Utility, perform a disk repair of your Mac OS X volume; if no issues are found, perform a permissions repair as well. If issues are found during the disk repair, try repairing again.
  6. After the Disk Utility operations are complete, restart without holding any keys.
If the gray screen issue persists, go to the next section.
Check your cables and power source
Make sure your power cables are secure (especially if you use a desktop Mac). Try a different cable or outlet if possible. If you use a surge protecter, try connecting directly to an outlet as a test.
If you have power-related issues (such as your desktop Mac shutting down or restarting, or room lights dimming when an appliance comes on, consider contacting a certified electrician to check your outlets and electrical wiring).
If the gray screen issue persists, go to the next section.
Remove third-party RAM and internal hardware
Note: Skip this section if only Apple-brand RAM is installed in your Mac.
Remove any non-Apple RAM or other third-party hardware upgrades (such as expansion cards or third-party optical drives or hard drives, if present) to help isolate the issue. This is necessary to get as close as possible to the original factory hardware configuration of your Mac.
If you are not sure which RAM modules or other hardware is Apple or third-party, or if you are not comfortable performing these steps, or if you have a Mac mini, consider contacting an Apple Authorized Service Provider for assistance. Otherwise, perform these steps before going to the next section.
  1. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  2. Open your Mac to access the memory slots. Refer to the User Guide that came with your Mac, or search Apple Support Manuals for a PDF copy of your Mac’s User Guide.
  3. Remove any third-party RAM that has been installed.
  4. Reinstall the Apple RAM that came with the computer if available. Note that Mac OS X 10.5 requires 512 MB or more of RAM; Mac OS X 10.4 requires 256 MB or more of RAM.
  5. If your Mac starts up with only Apple RAM installed, contact the vendor of your third-party RAM.
If the gray screen issue persists, go to the next section.
Perform an Archive and Install installation of Mac OS X
If the above steps do not resolve the issue, and you can successfully start from your Mac OS X Install disc as noted above:
  1. Insert your Mac OS X 10.4 or 10.5 installation disc (if you have discs with both versions, use whichever is closest to the Mac OS X version installed on your Mac; do not use a startup disc which came with a different Mac or which contains an earlier version of Mac OS X).
  2. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  3. Start up your Mac while holding the C key to start from the disc.
  4. Perform an Archive and Install installation (preserving users and network settings).
After installation, if the gray screen issue persists, go to the next section.
Perform an Erase and Install installation of Mac OS X as a last resort
Important: You should only perform this step after trying all of the above steps. This process will erase all files from your Mac OS X volume. If possible, back up important files first, or use Time Machine. You may be able to connect your Mac to another Mac with a FireWire cable and FireWire target disk mode, in order to try to manually back up files. Alternatively, you may wish to make an appointment with a Mac Genius at an Apple store, or contactan Apple Authorized Service Provider for assistance.
To erase your Mac OS X volume and reinstall Mac OS X:
  1. Insert your Mac OS X 10.4 or 10.5 installation disc.
  2. Shut down your Mac. If necessary, hold your Mac’s power button for several seconds to force it to power down.
  3. Startup your Mac while holding the C key to start from the disc.
  4. Perform an Erase and Install installation of Mac OS X.
  5. After installing, starting from your Mac OS X volume, and verifying the issue is resolved, you should use Software Update to update to the latest available version of Mac OS X.
Additional Information
If the issue persists after you follow the above steps, you may wish to make an appointment with a Mac Genius at an Apple store, contact AppleCare via phone, or contact an Apple Authorized Service Provider for assistance.
If the issue only occurs when multiple peripheral devices are connected
If a gray screen appears during start up only when several peripheral devices (that is, USB and/or FireWire devices) are connected, and you don’t want to have only one device connected at a time, the issue may be caused by a combination of the peripheral devices.
To illustrate this hypothetically, you may have three USB devices, which we’ll call “A”, “B”, and “C”. The issue may be that peripherals A and C have a conflict of some sort, and a gray screen only appears if they both are connected, but not if each one is connected separately. In the above “Disconnect, test peripheral devices and network cables” section you may have inferred that you have an issue only with device C because it was added after A.  To avoid an inaccurate analysis, connect device C to your computer with no other devices.  If your Mac has the startup issue with only device C connected, then you know it is the source of the issue.  However if your Mac starts up, you have a conflict of devices to work out.  To do this add the other devices one at a time with device C connected until your startup issue occurs (restart after adding one device).  Repeat this process until you have just the minimum set of devices to produce your startup issue.
What can you do?
  • You should make sure each device has the latest firmware installed if applicable—check with the manufacturer for more information. You should also check for the latest driver versions, and if necessary install them while started in Safe Mode per above.
  • If any of the devices requires a separate power source, be sure that power is connected to the device (for example, even if a device appears to be powered when connected via USB without the power cable, connect its power cable).
  • Try different USB or FireWire cables with each device, as applicable.
  • If you have a device similar to one of the conflicting devices, try replacing it with another one.
  • Contact each device manufacturer or the materials that came with the device. for more support information or, if needed, service options.

Clean install of OSX 10.8 Mountain Lion USB

Though most users are best served by the easy upgrade process to OS X Mountain Lion through the Mac App Store, some people want to perform a clean install and start with a blank slate. A clean install means the drive is completely erased and Mac OS X 10.8 is installed fresh, nothing else is on the drive, no apps are installed, and no files are included.
The process described below will format the selected Mac disk and erase everything on it, followed by performing a completely clean and fresh installation of OS X Mountain Lion.
We’d highly recommend backing up your Mac before performing a clean install, even if you have no intention on using it afterwards.
  1. If you don’t have it yet, get Mountain Lion from the Mac App Store but do not install it yet (orredownload it if you did install it)
  2. Create a bootable install drive for OS X Mountain Lion, make one manually with a USB drive oruse the LionDiskMaker tool to automate the process with a USB or DVD
  3. With the boot installer drive connected to the Mac, reboot and hold down the Option key
  4. Choose the “Mac OS X Installer” startup volume from the boot menu
  5. Select “Disk Utility” and choose the hard drive you wish to format, click the “Erase” tab, and then pull down the “Format” menu and select “Mac OS Extended (Journaled)” as the type, name the drive if you wish
  6. Click the “Erase” button and let the drive format – this is the point of no return
  7. When finished, quit out of Disk Utility and now select the “Install Mac OS X” option from the menu
  8. Choose your freshly formatted hard drive and install Mountain Lion
When the Mac reboots you will have a clean installation of Mac OS X 10.8 to work with.
At this point you can either import files and apps from the backup you made, manually copy over backed up files, or just start anew.
OS X 10.8 Mountain Lion will be offered exclusively through the App Store, familiar territory for Apple since OS X Lion was provided the same way. Thankfully it’s still possible to create a bootableOS X 10.8 Mountain Lion installer from any USB drive, be it a flash key or external hard drive.
By creating a bootable install drive, you can perform clean OS X 10.8 installs, install it on separate partitions, and install OS X Mountain Lion on Macs that don’t have internet connections. We’ll walk through the process here, but don’t forget to check OS X 10.8 system requirements for the destination Mac before beginning.
If you already have the Mac OS X Mountain Lion install DMG extracted, skip this first set of steps and jump directly to making the bootable drive below.

Download OS X Mountain Lion and Extract the DMG File

  1. Download OS X 10.8 Mountain Lion from the App Store
  2. Go to the /Applications/ directory and right-click on “Install Mac OS X Mountain” selecting “Show Package Contents”
  3. Open the “Contents” directory and then open “SharedSupport”, looking for a file named “InstallESD.dmg”
  4. Double-click on InstallESD.dmg to mount it on the desktop

Make the OS X Mountain Lion Install Drive

  1. Launch Disk utility and connect a USB drive to the Mac
  2. Select the USB drive from the left menu and click on “Erase” tab, choose “Mac OS X Extended (Journaled)” as the format, then click on the “Erase” button in the corner
  1. Now select the formatted USB drive from the left side and click on the “Restore” tab
  2. Drag the previously mounted “Mac OS X Install ESD” image into the “Source” section
  3. Drag the formatted partition to the “Destination” section, then click on “Restore”
  1. Confirm that the USB drive will lose it’s data and enter the Admin password when asked
Disk Utility will now create a bootable OS X Mountain Lion installer drive out of USB drive using the disk image, this can take a little while depending on how fast the drive and Mac are but 20-30 minutes isn’t unusual.
When finished, reboot the Mac and hold down the Option key to bring up the boot menu:
Select the orange “Mac OS X” option and you will boot into the OS X Mountain Lion installer, from here installation is the same as normal. Click on Continue, select the destination drive, and install.

How to edit OSX host file

The hosts file in Mac OS X is stored at /private/etc/hosts but can also be accessed at the more traditional location of /etc/hosts. If you’re looking to edit hosts, you’ll want to target the file located in /private/etc/ though.
We’ll walk through how to manually edit the hosts file in OS X Lion and OS X Mountain Lion with the command line using the simple text editor called nano. If you’d prefer to avoid the Terminal, you could try the easier method of using a preference pane.
1. Launch Terminal , found in /Applications/Utilities/ or launched through Spotlight
2. Type the following command at the prompt:
3. sudo nano /private/etc/hosts
4. Enter the administrator password when requested, you will not see it typed on screen as usual with the command line
5. Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications
6. When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano
7. Quit out of Terminal when finished