Skip to main content

FS

逻辑/内存

fsmount pointnotes
rootfs/
proc/proc
sysfs/sys
devfs/devlinux 4.16+ 废弃
devtmpfs/devudev
cgroup/sys/fs/cgroup
cgroup2/sys/fs/cgroup/unified
cpuset/sys/fs/cgroup/cpuset
debugfs/sys/kernel/debug
securityfs/sys/kernel/security/LSM - Linux Security Modules
tracefs/sys/kernel/debug/tracing
devpts/dev/ptsPseudo terminals
binder/dev/binderfsAndroid binder IPC
pstore/sys/fs/pstore
autofs按需挂载和卸载
fusectl/sys/fs/fuse/connectionsfor fuse
bindfsmount --bind
specfs/dev/streams不需要挂载
tmpfs/tmp,/run
ramfs
pipefspipe:当 shell 使用 pipe 时
loopfs/dev/loop*
bpf
sockfsTCP/UDP sockets
hugetlbfs
bdev
mqueue
fscache
initramfsINITial RAM FileSystem临时 roofs
initrdInitial Ramdisk被 initramfs 替代

物理/硬盘

fsstand fornotes
zfsZettabyte File SystemSolaris, FreeBSD, Linux
xfsSGI's Journaled File SystemLinux
bcachefs
exfatExtended FATWindows, macOS, Linux
APFSApple File SystemmacOS, iOS
ntfsWindows NT File SystemWindows, Linux 5.15+ RW, macOS RO
[btrfs]B-Tree File SystemLinux
ext4
fat32Windows
ext3
bcache
omfsOptimized MPEG Filesystem

Flash/SSD

  • 磨损均衡/wear leveling 区分 Host-Level 和 Device-Level
  • 新的 SSD 有自己的 FTL 能实现 wear leveling
fsstand fornotes
erofsEnhanced Read-Only FSAndroid ROM /system
f2fsFlash-Friendly File SystemAndroid /data
exfat🌟 推荐
sdcardfs
TFAT
APFSApple File SystemiOS, macOS
YAFFSYet Another Flash File System
  • APFS
    • 主要面向 iOS, macOS 等 Apple 自家设备, 因此功能特性会考虑自家的 Flash Controller
    • 不建议用于外部设备
  • Android
    • ROM 现在大多使用 erofs
    • 5.0+ 支持 f2fs 作为 /data
    • 2.3+ 使用 ext4
    • 2.3 以前 mdt 使用 yaffs
特性EROFSSquashFSCramFS
压缩算法LZ4、LZMAGZIP、LZ4Zlib
压缩粒度块级文件级文件级
随机访问支持,性能高支持,但性能一般不支持
元数据压缩
小文件优化是(Inode Inline 数据)一般一般
挂载灵活性一般

ROM

主要用于嵌入式设备、固件、LiveCD

fsstand fornotes
[erofs]Enhanced Read-Only FSAndroid ROM /system
squashfslive-distro
cramfsCompressed RAM/ROM FileSystem被 squashfs 替代

逻辑

fsnotes
overlayfsunionfs 的替代品
unionfs
aufsv1 AnotherUnionFS, v2 Advanced multi-layered Unification fs
fusefs in userspace
OrangeFS

网络/NAS

fsstand fornotes
nfsNetwork File SystemUnix
smbServer Message BlockWindows
cifsCommon Internet File System~= SMB
pvfs2OrangeFS
juicefs
davfs2WebDAV
ftpfsFTP
sshfsSFTP
gfs2Global File System by RedHat
lustreLustre File System
cephfsCeph File System
glusterGlusterFS
hdfsHadoop Distributed File System
cat /proc/filesystems # 支持的 fs
ls /proc/fs/ # fs 模块
cat /proc/mounts # 挂载情况

# https://www.kernel.org/doc/html/latest/filesystems/debugfs.html
mount -t debugfs none /sys/kernel/debug

# https://docs.kernel.org/admin-guide/binderfs.html
mkdir /dev/binderfs
mount -t binder binder /dev/binderfs

mount -t specfs none /dev/streams