| title | GNULUG Oct 5 meeting: FUSE! |
|---|---|
| author | Samuel Grayson |
- All important operations implemented in kernelspace and at install time.
- Possibly layered
- E.g. Windows, FreeBSD
- All important operations implemented in kernelspace, but you can add/remove modules from the kernel.
- More similar to monolothic, just with module load/unload.
- E.g. Linux
- Most important operations implemented in userspace, installed/removed like users programs.
- E.g. MINIX, GNU HURD
- In userspace, a CPU register makes certain assembly instructions illegal.
- In kernelspace, that register is off => direct control over hardware.
- Kernelspace > root user > normal user
- Kernelspace requires a greater degree of trust. Becomes attack surface for hackers.
- Why not implement operation in userspace? Direct hw access and performance. For file systems, mostly performance.
- Kernel please read this big file into my memory space.
- Filesystem in User SpacE
- Inspired by GNU HURD
- For FS that isn't performance critical or system critical
- Autotier FUSE that automatically moves files into tiered storage based on access.
- SSHFS mounts a directory on a remote over SSH. Needs a maintainer!
- rclone mount lets you mount Google Drive (!)
$ mkdir test
$ # install by system package manager and call "make" or use Nix to install and compile
$ nix build .
$ ./result/bin/vanilla_fs test
<lots of output>
$ # in another terminal
$ ls -l test
total 0
-rwxrwxrwx 0 root root 29 Dec 31 1969 every_path_resolves_to_a_file
-rwxrwxrwx 0 root root 29 Dec 31 1969 welcome_to_bbfs
<script id="asciicast-1SYKFtKmWS3nJVqmsEdqyZ76c" src="https://asciinema.org/a/1SYKFtKmWS3nJVqmsEdqyZ76c.js" async></script>
- Trial-by-error: you need
getattrfor anything else to work. getattrmust setst_mode = S_IFDIRfor files andst_mode = S_IFREGfor anything else to work.getattrmust setst_sizeto the real size of the file. GLIBC read will truncate the result to this size!writereturns the number of bytes written. This must equal the number of bytes requested (third arg) or else GLIBC will think thatwritefailed.
readtakes an optional offset, which begins reading from that point.readmust return the number of bytes read. If this is less than the amount requested, GLIBC interprets this as the end-of-file.readdircallsfiller(...)to return results
- FUSE documentation
- Fuse options
-s: single-threaded,-d: debug mode (implies-f),-f: foreground. - Can leave almost any methods unimplemented.
- Fuse options
- Nice FUSE tutorial
- Try starting from a 'passthrough' FUSE that proxies the underlying FS?


