File-System Landscape
Modern OS 通常同時面對多顆 storage devices、多個 partitions / volumes、以及多種 file-system types。Ch15 看的是它們如何被辨識、mount、共享、抽象化與遠端存取;block allocation / free-space management 是 Ch14。
常見型態
- General-purpose local FS:UFS、ZFS、ext4、APFS 等,保存一般 files / directories。
- Memory-backed FS:如 tmpfs,快但 reboot / crash 後消失。
- Pseudo / virtual FS:如 procfs、devfs,把 process、device、kernel objects 包成 file namespace,不一定對應 disk blocks。
- Loopback FS:把既有 subtree 重新掛到另一個 path。
- Remote FS:把其他 machine 的 directory tree 接進本機 namespace。
Storage 層次
- Storage device:HDD、SSD、NVMe、virtual disk。
- Partition:device 上的一段連續範圍。
- Volume:file system 使用的 logical block space;可等於 partition,也可由 volume manager / RAID 組合多顆 disks。
- File system:volume 上的 format 與 rules,負責 names、directories、files、metadata 到 storage 的映射。
OS 如何呈現
User process 理想上只看見 path、file descriptor、system calls。OS 透過 D-OS-Ch15b-File_System_Mounting 把 file systems 接進同一棵 namespace,再由 D-OS-Ch15e-Virtual_File_System 將 generic operations dispatch 到正確 implementation。
VFS 用 common interface 把差異限制在 file-system-specific layer,讓多種 file systems 能共用同一組 system-call path。