Alternative proposals for FHS

Posted by MontyCLT@reddit | linux | View on Reddit | 32 comments

I don't like FHS. I won't go into a critique. I think most people here already know the historical baggage and inconsistencies it has.

I want to run a thought experiment: what would a filesystem hierarchy look like if we designed it today from scratch?

Proposal

This is not a serious proposal to replace FHS. I'm fully aware how unrealistic that would be due to compatibility and the ecosystem.

It's just a thought experiment about what a more semantically consistent hierarchy might look like. Maybe we could build a proposal together and try in an experimental distro.

This is my proposal:

/
├── system/
│   ├── boot/
│   ├── kernel/
│   ├── bin/
│   ├── lib/
│   ├── state/
│   ├── temp/
│   ├── runtime/
│   │   ├── dev/
│   │   ├── proc/
│   │   ├── sockets/
│   │   └── sys/
│   └── platform/
│       ├── arch/
│       └── manjaro/
├── apps/
├── config/
├── data/
├── volumes/
└── users/
    └── <user>/
        ├── .config/
        └── .data/

Design ideas

1. Reduce root complexity

The root directory should contain as few top-level directories as possible, each with a clear and distinct purpose.

2. Make the structure obvious at a glance

The goal is to make the structure easy to understand just by looking at it, avoiding historical clutter and overlapping responsibilities.

Directory structure

1. Top-level directories

2. System directories

Here, I have a doubt: should /system/kernel exists or the kernel should be in /system/boot? I'm not sure.

3. /system/state vs /data

The difference is who owns the data:

A simple rule:

For example, an SQL database used by the package system should be in /system/state while a SQL database with my customers should be in /data.

4. Distro-specific space

/system/platform/<name>/

Reserved for implementation details of the distro. A system may contain multiple distro directory for tools added by a derived distro.

For example:

This allows layering instead of forcing everything into a single "distro identity".

5. Minimal rules for user directories

users/<user>
├── .config/
└── .data/

Only two conventions are enforced:

Everything else is up to the user.

I'm curious how others would approach this: