This article is from the comp.sys.acorn FAQ, by Paul Vigay with numerous contributions by others.
There are various programs out there now which fix this problem. The PD ones all are 'caveat emptor' programs but are worth trying if you vitally need to recover some files, or just don't have the floppy disc/streamer space to back your drive up.
DiscKnight is a commerical repair tool from the ARM Club which fixes both the standard and new RISC OS 4 long filename formats. It is available for the budget price of 10ukp and includes free support. A checking only version is available for free download from the DiscKnight website at http://www.discknight.riscos.org.uk/
A utility called 'fsck' (a shareware utility available at good FTP sites near you) works reliably and well. The distribution version does not work with the large disc FileCore but by registering you can obtain a version that does repair large discs. However, it does not cope with the new RISC OS 4 F+ format discs. Fsck has now spawned a commercial version, called Disc Doctor, which not only has all the registered user features, but allows the undeleting of files as well. Contact Oregan Developments for mor e information on Disc Doctor. Disc Doctor is no longer under active development.
Another shareware tool is DiscEdit - strictly speaking it is a disc sector editor but it also contains routines for directory repair. Even so it is recommended that if you have critical data on your drive you should use one of these tools to recover the data and then reformat the drive. Again, DiscEdit doesn't handle RISC OS 4 extended disc formats.
Another commercial disc repair application is available from Look Systems, called ADFS Rescue which is also recommended.
My own Disc Commander application will allow you to edit bad sectors by hand and will work with the new F+ format discs under RISC OS 4. However, as yet I haven't added automated recovery into it, so it's mainly designed for people who feel competant at manually editing sectors and want a powerful tool for performing disc operations. More information can be obtained from http://www.vigay.com/software/commander.html, including a downloadable version.