views:

42

answers:

2

Where do filesystems like Reiser, NTFS, etc store the file tables? We're looking at writing our own filesystem, and wondering if we should use a single file to hold it all using btree's or use something out there.

Any advice? This is more a learning exercise than anything.

Edit: removed NFS, and replaced with NTFS

A: 

There are several different schemes for encoding file-systems with various trade-offs in speed, simplicity, robustness to corruption, etc. Many files systems, especially of the Unix derived variety are based on the concept of an inode. ReiserFS does actually include an inode concept in it, but glues it all together in a different way than earlier systems.

A quick description of ReiserFS is here. Although, if you want to read a really good overview of the basic inode based design concept, I highly recommend the book "The Design and implementation of the 4.4 BSD Operating system". It has a really good chapter or two that walks through the whole thing.

A completely different approach to building a file system is something like the infamous DOS FAT File system. The FAT system is not based at all on inodes and instead uses a cluster chaining technique to map out files. Even though the FAT file system design is kind of clunky by today's standards, it does have the advantage of being really simple to implement especially in its original FAT12 or FAT16 varieties if you can live with its limitations.

Tall Jeff
+1  A: 

File System Forensic Analysis by Brian Carrier

Let me recommend to you this book as a great starting point for understanding the basics of file system layout. Yes, the title talks about forensics, but the book does an excellent job of explaining the on-disk structures. It will be much easier than trying to grasp them from reading the source code, most of which is more concerned with placement and optimization than the structures on the disk themselves.

WhirlWind