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.
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.