[ag-automation] Problem reading RBF filesystem on SCSI disk

Carsten Emde Carsten.Emde at osadl.org
Thu Mar 29 10:58:26 CEST 2007


Piotr,
>> [..]
>> As you can see, the logical sector number of the root directory is
>> 0x0000e9. Since the sector size is 256 Bytes, the offset of the root
>> directory is 0xe900.
>> Let's have a look at this location:
>> E900: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
>> E910: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
>> E920: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
>> E930: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
>> etc.
>>
>> Thus, the error message "BF invalid inode loop0:000000e9" makes sense:
>> The entire root directory has been erased, intentionally or accidentally.
> Strange...
Ah, then the next probable explanation is that the physical image of the 
hard disk is incorrectly read under Linux.

I found something that looks like a correct root directory (the LSN of 
the dot entry equals the LSN of the dotdot entry -> 0xe9):
1CA00:2E AE 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
1CA10:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 E9  ................
1CA20:AE 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
1CA30:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 E9  ................

and the related file descriptor block is here
1C900:BF 00 01 05 03 05 05 36  02 00 00 03 40 61 0C 01  .......6.... at a..
1C910:00 00 EA 00 0A 00 00 00  00 00 00 00 00 00 00 00  ................

So the segment list indicates 0xea00 as the beginning.

The FD, for example, of the file "OldBoot" is here:
1D400:03 00 00 61 0C 01 0D 06  01 00 00 BA 58 61 0C 0B  ...a........Xa..
1D410:00 00 F5 00 BB 00 00 00  00 00 00 00 00 00 00 00  ................

The File itself is here:
1D500:4A FC 00 01 00 00 64 50  00 00 00 00 00 00 64 44  J.....dP......dD

According to the first entry of the segment list, it should be at 
0xf500, but it is at 0x1d500.

The directory entry is
1CA40:4F 6C 64 42 6F 6F F4 00  00 00 00 00 00 00 00 00  OldBoo..........
1CA50:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 F4  ................

So the FD should be at 0xf400, but it is at 0x1d400.

Let's compare:

                     Should be at   Is at      Difference
Root directory FD      0xe900     0x1c900       0xe000
Root directory         0xea00     0x1ca00       0xe000
OldBoot FD             0xf400     0x1d400       0xe000
OldBoot                0xf500     0x1d500       0xe000

By some reason, some mechanism has inserted 0xe000 Bytes into the image. 
For testing purposes, I removed 0xe000 Bytes from 0xe000 to 0x1bfff 
which made the first part of the disk consistent; I was then able to 
mount the image and to display, for example, file descriptor info:

# mount -o loop,verbose,sector=256 bootsec /mnt/os-9
# ls -al /mnt/os-9/OldBoot
-rw------- 1 root root 47704 1997-12-01 14:06 /mnt/test/OldBoot

Maybe, the problem is related to the sector size of 256 instead of 512 
Bytes of the OS-9 disk. Linux possibly calculates the buffer twice as 
large as necessary and fills only the first half. This way, a gap of 
0xe000 Bytes would be created in the second half of every block of 
0x1c000 Bytes. This is, however, only a vague assumption.

> I'll put HDD back to the MCS just to check if it still in good condition.
It probably is. If you do this, please check (assuming your harddisk is 
/h0):
dump /h0@
dump /h0@ e900
dump /h0@ ea00
dump /h0@ f400
dump /h0@ f500
dump /h0@ 1c900
dump /h0@ 1ca00
dump /h0@ 1d400
dump /h0@ 1d500

I need the first one or two output lines. Unfortunately, I do not have 
any longer a hard disk available that is physically formatted to 256 
Bytes per sector. As far as I remember, only selected hard disks such at 
Fujitsu's had this feature. But this is history now.

	cbe


More information about the ag-automation mailing list