The AROS Archives(anonymous IP:,331) 


   o Audio (94)
   o Datatype (15)
   o Demo (46)
   o Development (243)
   o Document (61)
   o Driver (19)
   o Emulation (60)
   o Game (506)
   o Graphics (218)
   o Library (22)
   o Network (59)
   o Office (21)
   o Utility (242)
   o Video (18)

Total files: 1624

Full index file
Recent index file

Part of aros exec
 Readme for:  Utility » Filetool »

arSFSDoctor v1

Description: SFS Recovery Application
Download:       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 87kb
Version: 1
Date: 21 Sep 21
Email: serk118/gmail com
Requirements: x86
Category: utility/filetool
Replaces: audio/
License: Other
Distribute: yes
FileID: 2380
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 91  (Current version)
134  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

[Show comments] [Show snapshots] [Show videos] [Show content] [Replace file] 
						Welcome to arSFSDoctor v1

I started working on sfsrecovery tool since 2019 just after losing my hard disk.
Goal is to make it look and feel like original SFSDoctor and run on AROS to
recover lost/deleted/lost 
and corrupted sfs disk/partitions.

Look and Feel it's not same as SFSDoctor yet but i am happy with the current
design of arSFSDoctor.

What used and who helped during the build.
-Some sourcecode from ASFS linux driver are used.
-Functions from sfscheck.c from aros tree.
-libdiskio/ by Fredrik Wikstrom <fredrik()>
-Btree build - by Krzysztof Smiechowicz <deadwood()>
-some functions are taken from opensource testdisk.
-serk118 classes/mui/zune designe and rest of the implemention <Serk118

-I like to thank John Hendrikx for all the helps/sample codes and directions  -
John Hendrikx <hjohn()>

-LunaPaint used for icon.
-Arzip to archiive.
-Txt2Pdf for pdf.
-gcc compiler.

Buttons and functions

About - Displays about window.

Devices - available sfs drives.(scan & show devices button brings up none sfs
drives too).

Chack Disk - same way how sfscheck works on AROS (Need bit more work).

>Scan Disk  - scans for lost/damaged/croupted and deleted files/folders.
>Scan Options - recover and scan methods.
>Quick Scan - Basic valid unbroken structure/admin/container data scan.
>Standard Scan - slighly faster than Deep Scan and yet again effective results.
>Deep Scan - slow but very effective results.
>Listview - shows all the files.
>Select All/Undo Selected - sellect/unselect all files/folders.
>Mark/unmark - Marks and unmark selected files/folders

>Save Log -- saves log file to selected path.
>Clear Log -- clears the log.

>Clone Drive -- clones selected partition drive to image file.
>Clone Drive - generates a temporary TSFS mount file to same directory/device
where image file is,
>copy the mount file to devs/dosdrives/ and than you should be able to  mount
image file by using system/DiskImageGUI.
>Return to Main -- back to main screen.

>Quit -- exit to AROS dos..

Planned to add more

--Langauge -- Catalogs(%1 done).
--Advance scan (scan from=xx till=xx , within available partition size
range)(%10 done).
--Image scan only..
--Repair partition (%60 done).
--Load/save log file(%20 done).
--Load/save partition metedata(%30 done).
--Sfs structure repair (%10 done).
--Sfs2 implemention(%0 done).
--Optimise read and write methods to gain more speed(direct i/o and cache
i/o)(%10 done).
--Clean readme guide in pdf (%5 done).

Example steps
1.Open arSFSDoctor.
2.Pick a sfs partition from the device list.
3.Scan Disk.
4.Select Deep Scan.
5.Click on Scan Now button all the files and mark them.
7.Click on Recover Now and select location where you like to save your salved
files etc..
8.Return to Main.

All started with johns help
I haven't looked at it for almost 20 years, but let's see.

First try and locate the Root block.  I think it should start with 
"ROOT" (but I didn't check).  SFS has two of these, one at the start
of the partition and one at the end.  One of the fields contains the
block size, which will be the size of all important SFS blocks.

The root block has the root object container, which contains information
about files and directories in the root directory.  The object 
containers basically hold one or more smaller structures that represent
files and directories.  Scanning them all should give you a list of 
files and directories.

The root block also has the root of the Extent B-Tree.  This is a 
standard B-Tree structure (not a binary tree) that is used commonly in 
all kinds of system, you can read about how they work on Wikipedia if 
needed.  The B-Tree holds the information about *where* all the data is 
located for your files.

To recover your files, I'd do this:

- Find one of the root blocks, if not present, then figure out the block 
size your disk was using, and scan every block in turn to see if it 
looks like an ObjectContainer (check the fsBlockHeader's ID, check if 
the ownblock number is equal to the block you are currently scanning, 
and check its checksum).  So if you currently have block 12, and you see 
a block with the correct id, and ownblock = 12 and its checksum is good, 
then that's probably a valid ObjectContainer.

- With all the ObjectContainers found, you can extract filenames and 
directory names from these, but also the number of their first data 
block (in the field data) and the file size.  For small files (less than 
blocksize) this data block will be enough to recover the data.
For larger files, you might be lucky and all the remaining blocks are
found after the first one (if the file was defragmented).  You can't be
sure of that though so...

- For larger files, you need to find all the BNodeContainers.  You could
scan these in the same way you found all the ObjectContainers (look for 
blocks with the correct id, ownblock number and checksum).

- With all the BNodeContainers found, you can try looking up the first
data block of a file in the B-Tree structure.  This is a bit complicated 
-- the B-Tree consists of non-leaf nodes (blocks that only contain 
pointers to other B-Tree blocks), the isLeaf flag indicates this.  Or it 
can be a B-Tree leaf block.  The leaf blocks contain extra
information per entry (see

struct fsExtentBNode {
     ULONG key;
     ULONG next;
     ULONG prev;
     UWORD blocks;

The key should be a block of a file (the first of a range), that is 1 to 
65535 block long (depending the "blocks" field).  If the file is split 
up into more parts, then "next" will contain block number of the
next range of blocks.  You need to look this up again in the B-Tree 
structure to find out how large it is.

The B-Tree is a bit complicated, so let me know how far you get, and I 
can explain in more detail if you have questions.

You can for the most part ignore the other structures (bitmap, admin 
containers).  The fsObjects and B-tree containers is what you'll need to 
recover the data.


contact me
serk118() (for bug report etc..)

Use at your own risk..

Copyright © 2005 - 2024 The AROS Archives All Rights Reserved