The program you are looking for is called fsck.
The normal process is unmount the filesystem you want to check. Run fsck on the correct device and after that mount the filesystem again.
EXAMPLE
Code:
umount /dev/sdd1
fsck /dev/sdd1
mount /dev/sdd1 /mountpoint
If you need to check your root filesystem use a live-cd to boot your system.
As about recovering:
If the problems are not to severe, fsck can probably correct them for you. Otherwise you get your backup out and restore your data from there.