Use File System Check
Your Mac seems stable and healthy, and you figure youâ€™ve got it made. Because of this, youâ€™re probably thinking you donâ€™t need to check the file system for errors. Donâ€™t do that though, because there may be problems lurking in the background that you canâ€™t see. Just as itâ€™s a good idea to go to the doctor once a year even if you feel great, you need to give your Mac the once-over every once in a while too.
Although you could purchase expensive third-party utilities to search your hard disk for errors and repair them, your Mac OS X machine comes with a built-in utility called File System Check that you can use to do the same thing. File system checks are run using Single-User mode by typing in a simple command. You should perform these checks monthly. To run a file system check now, follow these steps:
1. From the Apple menu, choose Restart.
2. As your Mac boots, hold down the Command+S key combination to start the computer in Single-User mode. (Make sure to press this key combination right after the chime; otherwise, you wonâ€™t get in.)
3. At the command prompt, type /sbin/fsck â€“fy. Thereâ€™s a space before the â€“fy. This command tells your Mac to run File System Check, force the check (f) and answer yes (y) to any and all questions regarding fixing, repairing, or salvaging information. Apple says this is the optimal approach because answering no to any question causes fsck to stop running.
4. If the File System Check finds errors, run it again until no more errors are found. Youâ€™ll know errors were found if you receive the message â€œFILE SYSTEM WAS MODIFIED.â€ Youâ€™ll know when all errors have been repaired when you see the message â€œThe volume Macintosh HD appears to be OK.â€
5. Type reboot once all of the errors have been found and repaired.