Force unmount drive - Yosemite
You can't completely reformat/erase/repartition the drive you are booting from (assuming you are booting from the recovery partition on your main disk drive).

So boot to a bootable DVD, a second (external) hard drive, a bootable thumb drive or boot to Internet Recovery Mode by pressing altcmdR while starting your Mac.

Then open Disk Utility and reformat the internal drive.