Live data from Hacker News

Writing a file system from scratch in Rust

blog.carlosgaldino.com

1–10 of 63 posts

Re: Writing a file system from scratch in Rust

#5

I have read down to the implementation section, but for my money, this is the best way to describe the high level function and behavior of a filesystem that I have ever seen.

A very accessible (though dated) intro to filesystems is Practical File System Design, by Dominic Giampaolo.

PDF link: http://www.nobius.org/practical-file-system-design.pdf

Re: Writing a file system from scratch in Rust

#9

I have read down to the implementation section, but for my money, this is the best way to describe the high level function and behavior of a filesystem that I have ever seen.

A very accessible (though dated) intro to filesystems is Practical File System Design, by Dominic Giampaolo. PDF link: http://www.nobius.org/practical-file-system-design.pdf

Frankly, not too much has changed since Giampaolo. In fact, it is still standard reading in many graduate seminars on the subject!

Re: Writing a file system from scratch in Rust

#10
post #7

It would be nice if the intro had a brief explanation of why a disk needs to be divided into blocks. Otherwise, I really enjoyed this read from the perspective of a lay person.

The disk / inodes need to know where to start looking for a file's contents, like the address in memory for RAM. Or like the mail: We subdivide by city, then ZIP, then street, then address.

So the inode says "The data for my file starts at block 72 and is 3 blocks long" (or something like that). The disk then goes there, and reads blocks 72,73,74.

Each block is 4KiB large often, so if you have a 10KiB file, you still take up ceiling(file size/block size) blocks.

That's why there is a difference between "File size" and "Size on disk" when you look at disk usage summaries.

Post reply on HN