Lion Cipher Lab

Write a userspace filesystem from scratch with FUSE

Why it matters

A filesystem feels like something only the kernel can do -- deep, privileged, off-limits. FUSE removes that mystery in the most convincing way possible: it lets an ordinary, unprivileged userspace program BE a filesystem. You write a handful of callbacks, mount them at a directory, and from that moment every `ls`, `cat`, and `echo >` that touches that directory is a function call into YOUR code. That is the single clearest way to see the Virtual File System boundary that every Unix program lives on top of. When a process calls read() on a file under your mount, the C library traps into the…

What you'll learn

Steps in this lab

  1. What FUSE is, and the exact path a request takes
  2. Why this exists -- and where it already runs on your machines
  3. Set up: one scratch folder, FUSE, and fusepy
  4. Write the read side: getattr, readdir, open, read
  5. Add the write side: create, write, truncate, unlink, mkdir
  6. Mount it and watch your code service every request
  7. Unmount cleanly -- and see a wedged mount
  8. The judgment: security, performance, and when NOT to use FUSE

Open the full interactive lab →