Skip to the content.

为什么设计一个文件系统是很难的

基本考虑

锁机制 缓存 多进程

基本功能

  1. O_DIRECT
  2. fs freeze 一致性快照
  3. journal 错误恢复
  4. 容忍磁盘错误
  5. 软硬链接
  6. overlay

高级功能

  1. bcache
  2. raid : zfs 的 raid 相较于 linux 中 ext4 + raid 有什么好处吗?
  3. cow
  4. 压缩
  5. 加密
  6. snapshot
  7. 动态扩容,缩容

操作手册

想象

zfs 和 bcachefs 的分析中,才发现很多 block layer 的功能都是集成到文件系统中。

看看 https://bcachefs.org/ 的 feature 和 plans 就很牛逼了

  1. reflink : 俗称 cow ,但是似乎也不是 cow https://unix.stackexchange.com/questions/393305/does-any-file-system-implement-copy-on-write-mechanism-for-cp

man ext4(5) 也是不错的

有趣的 fs

bcachefs 这也太慢了吧!

🧀  fio /home/martins3/core/vn/docs/kernel/code/aio/bcachefs.fio
trash: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=io_uring, iodepth=128
fio-3.36
Starting 1 process
trash: Laying out IO file (1 file / 10240MiB)
Jobs: 1 (f=1): [r(1)][1.6%][r=1172KiB/s][r=293 IOPS][eta 16m:24s]

真实运行的时候也太慢了,哈哈!

🧀  fio /home/martins3/core/vn/docs/kernel/code/aio/bcachefs.fio
trash: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=io_uring, iodepth=128
fio-3.36
Starting 1 process
kJobs: 1 (f=1): [r(1)][5.9%][r=504KiB/s][r=126 IOPS][eta 15m:41s]s]

但是,实际上 grep 之类的,速度还是很快的!

几个虚拟机文件系统让事情变的有趣

initramfs nofs 之类的

工业环境中几个文件系统让事情真的难受起来了

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。