60 comments

[ 3.3 ms ] story [ 130 ms ] thread
A comment there on LWN, from a Debian developer, adds useful context:

> [T]his is a misleading writeup of a Debian-internal announcement. One specific action that is mostly internal to Debian, which some developers wanted to push ahead with after the bookworm release, has been paused.

> On a merged-/usr system (which will include all Debian 12 and Debian 13 systems, both new installations and upgrades), both /bin/cat and /usr/bin/cat exist, but dpkg is only aware of one of those paths (/bin/cat in this case); in dpkg jargon, the other is said to be an alias. The specific action that should not proceed until further notice is: swapping the path that dpkg considers to be canonical, for example from /bin/cat to /usr/bin/cat.

In particular, the thing that this announcement pauses is only a shuffling of internal metadata. For users, /usr will already look merged either way.

The other bit of context is that this "pause" comes as Debian approaches its next major release, and they expect to unpause it shortly after that.

> For users, /usr will already look merged either way.

What's the motivation of moving /bin to /usr/bin? What is gained? What is lost?

I learned that Solaris is still used commercially. I remember buying "The OpenSolaris Bible" in 2008. Bad timing.
The key missing context is:

Solaris implemented the core part of the /usr merge 15 years ago already, and completed it with the introduction of Solaris 11

But more generally, Sun had a lot of smart people that cared deeply both about the *NIX Desktop and the general user experience. A trip through the PSARC archives[1] will show that things like the /usr merge were carefully considered and reasoned about. Some of those people are still working on Solaris today, although sadly, I'm no longer one of them.

The Linux and BSD folks should take advantage of the good things that Sun left behind and carry them forward wherever possible.

DISCLAIMER: I'm a former Solaris Principal Software Engineer so slightly biased ;)

[1] https://illumos.org/opensolaris/ARChive/PSARC/

Thank you for your service. Solaris felt more considered and reasoned than AIX and microchannel Linux I was learning in ~95 and so helped me learn more.
Ah, it's awesome you worked there. Thank you for context.

My "bad timing" comment was in reference to Sun getting sold in 2010. As an IT focused college kid, I realized there wasn't much value in learning Solaris system administration. That doesn't mean it didn't have amazing things as an operating system!

Only having one key bin/ folder for hard coded paths.

/usr/bin only existed because of fast small mainframe hard drives and slower larger hard drives.

I don't understand why the direction is the way it is thou. getting rid of /usr/ seems like it would make more sense.

