In the Disk Utility application, select the disk or partition you want to check — the system partition is named “Macintosh HD” by default — and click the “First Aid” button.
You can either run the First Aid function on an entire disk, or an individual partition on that disk. Click “Run” and your Mac will check the disk you selected for errors.
You can perform a check from within Mac OS X, but it may sometimes be necessary to use recovery mode to fix problems.
In a worst-case scenario, you may have to manually run fsck commands from a terminal in single-user mode.
You’ll see a progress bar appear, and you can release the keys after you do. (If recovery mode doesn’t appear, restart your Mac and try pressing the keys again.) In OS X Recovery, click the “Disk Utility” shortcut to launch the Disk Utility here.
Your Mac will be able to fix errors on your system drive from recovery mode. Press and hold the “Command R” keys while it’s booting.This will make the login process take longer than normal, so be patient.Ideally, that should be the end of it — especially if you used the safe mode trick above.Type the following command into the terminal and press Enter to start a file system check: The command will run through several phases of checks.When it’s done, you’ll see a message saying “** The volume [name] appears to be OK” if everything is fine.