[CVALE] How do you design a file system?

Steve Bibayoff bibayoff at gmail.com
Tue May 8 14:19:43 PDT 2007


Hello,

On 5/8/07, Landon Blake <lblake at ksninc.com> wrote:

> This is the story of my life. :]
>
> But you have to start somewhere...

Yea, but writing a filesystem is not one of the first things you want
to start when looking at OS writing. A very good book, although
doesn't cover filestystems, is Jonathan Corbet "Linux Device Drivers":
http://www.oreilly.com/catalog/linuxdrive3/book/index.csp
Has very good examples(from beginner to advance) on a wide range of subjects.

> Steve wrote: "There's also a few good books on filesystem design.
> ATTOMH, I can't thing of what they are right now, maybe someone else
> could.But for OS desing, I would highly recomend going through the
> Richard Stevens UNIX series of books, plus also books by Tanenbaum and
> Kirk McKusick. One last book is "UNIX Internals" by Vahalia is very good
> theory book."
>
> I have a couple of these books. They include "Computer Organization and
> Design"

Not familar w/ this book.

> ... and "The Design of the Unix Operating System".

Is this that Bach book? If it is, it's OK, just very dated (IIRC > 20
years old) and very specific to the Unix System V. But it still is a
good source of general knowledge.

> ... I also have at
> least two or three books on Linux programming.

Most of these books are userspace/desktop orientated and would not
help at all w/ any lower level Linux kernel stuff.

> Perhaps I need to start with the books on basic Linux programming. My
> interest in file systems may be too narrow or specific for my limited
> knowledge.

If you are really interested in Filesystem, I would first you try to
answer these questions:
1) What is a filesystem(in general terms)?
2) What is an inode?
3) Do all filesystems have inodes?
4) Are inodes created when the filesystem is created? or on the fly?
5) What is a directory?
6) What is a file?
7) How is a directory different/same as a file?
8) What is the difference between a soft link and a hard link?
9) How does the OS know where a file is located on the disk?
10) What happens when you delete a file? Directory? What is unlink?
11) What happens when you "mount" a filesystem? "umount" it?

I believe if you could answer these questions, you would be on your
way to understanding how a filesystems works.

Also, I again would say take a look at Fuse:
http://fuse.sourceforge.net/
There appears to be close to 100 different filesystems written to use it:
http://fuse.sourceforge.net/wiki/index.php/FileSystems

Again, there is a good book on filesystem theory  and design, but I
can't remember it's name right now. It's ~10 years old, but goes from
general theory(would answer all of the questions I posed), to very
specific examples and problems(yes, this book is a text book). If I
remember the name, I'll let you know. I have this book, just not close
to be at the moment( ~300 mile away).


Hopefully this is enough to get you started,

Steve



More information about the cvale mailing list