You may need to perform a clean installation of OS X before you sell your computer or you may just want to make your system to the  factory fresh state. This tutorial will help you to do it yourself. First thing that you’ll notice in Mountain Lion and on your brand new MacBook Pro retina is that there is no install disc. How were you supposed to format and do a clean install when you do not have an installation disc.You do not have an USB key. hm..what are you supposed to do. First, to let you know, Mountain Lion came pre-installed on  MacBook Pro Retina. 3 apps came installed from App Store (iMovie, iPhoto and GarageBand). Before doing anything, check in app store, under purchases, that you have those 3 apps accepted and installed. If you do not, make sure you accept them and install them. (you have to be logged in with apple id of course and have your MacBook registered). This will ensure that each time you reformat the drive and do a clean install, you’ll be able to get those apps, as they don’t come with Mountain Lion when you install it from scratch from yourself. First of all, if your Mac is brand new, it means you don’t have to worry with backing up. Good times. So lets, get ready to rumble. 1) power off (shut down) your Mac

2) before powering it ON, press and hold at the same time CMD + R keys and then press POWER. You can release power, but keep holding those two buttons until you see the RECOVERY CONSOLE. Your Mac has now booted into recovery console. That is a hidden partition on your HDD, that got special utilities for formating (disk utility), for restoring backup (time machine), for installing Mountain Lion (Install mountain lion) and Safari to go online and seek help. In case that you deleted this partition, your Mac would boot into Internet recovery mode, meaning it would boot this partition not from your SSD but from Apple’s servers. Awesome, right?. As I understood, installing mountain lion then, would create this hidden recovery partition again. 3) now you are in OS X Utilities / recovery mode. In recovery mode you need to select DISC UTILITY.

4) On the left side, you’ll see name of your HDD, something like 256GB SSD MACBOOK DISC, and bellow that as a child tree, you’ll see Volume named “Macintosh HD” – if you haven’t changed its name. This is the partition where Mountain Lion is installed. If yous elect the 256GB SSD lable above it, you’d erase the whole HDD; we do not want that. We want to leave Recovery (hidden partition) partition intacted. So, bellow Macintosh HD, there is a line separating the two fields, and in the second file, there is again Parent and Child label, where your OS is named and the DISK as the parent (above). You don’t touch that. You select “Macintosh HD”, that’s just bellow the SSD, second in line (if you didn’t repartition your Mac when you bought it). 5) you select the Macintosh HD and you select ERASE from the tabs on the right. Now you don’t touch default file system which is Mac OS Extended Journaled. Make sure that is selected (it is by default, so no worries there). Don’t touch the name that the new partition will have, leave it at “Macintosh HD”.

Now, you can click erase, and confirm that all your data will be erased. If you have sensitive data, you can click SECURE ERASE where you can select the number of passes you’d like the utility to perform, so no data recovery can get those files back. Keep in mind, that constant writing on the SSD is slowly killing it After the erasing is done, leave the mac alone for a 30s or so (OCD talking), and you’ll see USED around 311MB, that’s okey. Now you close this Disc Utility and you go to screen before and chose INSTALL MOUNTAIN LION 6) INSTALL Mountain Lion – in order for you to install it, you have to have active Internet connection. Advanced users will hate this, but DHCP got to be ON on the router, whether you or on the Ethernet cable or Wi-Fi, so turn on DHCP on the router even before proceeding. If it is turned on, when you click Install Mountain Lion, it’ll go through and download the 4GB image of the installation from Apple. If your Internet connection got problems or you haven’t entered your Wi-Fi’s Password, you’ll see a warning screen warning you that no Internet connection is present Now, wait for 2-3 hours, until it downloads. (depending on your speed (4GB download))

When it gets to 1h:30min, after that, it zooms in and finishes. 7) Image is downloaded, now you need to proceed with the installation, which will be speedy and done in 15-20min

Mac will restart . Before downloading the image, it sends verification to Apple’s server, to see if you really do own MAC. After the installation is nearing to its end, you need to enter Apple ID. After few more minutes, it’ll be done. You choose English, you choose your location, decide whether you want to Geo Location services to be enabled. You can’t have Find My Mac function enabled, if you disable the “Geo Location Services”, so keep that in mind.