UnixFS: A General Purpose Layer for Writing Unix-Style MacFUSE-Based File Systems

© Amit Singh. All Rights Reserved. Written in November 2008
UNIX® is a registered trademark of The Open Group.


UnixFS

While writing AncientFS, I created an abstraction layer called UnixFS that can be useful for writing other types of Unix-style file systems in user space. By "Unix-style" I mean a file system where you need concepts such as on-disk and in-memory superblocks and inodes.

As I described in the MacFUSE 2.0 talk, I used UnixFS in conjunction with ad-hoc "Linux emulation" to make several Linux in-kernel file systems work in user mode on Mac OS X very rapidly, and with large amounts of code unchanged. These currently include the UFS, System V, and Minix families of file systems.

To use any of these file systems, check out the MacFUSE source tree and compile one or more of them. A single make in the filesystems/unixfs subdirectory should build all of them.

$ svn co http://macfuse.googlecode.com/svn/trunk/filesystems/unixfs $ cd unixfs $ ls -F Makefile common/ sysvfs/ ancientfs/ minixfs/ ufs/ $ make ... $

UFS

$ ufs ufs (version 1.0): UFS family of file systems for MacFUSE Amit Singh <http://osxbook.com> usage: ufs [--force] --dmg DMG --type TYPE MOUNTPOINT [MacFUSE args...] where: . DMG must point to an ancient Unix disk image of a valid type . TYPE is one of: old sunos sun sunx86 hp nextstep nextstep-cd openstep 44bsd 5xbsd ufs2 . --force attempts mounting even if there are warnings or errors

System V FS

$ sysvfs sysvfs (version 1.0): System V family of file systems for MacFUSE Amit Singh <http://osxbook.com> usage: sysvfs [--force] --dmg DMG MOUNTPOINT [MacFUSE args...] where: . DMG must point to a disk image of a valid type; one of: SVR4, SVR2, Xenix, Coherent, SCO EAFS, and related . --force attempts mounting even if there are warnings or errors

Minix FS

$ minixfs minixfs (version 1.0): Minix File System for MacFUSE Amit Singh <http://osxbook.com> usage: minixfs [--force] --dmg DMG MOUNTPOINT [MacFUSE args...] where: . DMG must point to a Minix disk image . --force attempts mounting even if there are warnings or errors