zlacker

[return to "Understanding the bin, sbin, usr/bin, usr/sbin split (2010)"]
1. IgorPa+Vp[view] [source] 2026-01-04 16:33:32
>>csmant+(OP)
Also /bin vs /sbin believe is that the latter is meant for statically linked binaries such that if your system is corrupted these at least will keep working.

Practically in this century if I was starting a new OS I would set it up like so:

/bin for all system binaries. Any binary from a package installed by the OS package manager lived here.

/lib same but for shared libraries

/var for variable data. This is where you would put things like your Postgres data files.

/tmp for temporary files.

/home as usual.

/dev as usual.

/boot as usual

/etc as usual

/usr would be what /usr/local is on most systems. So /usr/bin is binaries not installed by the OS package manager. /usr/etc is where you put config files for packages not installed by the package manager and so on.

Get rid of /usr/local and /sbin.

/media replaces /mnt entirely (or vice versa).

Ditch /opt and /srv

Add /sub for subsystems: container overlays should live here. This would allow the root user (or a docker group, etc.) to view the container file system, chroot into it, or run a container on it.

Then again, nobody gave me a PDP-11 to decide so my vote doesn’t count :)

◧◩
2. theand+Vs[view] [source] 2026-01-04 16:51:46
>>IgorPa+Vp
> Ditch /opt and /srv

If a system is intended to serve data on a network (file shares, databases, websites, remote backups, etc), /srv is where the requisite data for those things should live. I think that's a good idea.

◧◩◪
3. IgorPa+AN[view] [source] 2026-01-04 18:56:14
>>theand+Vs
What is the difference from /var for databases, websites, etc. and /media for backups?
◧◩◪◨
4. theand+QV[view] [source] 2026-01-04 19:50:04
>>IgorPa+AN
/media has nothing to do with backups (though one could backup stuff there):

> This directory contains subdirectories which are used as mount points for removable media such as floppy disks, cdroms and zip disks. https://specifications.freedesktop.org/fhs/latest/media.html

/var is used for websites and databases, but defaults for most packages don't use /srv by default. (I have the feeling that /srv is relatively new.)

[go to top]