Disk repair and file recovery extensions
A disk repair undelete utility could not be written for AFS. Dave Hayne tried with with DiskSalv4.
There are a number of reasons for this but first you need to understand a little about the way AFS worked. You will recall that AFS allocates a small percentage of the partition to its reserved area. It is here that the bitmaps and directories exist.
When AFS updates its reserved area it NEVER updates the data in situ. It will store it somewhere else. If the system fails the partition is guaranteed to be valid. The update will either be there in full or not at all. All very clever. The problem is that there are literally dozens of copies any one structure. Which is the most current ? A recovery program can only guess. PFS-2 stores an update number in each and every block. This makes recovery tools possible.
The way AFS allocates reserved blocks is also a problem. It has a roving pointer that sweeps the reserved area so that allocations are made sequentially. AFS did not save this pointer so that it was effectively reset when the machine was rebooted. This would result in blocks being quickly reused. Again a problem for a recovery tool.
Finally, in a bid to save a few more micro-seconds, AFS keeps the last longword of the reserved area bitmap in memory. It will allocate memory from this where possible. Statistically a large number of deallocations also hit this cache. This is dreadful news. Blocks are reallocated incredibly quickly. A recovery tool has no chance.
PFS-2 has been written to avoid all these problems. A recovery tool is now possible and indeed is under development.