Short: The disk recovery and repair suite Author: Marek 'March' Szyprowski Uploader: David Brunet Type: disk/misc Version: 1.1 Requires: MorphOS and a SFS drive Architecture: ppc-morphos >= 1.4.2 SFSDoctor - The Disk Recovery and Repair Suite ***** Installation ***** Installation is really easy and simple. Just copy SFSDoctor tool somewhere to your disk. The preferred place is SYS:Tools. SFSDoctor does not need any third party MUI classes and system add-ons and works even if the system is started from plain MorphOS 1.4.5 CD. Is is also advised to burn a rescue CD with this tools to be able to fix disks and recover files after a complete system and disk crash. ***** Disclaimer ***** Using repair module of this tool DOES MODIFY your disk. Make sure you have backed up all your important data. Remember that YOU USE THIS TOOL ON YOUR OWN RISK! The author, developers, and all concerned cannot and will not take responsibility for any damage done to your data or disks. ***** Common use cases ***** * Checking disk for errors: Easiest case. Just select your partition and press 'Check disk' button. * Repairing non-critical (i.e. checksum error in adminspace block) disk errors: Select your partition and press 'Scan disk' button. Check if all your files are listed. Also check if there are any errors reported in the log. Make sure that all files you want to keep on the disk are 'marked'. Press 'Repair disk' button, select file to save metadata backup and wait a minute. WARNING - 'Repair disk' action DOES MODIFY your partition. Please read the discaimer. * Recovering files from damaged disk to another partition: Select your partition and press 'Scan disk' button. If there were critical errors in disk structure you may even get information, that no SFS filesystem has been found on the disk. Just ignore this message. If you don't have much time you may mark 'Quick scan' option. Disabling that option will result in complete scan, which gives better results, but takes considerably more time. Also mark the 'Allow location quessing' option. Press 'Find lost files' button and wait until this operation finishes. After some time (depending on the size of your partition) you will see the list of files and dirs that has been found on disk. You may also get an information that some files are colliding with other ones. Just ignore this. Select all files you want to recover with 'Mark' option and then press 'Recover files' button. Some recovered files may be a complete garbage. This usually happens when you recover one of file that were on colliding file list. * Repairing disk after serious damage (i.e. quick format, trashed root blocks): Like in previous paragraph, first you need to use 'Scan disk' module, then 'Find lost files' module. Selecting 'Allow location guessing' usually is a bad idea, because it will create a lot of dummy, colliding files. You would get a directory tree of files found on disk. The log you may also get a list of colliding files. If you got no collidion files after 'Find lost files' action you are lucky :) Colliding files are two (or more) files that occupies the same blocks on disk (simmilar to 'crossed files' known from FAT checking tools). Such files cannont normally exist on disk. They very often appears during 'Find lost files' action, when SFSDoctor find an old file descriptor. That descriptor for some reasons has not been cleared/reaused. It was describing a file that was deleted, overwritten or moved to other place on disk. However such files cannot be distinguished from normal files, that's way they appear in file list. Usually the pair of colliding files consist of a real, 'normal' file and a 'dead' one. If you want to repair filesystem structure, there can't be any colliding files in directory tree. The best way to decide which file from colliding files pair is real one is to recover both files to another disk with 'Recover files' module and check the content of recovered files. With this method you should easily find all 'dead' files in directory tree. This is a bit long and laborius process, but this really can't be done in other way. Usually if you find one 'dead' file in a directory, then all files in such directory are 'dead'. You may always check if all files that are 'marked' collides with themself by pressing 'Check collisions' button. Make sure that all 'dead' files are not marked. Select 'Repair disk' button. All files that are not marked will be removed from directory tree, then whole directory tree will be recreated on disk. WARNING - 'Repair disk' action DOES MODIFY your partition. Please read the discaimer. * Continue interrupted (power failure, application crash) 'Repair disk' action: During the disk repair action all information about files is being overwritten on disk. That's why before this happen so called metadata backup is created. Make sure that this file is stored on other, working partition (and don't use Ram Disk for it!). If the repair operation is interrupted, reboot the system then run SFSDoctor and use 'Load backup' module. Select 'Repair disk' button to process the operation again. * Changing the filesystem options (recycled dir presence or case sensitivness) This operation doesn't really differ from repairing non-critical errors. Select your partition and press 'Scan disk' button. Check if all your files are listed. Also check if there are any errors reported in the log. Make sure that all files you want to keep on the disk are 'marked'. Change filesystem options in 'Repair disk options' group, then press 'Repair disk' button, select file to save metadata backup and wait a minute. WARNING - 'Repair disk' action DOES MODIFY your partition. Please read the discaimer. * Operating on badly damaged partition that causes system to crash It may happen that your partition is damaged so badly that SFS filesystem driver throws a lot of error requesters, decreases heavily system stability or even crashes. In such case it is advised to run system from rescue or system CD, then quickly run SCSIConfig tool and select damaged partition. Change filesystem type for that partition to FFS. This will prevent SFS driver from loading and crashing. Make sure that you do not change any other partition parameter. Save changes and reboot. This operation does not modify or affect any data on the partition. Damaged partition is now not visible, but the system operates stable. Run SFSDoctor and select 'Show all' option in device group. The damaged partition should be now listed in device list and you can operate on it. When you finish the repair run SCSIConfig and change filesystem type back to SFS. After reboot the partition will be visible again. ADVISE: Do not try to quick format such partition and then restore data from it. Although it is possible, it will cause damage to the directory tree and some files. The method with changing filesystem type usually allows to repeair the disk completely without any loosing any file. ***** Configuration options ***** There are 2 tooltypes that changes the amount of memory used by SFSDoctor for disk cache buffers: * BUFFERSIZE - size of single buffer in bytes - this is the amount of data read in single disk access; in most cases the default value is the right one * NUMBUFFERS - total number of buffers - SFSDoctor will consume (BUFFERSIZE * NUMBUFFERS) bytes of memory; higher number of buffers usually speeds up scan and check operations ***** Known problems ***** * Window title bar gets corrupted when device list is ghosted - this is known MUI 3.9 bug * You may get an information that your partition is being used by other applications even if you just started the system and there are no other programs running - this is problably caused by an assign made during system startup. ***** Thanks ***** The author would like to thank following people: * John Hendrikx - for SmartFileSystem * Marcin 'Morgoth' Kurek - for help in understanding SFS structures, source code examples and libDeviceIO library * Michal 'kiero' Wozniak - for patience, help in finding bugs, alpha and beta testing * Krzysztof 'Tarnak' Kretus and Michal 'Rzookol' Zukowski - for beeing so brave to do alpha and beta testing * Tomasz 'Kaczus' Kaczanowski - for suggestions, help in development and beta testing * Marian 'MaaG' Guc - for AutoDocReader and help in development * whole #castor-cvs team - for motivation and help with MUI problems * Tokai and JoBBo - for really nice icons * Stefan Stuntz - for MUI * Dietmar Eilert - for MorphED * Targhan - for managing SFSDoctor bounty donations * all who I forgot to list here Special thanks to people who donated this project: * amigaharry * Weiseb * Henes * saragaglia * GerdK * roschmyr * pegasosuser * RMS * DrB ***** Author, contact and copyright infos ***** SFSDoctor has been written by Marek 'March' Szyprowski. Contact: Copyright (C) 2005, 2006 Marek 'March' Szyprowski. SFSDoctor is a free software. New in 1.1 (01.05.2006) - disk bitmap is now allocated before disk is scanned to solve lack of continous memory problem - added simplified and verbose file collision check modes - some minor GUI changes (added appicon, added timestamps in log, fixed MUI prefs window) - fixed small memory leaks (thx to Morgoth!) - fixed crashes on low memory conditions - adapted to new, better build scripts (again, thx to Morgoth)