BeFS (Be File System)

BeFS is the 64-bit journaled file system of BeOS (1996) with indexed extended attributes and queries. Haiku reimplemented it and still uses it, and it is otherwise legacy.

Overview

BeFS has a superblock at byte offset 512 with the signature BFS1. Storage is divided into allocation groups tracked by a bitmap, and a log area journals metadata. Inodes carry a small area for extended attributes and can point to attribute directories, which let the file system index attributes and answer queries. Directories are B+ trees.

History

  • Designed by Dominic Giampaolo and Cyril Meurillon at Be Inc. for BeOS (1996-97).
  • Haiku re-implemented it as an open-source system.

Structures

Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

Be Fs File System

OffsetSizeTypeFieldNotes
0x284u32 LE/BEBlock Size
0x308u64 LE/BEBlocks
0x4C4u32 LE/BEAg Shift

Entries

OffsetSizeTypeFieldNotes
0x04u32 LE/BE–
0x44u32 LE/BENode Size
0x108u64 LE/BENode
values8u64 LE/BE–
lengths + k * 22u16 LE/BEEnd
at + 88u64 LE/BENode
values + k * 88u64 LE/BE–
at + 168u64 LE/BE–
at + 242u16 LE/BECount
at + 262u16 LE/BEKey Bytes

Enumerate Lost Entries

OffsetSizeTypeFieldNotes
0x144u32 LE/BE–
0x184u32 LE/BE–

Inline Name

OffsetSizeTypeFieldNotes
at4u32 LE/BEType
at + 42u16 LE/BEName Size
at + 62u16 LE/BEData Size
at + 81u8–

Make Entry

OffsetSizeTypeFieldNotes
0xC4u32 LE/BE–
0x104u32 LE/BE–
0x144u32 LE/BEOde
0x184u32 LE/BEFlags

Read Superblock

OffsetSizeTypeFieldNotes
at4u32 LE/BE–
at2u16 LE–
at8u64 LE–
at + 42u16 LE/BE–
at + 62u16 LE/BE–

Probe

OffsetSizeTypeFieldNotes
0x284i32 LEBlock Size
0x308i64 LEBlocks

Other fields read

Read inOffsetSizeTypeFieldNotes
Data Runs72 + 1368u64 LE/BE–
Enumerate Lost Entries0x144u32 LE/BE–
Enumerate Lost Entries0x144u32 LE/BE–
Is Allocated(int)(bit / 32) * 44u32 LE/BEWord
Read Inode0x04u32 LE/BE–
Read Superblock0x388u64 LE/BEFree Bytes
Read Superblockat4u32 LE–
Timeat8u64 LE/BESeconds

Constants

Be Fs File System

NameValueTypeNotes
InodeMagic0x3BBE0AD9, TreeMagic = 0x69F6C2E8uint
AttributeOrIndexBits0x08000000 | 0x10000000 | 0x20000000uintS_ATTR_DIR, S_ATTR, S_INDEX_DIR
Stream72int
Invalidulong.MaxValueulong
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.