Live data from Hacker News

Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

lists.busybox.net

41–50 of 131 posts

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#41
One outcome of this that drove me nuts back in the day on Debian system was libpcre was installed in /usr and grep was in /bin. This meant perl regex were not supported because the maintainers of Debian didn't want the dependency on /usr from things in /bin, and didn't want to "bloat" / with something as distasteful as libpcre.

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#42
post #15

For all people that think this is still a issue: it is not: * Arch Linux: https://wiki.archlinux.org/index.php/Arch_filesystem_hierarc... * Fedora: https://fedoraproject.org/wiki/Features/UsrMove * Debian: https://wiki.debian.org/UsrMerge * Ubuntu: https://wiki.ubuntu.com/FoundationsTeam/Specs/Quantal/UsrMer... And this is true for quite a long time. I think the last distro that did /usr merge is Debian and this is a…

See https://news.ycombinator.com/item?id=11626765 for two people recently discussing the actualities of this.

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#43
post #5

NixOS is one of the few distros that recognizes and solves this problem: https://nixos.org/nixos/about.html A solution like theirs should become the default. Their transactional, package management too given the number of times my Linux packages got broken by some ridiculous crap. That even a smaller outfit could knock out two problems, one major, shows these bigger distros could be gradually knocking out such issues…

It's a lot more work to retroactively impose a new FS layout on an existing distribution than to come up with a new distribution. If e.g. Ubuntu did this then 1) They'd have to fix all of the packages in the main repository, and then PPAs? 2) Lots of third party software targeted on Ubuntu would break; this would cause a lot of users to want to stay on pre-change versions of Ubuntu, which probably means it would get…

1) A lot of Ubuntu (really Debian's) packages are ancient software that nobody uses. That being said, some packages are not, and there is usually a bit of effort needed to get them to work. OTOH NixOS is still growing, whereas Debian is declining (Ubuntu might pick up the slack, but it's not clear)

2) Most third-party software is indeed broken out-of-the-box on NixOS; but patchelf and fhsuserenv have been developed so that it can run regardless (there's steam, flash, adobe reader... all patched to work. Running a .deb is as hard as specifying all of its dependencies).

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#44
Interesting.

First there was /bin for the things that UNIX provided and /usr/bin for the things that users provided. Part of the system, it lived in /bin, optional? it lives in /usr/bin.

In SunOS 4 (and BSD 4.2 as I recall) the introduction of shared libraries meant you needed a "core" set of binaries for bootstrap and recovery which were not dynamically linked, and so "static" bin or /sbin (and its user equivalent /usr/sbin) came into existence. Same rules for lib. /lib for the system tools, /usr/lib for the optional user supplied stuff.

Then networking joined the mix and often you wanted to mount a common set of things from a network file server (saved on precious disk space) but there were things you wanted locally, that gave use /usr/local/bin and /usr/local/lib. Then in the great BSD SVR3.2 merge AT&T insisted on everything optional being in /opt which had a kind of logic to it. Mostly about making packages that could be installed without risking system permission escapes.

When Linux started getting traction it was kind of silly that they copied the /bin, /sbin, /usr/bin, /usr/sbin stuff since your computer and you are the only "user" (usually) so why not put everything in the same place, (good enough for Windows right?)

File system naming was made more important by the limited permission controls on files, user, group, and other is pretty simplistic. ACLs "fixed" that limitation but the naming conventions were baked into people fingers.

The proliferation of places to keep your binaries lead to amazingly convoluted search paths. And with shared libraries and shared library search paths even more security vulnerabilities.

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#45
post #15

For all people that think this is still a issue: it is not: * Arch Linux: https://wiki.archlinux.org/index.php/Arch_filesystem_hierarc... * Fedora: https://fedoraproject.org/wiki/Features/UsrMove * Debian: https://wiki.debian.org/UsrMerge * Ubuntu: https://wiki.ubuntu.com/FoundationsTeam/Specs/Quantal/UsrMer... And this is true for quite a long time. I think the last distro that did /usr merge is Debian and this is a…

Debian only enforced the fact that if there is a /usr partition, it should be mounted by the initramfs. Moreover, the advanced partition scheme in debian-installer doesn't propose a separate /usr anymore. /usr can still be a separate partition and the split between /usr and /usr/bin still exists unless you install the usrmerge package.

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#47
post #35
post #20

Earlier quoted context omitted.

"Note that Arch follows the systemd FHS convention of symlinking" The Systemd convention? What the fuck? Does Systemd have to touch everything??

The systemd maintainers were one of the first ones to put together a technical proposal and do a lot of the implementation work for the UsrMerge, in a way that was reusable across distros. systemd itself does not depend on being on a UsrMerge'd system, and otherwise, the proposal does not have anything to do with systemd. From https://www.freedesktop.org/wiki/Software/systemd/TheCaseFor... "Note that this page discus…

You are quoting 2013 doco. systemd has (again) changed since then.

As of 2016, the position is that whilst there is still code in some of the program to handle a split /usr, a significant part of the system (in particular Plug and Play device management) now references /usr and depends from it, to the extent that it is already a requirement that /usr be always present: i.e. that it either be on the root volume or be mounted by /init (on the initramfs) before it invokes systemd.

* https://lists.freedesktop.org/archives/systemd-devel/2016-Fe...

Lennart Poettering is indeed now pushing for systemd to impose a similar requirement for /var .

* https://lists.freedesktop.org/archives/systemd-devel/2016-Fe...

* https://lists.freedesktop.org/archives/systemd-devel/2016-Fe...

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#48
The elephant in the room is /opt, /etc/opt, and /var/opt. The System V and filesystem hierarchy specifications say that those locations are, and I quote, "for third party and unbundled applications". Yet some distributions, like for instance Debian or Ubuntu, do not even include them, precluding commercial software vendors from ever delivering software for those operating systems (no, an unbundled application can never be delivered into /usr, because that is vendor's namespace, and an updated version from the vendor might very well bring a production application down).

/opt: application payload

/etc/opt: application's configuration files

/var/opt: application's data.

For applications with more than two configuration or data files, it is a good idea to create /etc/opt/application and /var/opt/application.

If your company is mature enough to understand what system engineering is, and employs dedicated OS and database system engineering departments, /opt/company, /etc/opt/company[/application], and /var/opt/company[/application] become very practical. If this approach is combined with delivering the application payload and configuration management as operating system packages, one only need worry about backing up the data in /var/opt, and that's it.

Re: Understanding the bin, sbin, usr/bin , usr/sbin split (2010)

#50
post #47
post #35

Earlier quoted context omitted.

The systemd maintainers were one of the first ones to put together a technical proposal and do a lot of the implementation work for the UsrMerge, in a way that was reusable across distros. systemd itself does not depend on being on a UsrMerge'd system, and otherwise, the proposal does not have anything to do with systemd. From https://www.freedesktop.org/wiki/Software/systemd/TheCaseFor... "Note that this page discus…

You are quoting 2013 doco. systemd has (again) changed since then. As of 2016, the position is that whilst there is still code in some of the program to handle a split /usr, a significant part of the system (in particular Plug and Play device management) now references /usr and depends from it, to the extent that it is already a requirement that /usr be always present: i.e. that it either be on the root volume or be…

Uh, I don't see how this is related to UsrMerge? You can still have separate /usr/bin and /bin directories, you just need to make sure /usr is mounted and accessible during boot. Requiring /usr be available during boot has long been the case for Linux, even before systemd came along.
Post reply on HN