Fsck is what you want, I think. Try "man fsck" and see if that's what you need. It's the basic filesystem checking/repairing tool, and it works on a number of different filesystems.