How sys-ai-foundation/f2fs-tools works
This repository is a userspace toolkit for creating and maintaining F2FS filesystems. The primary workflow is to select a storage device, format it with mkfs.f2fs, and then mount the resulting filesystem with the operating system. Separate fsck.f2fs-family commands check, inspect, defragment, resize, and populate filesystems; additional tools manage encryption keys and report runtime filesystem statistics. The README and sampled entry points support the main formatting and command-dispatch relationships; internal wiring for unsampled utilities is not inferred.
Main entry points: main.c fsck command dispatcher · libf2fs_io.c Device I/O · f2fs_format_main.c mkfs.f2fs · f2fscrypt.c Encryption manager
Components 20
Filesystem formatting
- mkfs.f2fs
mkfs/f2fs_format_main.c - F2FS formatter
mkfs/f2fs_format.c
Filesystem maintenance
- fsck command dispatcher
fsck/main.c - Filesystem checker
fsck/fsck.c - Metadata reader
fsck/mount.c - Filesystem dump
fsck/dump.c - Defragmentation
fsck/defrag.c - Filesystem resize
fsck/resize.c - Filesystem loader
fsck/sload.c
Shared device support
- F2FS utilities
lib/libf2fs.c - Device I/O
lib/libf2fs_io.c - Zoned devices
lib/libf2fs_zoned.c
Administration tools
- Encryption manager
tools/f2fscrypt.c - SHA-512 implementation
tools/sha512.c - Filesystem statistics
tools/f2fstat.c - Filesystem helper tools
tools
Other components
- Operator
- Storage device
- Linux keyring
- Kernel F2FS status
Connections 21
- Operator → mkfs.f2fs: runs formatter
- mkfs.f2fs → F2FS formatter: formats device
- mkfs.f2fs → F2FS utilities: initializes configuration
- F2FS formatter → Device I/O: writes filesystem
- Device I/O → Storage device: reads and writes
- Operator → fsck command dispatcher: runs maintenance
- fsck command dispatcher → Filesystem checker: checks filesystem
- fsck command dispatcher → Filesystem dump: dispatches dump
- fsck command dispatcher → Defragmentation: dispatches defrag
- fsck command dispatcher → Filesystem resize: dispatches resize
- fsck command dispatcher → Filesystem loader: dispatches load
- fsck command dispatcher → Metadata reader: loads metadata
- Metadata reader → Device I/O: reads device
- Defragmentation → Device I/O: migrates blocks
- Operator → Encryption manager: manages encryption
- Encryption manager → SHA-512 implementation: derives keys
- Encryption manager → Linux keyring: searches keys
- Operator → Filesystem statistics: requests statistics
- Filesystem statistics → Kernel F2FS status: reads status
- Operator → Filesystem helper tools: runs helper
- F2FS utilities → Zoned devices: supports zoned devices