Here's what you need to do:
Cheap and Easy Defragmentation
You will have to backup your OS X partition to an external drive, boot from the external drive, use Disk Utility to repartition and reformat your hard drive back to a single volume, then restore your backup to the internal hard drive.
1. Get an empty external hard drive and clone your internal drive to the
external one.
2. Boot from the external hard drive.
3. Erase the internal hard drive.
4. Restore the external clone to the internal hard drive.
Clone using Restore Option of Disk Utility
1. Open Disk Utility in the Utilities folder.
2. Select the destination volume from the left side list.
3. Click on the Restore tab in the DU main window.
4. Select the destination volume from the left side list and drag
it to the Destination entry field.
5. Select the source volume from the left side list and drag it to
the Source entry field.
6. Double-check you got it right, then click on the Restore button.
Destination means the external backup drive. Source means the internal startup drive.
Restart the computer and after the chime press and hold down the OPTION key until the boot manager appears. Select the icon for the external drive and click on the upward pointing arrow button.
After startup do the following:
Erase internal hard drive
1. Open Disk Utility in your Utilities folder.
2. After DU loads select your internal hard drive (this is the entry with the
mfgr.'s ID and size) from the left side list. Note the SMART status of the
drive in DU's status area. If it does not say "Verified" then the drive is
failing or has failed and will need replacing. SMART info will not be
reported on external drives. Otherwise, click on the Partition tab in the
DU main window.
3. Under the Volume Scheme heading set the number of partitions from the
drop down menu to one. Set the format type to Mac OS Extended
(Journaled.) Click on the Options button, set the partition scheme to
GUID then click on the OK button. Click on the Partition button and wait
until the process has completed.
Restore the clone to the internal hard drive
1. Open Disk Utility in the Utilities folder.
2. Select the destination volume from the left side list.
3. Click on the Restore tab in the DU main window.
4. Select the destination volume from the left side list and drag
it to the Destination entry field.
5. Select the source volume from the left side list and drag it to
the Source entry field.
6. Double-check you got it right, then click on the Restore button.
Destination means the internal hard drive. Source means the external startup drive.
Note that the Source and Destination drives are swapped for this last procedure.