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. p_ing+hq[view] [source] 2026-01-04 16:36:08
>>IgorPa+Vp
> /var for variable data. This is where you would put things like your Postgres data files.

This one never sat well with me. I think of /var as temporary data, something I can lose without much consequence. But never data files. I know it's the default, but still.

/srv I like because it seems like a proper place to separate server-related data, i.e. /srv/wwwroot or similar. But if you like /var, that of course would be the place for this type of data.

◧◩◪
3. holowo+ar[view] [source] 2026-01-04 16:40:16
>>p_ing+hq
No. Temporary data is /var/tmp or /tmp. The difference: /var/tmp should survive a reboot. /tmp might be lost on reboot.

/var is data that needs to be writable (/usr/*, /bin and /lib may be readonly), and that might be important. Like databases, long-term caches, mail and printer queues, etc.

[go to top]