I’m also confused why all system supplied data is in /usr instead of say /sys.
Because that potentially allows all distro-supplied files to live under one (eventually read-only) directory.
So, somebody imagined/wished that all distros will switch to /usr/* and them will ship / part ? :> I don't think so. Totally wrong direction.

And init binary in /usr is complete braindeadness...

Also MS behind anything means they are trying to get rid of your options, eg by complicating things into "enterprise level" and keep pushing windows as userware.

But there is other possibility: minimal root that is easy to manage, switch, etc. etc. and rest of the system :)

> But there is other possibility: minimal root that is easy to manage, switch, etc. etc. and rest of the system :)

Yeah, libostree ("git for operating systems binaries") benefits from merging /usr. It might even be a requirement to have merged /usr to be able to use it.

https://en.m.wikipedia.org/wiki/OSTree

> I’m also confused why all system supplied data is in /usr instead of say /sys.

Wasn't that basically a historical accident? IIRC in very early UNIX, "/usr" used to be like the modern "/home", but they happened to have a big disk for that mount and started putting system files there.

(comment deleted)
The motivation is because systemd is compelling them to change it. Systemd decides how Debian may operate, and decides how users, processes, and files work, not the Debian Technical Committee.
It explicitly says in that link that systemd doesn’t need it and it’s beneficial to non-systemd distros.
That was then, and systemd is mandating it this year.
FDO and systemd(et al) breaking things for everyone else as usual.
Pray for all those scripts out there that assume /bin/sh or /bin/bash exists. Sounds like they only have a couple more years of error-free life
Won't there be a symlink to keep those working?
There is no intent to remove the /bin symlink.
ah ok. well then whats the point of this
Yes, this is why its a controversial thing.
usr merge has been a topic for more than a decade, you can easily find articles on the subject in general, and for Debian in particular.
There's a bunch of compatibly reasons why this helps maintain portability across Unixes. But my favorite reasons for this are how much nicer it makes managing & switching between Linux images:

> The merged directory /usr, containing almost the entire vendor-supplied operating system resources, offers us a number of new features regarding OS snapshotting and options for enterprise environments for network sharing or running multiple guests on one host. https://www.freedesktop.org/wiki/Software/systemd/TheCaseFor...

And indeed, with systemd one can boot a whole system from practically any unpopulated root mount with a /usr image mounted on it.

Want to OS upgrade? Swap /usr & try it. /etc and /home and the other directories might have instance specific content, but the OS image is nicely set away & swappable in /usr. And one should be able to keep the same "instance" while swapping the image. It containerizes the OS image, separate-ish from the OS instancd, whereas before the OS was somewhat amorphously sprawled across multiple top level directories. It's a huge boon to manageability.

Well, you can only symlink one direction and they want to merge.
Think of all the greenhouse gas emissions that will be saved when everyone collectively removes an entry from their $PATH…
Too bad.

Will it at least lead to the removal of /sbin and /lib?

There are still many paths hardcoded into /sbin. /lib is expected to stay since the LDSO path for dynamic linking points there, removing it is not possible without breaking the ABI.
> There are still many paths hardcoded into /sbin

This is fixable: it only truly matters for /sbin/init, but it's nothing than can be fixed in a minute with the right kernel cmdline.

For the rest, a regex could replace /sbin by /usr/sbin in the package files

> /lib is expected to stay since the LDSO path for dynamic linking points there, removing it is not possible without breaking the ABI.

Maybe it's time to do that too? Android does just fine without /lib. Only the linker needs that, and changing the path to ld-linux should just require a kernel tweak.

But breaking the ABI could also be the opportunity to bring in android improvements, like the linkerconfig or namespaces!

Not sure if trolling...
I sincerely mean all of that. I don't see why we can't take advantage of android advances to facilitate having specific dynamic libraries to specific programs.

If you disagree, please explain your point because I think google did some genuine improvements for dynamic libraries.

The kernel has no idea about /lib (unless you're using the in-kernel firmware loader, which you really shouldn't be) - the rtdl path is present in every ELF object that depends on it, so the "kernel tweak" would be hacking the ELF loader to rewrite /lib (or /lib64) to something else.
I mean, we don't have to hack the elf loader if we just rewrite every elf binary using patchelf: https://github.com/NixOS/patchelf

The parent commenter is already suggesting "just run a regex", so it seems like a trivial extension to their simple solution to "just run patchelf on every binary on your system"

> unless you're using the in-kernel firmware loader, which you really shouldn't be

Why not? What options are there and what are the pros and cons?

The in-kernel loader can't defer loading if, say, a module is loaded before the firmware is available. Instead it can be handled in userland - the kernel generates a request when it wants firmware, and the userland hotplug agent can satisfy that later
This is fixable and has already been fixed: Install NixOS or guix to live in a world where neither "/sbin" nor "/lib" exists.

NixOS has also reduced "/usr/bin" to containing only a "/usr/bin/env" symlink and "/bin" down to just "/bin/sh".

So, why not apply the same philosophy to any other linux distro? Well, debian or ubuntu or whatever has plenty of user-written bash scripts, aliases, etc that are _not_ managed by the package manager, and would promptly explode with that change, causing people to switch distros, never upgrade, and probably write angry articles online.

There's plenty of sites that let you download and install a deb which isn't in debian's packages (i.e. chrome, zoom, slack) which would also all break. There's third-party package managers, like steam (which downloads and runs executables) which would also break.

Of course they won't do that, they don't want to piss off their users for minimal benefit.

NixOS has just accepted that "download zoom-installer.sh" or whatever does not and will never work on their distro, and people deal with it. Other distros are unlikely to make that choice.

Android has ensured those also never work by limiting people to just the app store. In a sense, ubuntu + snaps is trying to do that for their distro, but it's neither been that well received, nor making quick progress.

They too will be links to /usr.
/bin/sh is mandated by posix, so there’ll be a link to usr.

/bin/bash will be as well because /bin itself is a symlink to /usr/bin.

Though that’s a very dumb shebang to use and you should be ashamed: lots of systems don’t have it, or have an absolutely ancient system bash. By hard coding this you’re just making your scripts worse.

nah I always use /bin/bash because I use bash features and I don't want to use some crappy dash or fish or whatever default shell is set on the system
That you’re using bash is an other problem which you also have.

But the issue I’m talking about is using the specific path /bin/bash, as that just reduces compatibility compared to going through env.

no I like bash and all the systems I care about have /bin/bash so I don't care

the /usr/bin/env bash thing always just seemed like pointless cargo culting to me. never had this problem

I think it is fair not to care if it isn't making a difference for you.

“/usr/bin/env bash” will keep the shebang working between a Linux and FreeBSD (and probably other *NIX) machines. This bit me at one point, and it just became a habit since.

Bash (if installed) is in /usr/local/bin there. Other interpreters often are too.

Also /usr/bin/env bash is required on NixOS and Guix, neither of which have /bin/bash.
/usr/bin/env does not exist on Android. shebangs are inherently not portable because they can't be used to find a binary using $PATH.
Man, I've tried to write POSIX-compatible scripts for a long time - twice as long as I'd probably have taken using bash features (using Python I'd probably have taken 1/10th of the time and it'd be way more maintainable now).
This is being done in the name of Solaris compatibility (why?) so you don't even get to use POSIX shell since it isn't in /bin/sh on that OS.
Python is in no way better maintainable than bash. If you'd used Python, most of your scripts would be broken right now. With bash, that just doesn't happen (to that extent).
>/bin/sh is mandated by posix

Where? POSIX says:

    Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH, ensuring that the returned pathname is an absolute pathname and not a shell built-in.
Sigh. I guess this means I can no longer keep my root image on a 1.44MB floppy and a separate /usr on an iomega Zip drive.
That remains a supported configuration, you just need an initramfs that mounts /usr before transitioning into the real /.
nope. no room for initramfs on those kind of media.
If you're already fitting a kernel on a 1.44MB floppy, you've got enough space to append a tiny cpio with a static binary that makes a few syscalls.
https://wiki.debian.org/UsrMerge

I don't get the proposed benefits?

There are no benefit.

It's the systemd gangs don't want to support the standard directory hierarchy and force every distro to migrate.

Debian is among the last to do these changes.

Yep it's all systemd bunk. It reduces flexibility and promotes lock-in of systemd at the expense of everything else. It smells like a bunch of BS because it is.
(comment deleted)
Big note:

/usr doesn't mean "user". It means "User Software Resources". I learned this from a good friend whose 70+ years old, and worked with Ritchie. My friend is also cited in K&R C.

/usr/bin and /usr/sbin should have always been the place to put "user software resources". And we're finally getting back to what it was originally.

/usr was the user directory before Thompson and Ritchie bought a new disk and mounted it as /home. The crazy names are really just a historical accident, not some smart acronyms.