interface
core
The shared filesystem.Filesystem contract every driver implements โ Read/Write/List/Stat/MkDir/Rename and friends. No cgo, no root.
Pure-Go filesystem drivers โ read & write on-disk filesystem images with no cgo and no root.
go-filesystems is a set of independent, dependency-free Go modules that
read and write on-disk filesystem images โ one module per filesystem, all implementing a small
shared contract. Open and inspect an image, mutate it in place, or format a fresh one โ entirely
in Go, with no kernel mount and no C toolchain.
Every driver implements filesystem.Filesystem from
go-filesystems/interface.
type Filesystem interface {
Close() error
ReadFile(path string) ([]byte, error)
ListDir(path string) ([]DirEntry, error)
Stat(path string) (Stat, error)
WriteFile(path string, data []byte, perm os.FileMode) error
ReadLink(path string) (string, error)
MkDir(path string, perm os.FileMode) error
DeleteFile(path string) error
DeleteDir(path string) error
Rename(oldPath, newPath string) error
}The shared contract plus every filesystem driver that actually exists in the org today. Capabilities reflect what each driver implements now, not just what the on-disk format allows.
interface
coreThe shared filesystem.Filesystem contract every driver implements โ Read/Write/List/Stat/MkDir/Rename and friends. No cgo, no root.
apfs
driverApple File System โ real APFS on-disk (kext-mountable), GPT-aware. Read, write, format, symlinks and snapshots.
btrfs
driverCopy-on-write Linux filesystem with snapshots and subvolumes. Single-device, CRC32c (btrfs-progs โฅ 5.x). Read, write, format.
exfat
driverExtended FAT for large removable media. Read, write, format and volume label.
ext4
driverLinux ext4 โ extents, 64-bit block numbers, flex_bg, directory htree, journaling, metadata_csum (CRC32c). Read, write, format, symlinks.
fat32
driverFAT with 32-bit allocation โ the cross-platform baseline. Read, write, format and volume label.
iso9660
driverISO 9660 / ECMA-119 optical-disc filesystem, plus Rock Ridge (names/perms/symlinks) and Joliet (UCS-2 names). Read-only.
ntfs
driverWindows NT filesystem โ minimal in-image blob model (NOT the real NTFS on-disk format). Read, write, format and volume label.
oci
driverRead-only OCI / Docker image filesystem โ overlays an image's tar layers (whiteouts, opaque directories, hardlinks, symlinks) and serves the merged rootfs through the shared contract. Image-as-filesystem, not an on-disk format.
squashfs
driverCompressed read-only archive filesystem. SquashFS 4.0 with gzip/xz/zstd/lzo/lz4 blocks and fragments. Read and format.
uefi
driverEFI System Partition (FAT-based) plus the OVMF/EDK2 NvVar variable store with time-based authenticated writes. Read, write, format.
ufs
driverUnix File System (BSD) โ UFS2 (FreeBSD 14.x) read+write, UFS1 read. Read, write, format, symlinks.
ffs
driverNetBSD/OpenBSD FFSv1/FFSv2 alias module over the ufs driver. Read, write, format.
xfs
driverHigh-performance journaling filesystem โ XFS v5 (CRC32c, ftype). Read, write, format, symlinks and volume label.
zfs
driverCopy-on-write pooled storage filesystem โ single pool / single vdev (test-oriented subset). Read, write, format and snapshots.
Every module is pure Go with CGO_ENABLED=0 and needs no root
privileges and no external mount tooling for normal operation. Each driver speaks the same small
filesystem.Filesystem contract, so callers stay format-agnostic. Drivers are
cross-checked against the real on-disk formats their reference tools produce. BSD-3-Clause throughout.