Hacker News new | ask | show | jobs
by jhanschoo 2482 days ago
Interestingly, some distros have undone/are undoing the usr split, fedora around 2012 and Debian still ongoing, see https://wiki.debian.org/UsrMerge and its associated links
4 comments

On NixOS:

    % find /bin /usr
    /bin
    /bin/sh
    /usr
    /usr/bin
    /usr/bin/env
/usr and /bin are only there to provide sh and env for compatibility with shell scripts.
If nothing is in /bin or /usr/bin, where do proggies live? And what does your path look like?
In the Nix store (/nix):

    % which cp
    /run/current-system/sw/bin/cp
Each package has its own path in the nix store:

    % readlink $(which cp)
    /nix/store/l96gc2qb8ysnf5hcq1hp5a3r6x905rf4-coreutils-8.31/bin/cp
The current system and previous systems also live in the store (Nix has atomic upgrades/rollbacks). Each system can be seen as a package with symlinks to binaries, man pages, etc. in the store. More information about the motivation behind Nix's approach can be found in Nix Pill 1:

https://nixos.org/nixos/nix-pills/why-you-should-give-it-a-t...

In NixOS, they are probably under some directory with a random name.

This is the OS where each binary runs with a different path and library path, with only the programs it needs (on the versions it needs) linked there.

Yes, the UsrMove project. It is great leadership to go to the trouble to fix things like this. https://fedoraproject.org/wiki/Features/UsrMove
Why are they going from /bin to /usr/bin instead of /usr/bin to /bin ? I would have thought they could flatten things out.
A goal of Fedora was to have a "snapshottable" /usr that includes as much as possible (all?) of the generic OS files. That is, multiple machines running the same OS can have a shared /usr, and everything machine-specific in the other dirs.

See https://fedoraproject.org/wiki/Features/UsrMove#Why_don.E2.8...

> Myth #11: Instead of merging / into /usr it would make a lot more sense to merge /usr into /.

> Fact: This would make the separation between vendor-supplied OS resources and machine-specific even worse, thus making OS snapshots and network/container sharing of it much harder and non-atomic, and clutter the root file system with a multitude of new directories.

https://www.freedesktop.org/wiki/Software/systemd/TheCaseFor...

Weird edge cases where /usr is mounted, such as a read only network drive