Make abootable flash installer of OS X or macOSif you have a more recent version.
What You Need
You need either a dual-layer DVD and a burner or a USB flash drive.
The dual-layer DVD has two layers, which increases the available recording space to about 8.5 GB.

Coyote Moon, Inc.
The OS X Mountain Lion installer is a bit too large to fit on a standard DVD.
Dual-layer DVDs are available anywhere standard DVDs are sold.
If your Mac doesn’t have a built-in SuperDrive, use an external DVD burner.
Alternatively, use a USB flash drive that can hold at least 5 GB as your bootable media.
8 GB and 16 GB flash drives are also commonly available.
It is stored in the Applications folder on a Mac.
The file is calledInstall OS X Mountain Lion.
Create the bootable copy of the installer before you perform the Mountain Lion installation.
The setup process deletes the files you gotta make the bootable installer copy.
Open aFinderwindow and go to theApplicationsfolder (/User/Applications/).
Scroll through the list of files and locate the one namedInstall OS X Mountain Lion.
Right-click theInstall OS X Mountain Lionfile and selectShow Package Contents.
Open theContentsfolder, then open theSharedSupportfolder.
You should see a file namedInstallESD.dmg.
Right-click theInstallESD.dmgfile, then selectCopy InstallESD.dmg.
Close theFinderwindow and return to the Desktop.
Right-click an empty area of the Desktop, then selectPaste Item.
Pasting the item to the Desktop takes time.
Insert a blank DVD into the Mac’s optical drive.
If a notice asks you what to do with the blank DVD, selectIgnore.
LaunchDisk Utility, which is located inUser/Applications/Utilities.
SelectBurn, located in the upper-right corner of theDisk Utilitywindow.
Select theInstallESD.dmgfile you copied to the Desktop.
Creating a bootable copy of Mountain Lion on a flash drive isn’t difficult.
All you need is the InstallESD.dmg file that you copied to the Desktop and the flash drive.
Before you begin, erase and format the USB flash drive.
Here’s how:
Insert the USB flash drive into the Mac’s USB port.
LaunchDisk Utility, which is located in/Applications/Utilities.
It may be listed with multiple volume names.
Do not select a volume name.
From thePartition Layoutdrop-down menu, select1 Partition.
SelectGUID Partition Tablein the list of available partition schemes, then selectOK.
All data on the USB flash drive will be deleted.
Disk Utility asks you to confirm that you want to partition the USB machine.
The USB unit is erased and partitioned.
Here’s how:
InDisk Utility, go for the USB flash equipment in the equipment list.
Do not choose the volume name; choose the gadget name.
Drag theInstallESD.dmgitem from the equipment list to theSourcefield.
It is near the bottom of theDisk Utilitydevice list.
You may need to scroll down to find it.
Drag the USB flash unit’s volume name from the unit list to theDestinationfield.
Some versions of Disk Utility may include anErase Destinationcheck box.
If yours does, pick the check box.
If Disk Utility asks for your administrator password, provide the information and selectOK.
Disk Utility copies the InstallESD.dmg data to the USB flash machine.