Distinguishing Linux Filesystems

filesystems

I've been trying to better understand how the linux filesystem works, looking at journaling, inodes, and access control list. In looking into this, I came across filesystems which don't seem to act how I would expect a filesystem to act, such as glusterfs and mergerfs. Instead of getting written to a hard drive similar to how mkfs.ext3 or mkfs.xfs would, they are run on top of the other filesystems. So both ext3 and mergerfs (or glusterfs) could be used with the same drive, which seems strange since I as far as I know, two filesystems can't be defined on the same partition.

Is my understanding of filesystems wrong, or is there something special about the mergerfs/glusterfs systems which distinguish them from ext3 or xfs?

Best Answer

The word "filesystem" is somewhat overloaded, and I think that might be confusing you. In one sense a "filesystem" is the format in which files are written to some medium (e.g., a partition on a disk). In another sense, a "filesystem" (or more specifically, a "Virtual Filesystem") is an abstraction provided by the OS that presents a set of files (regular files, directories, etc). An OS can read the on-disk filesystem and present a filesystem abstraction.

The files presented in the filesystem abstraction can be stored on disk (e.g., ext4), on some other host across the network (e.g., cifs, nfs), or elsewhere. Something like mergerfs takes multiple sources of files and presents them as if it was a single source. From their website "mergerfs logically merges multiple paths together. Think a union of sets."

Take a look at the mergerfs website, they have a nice description of what that does.

Related Question