|
|
Subscribe / Log in / New account

Alpine Linux plans /usr merge

The Alpine Linux project has announced plans to change its base filesystem hierarchy:

In the future, /lib, /bin, and /sbin will be symbolic links to their /usr counterparts, and every package shall be installed under the /usr paths. For now, /usr/bin and /usr/sbin will continue to be independent paths, but that might change if the Filesystem Hierarchy Standard (FHS) gets updated.

The merge will take place in the upcoming Alpine 3.23 release planned for November; non-merged systems will be considered unsupported when 3.22 is at its end of life in May 2027.



to post comments

New FHS release?

Posted Oct 1, 2025 20:25 UTC (Wed) by mb (subscriber, #50428) [Link] (1 responses)

>if the Filesystem Hierarchy Standard (FHS) gets updated

Is it actually still alife?
The last release was over 10 years ago.
Quite some things changed during this time.

New FHS release?

Posted Oct 1, 2025 20:37 UTC (Wed) by knewt (subscriber, #32124) [Link]

As it happens, there was some recent news on the matter šŸ˜€...

https://lwn.net/Articles/1032947/ # Finding a successor to the FHS [August 15, 2025]

Why split bin + sbin?

Posted Oct 2, 2025 9:56 UTC (Thu) by bof (subscriber, #110741) [Link] (20 responses)

I totally get the usr merge (although it's weird that it was not about eliminating /usr altogether) - but why would we want to merge bin + sbin? I find it quite convenient to not bother users with TAB completion of stuff that just won't work for them.

Why split bin + sbin?

Posted Oct 2, 2025 10:32 UTC (Thu) by intelfx (subscriber, #130118) [Link] (8 responses)

> I find it quite convenient to not bother users with TAB completion of stuff that just won't work for them.

Because there’s just not a well-defined boundary. Any command that ā€œwon’t workā€ for a regular user can at least be invoked for `--help` by a regular user. Or maybe there’s a more granular site/specific permission setup in place than envisioned by those who made the split.

It’s the same problem as with the ā€œ/ vs /usrā€ split vs. initramfs: yes, there was this idea that tools in / can be used to mount a /usr with the rest of the tools, but it just doesn’t scale: what if my complicated setup requires a tool that was never envisioned to be used in early userspace, and is thus built with prefix=/usr?

Why split bin + sbin?

Posted Oct 2, 2025 11:39 UTC (Thu) by joib (subscriber, #8541) [Link] (2 responses)

As a tacit admission of this, one can note that most(?) Linux distros out of the box add /sbin and /usr/sbin to the PATH also for normal users.

(Also makes using sudo easier.)

Why split bin + sbin?

Posted Oct 2, 2025 12:07 UTC (Thu) by aragilar (subscriber, #122569) [Link] (1 responses)

At least the Debian-derivatives don't by default (which for interactive systems I expect to be a majority by number of system, if not also by individual variants).

Why split bin + sbin?

Posted Oct 2, 2025 12:19 UTC (Thu) by joib (subscriber, #8541) [Link]

If you count Ubuntu among the Debian derivatives, at least that one does.

Why split bin + sbin?

Posted Oct 2, 2025 13:52 UTC (Thu) by josh (subscriber, #17465) [Link] (4 responses)

In particular, in a world in which most users use sudo to invoke system commands, it's nice if they can run --help or in some cases other functionality of the command *without* needing to be root, and then add sudo if it turns out they need root.

Many commands may also make sense to invoke from a new user namespace in which the user has privileges.

From a quick look at the commands in /usr/sbin on my system, the first few easy examples I found:

Various commands to make, adjust, resize, or otherwise operate on filesystems or disks, which users can run on filesystem images.

tarcat, should clearly be in bin.

ldconfig, which users can run on their own chroots.

filefrag, which users can run without privileges.

nbd-client, which has unprivileged operations like --list.

logsave, which should work fine as a user.

service, which has unprivileged or partially-privileged operations.

ifconfig, which works fine as a user to read configuration.

getcap, which works fine as a user.

Why split bin + sbin?

Posted Oct 2, 2025 16:10 UTC (Thu) by farnz (subscriber, #17727) [Link] (2 responses)

It's also worth bearing the history of the split in mind; originally, there was only /bin for binaries, and they were statically linked by definition. /usr/bin got added when an early system ran out of space on the disk used for /, and they had to split across the "user" disk (mounted as /usr, used like today's /home) and the "system" disk.

Similar applies with /sbin; it was created when shared libraries came to be, as a place for statically linked binaries that would run even if /lib or /usr/lib was unreadable, so that you could repair the system to the point where you can use dynamically linked binaries from /bin or /usr/bin. The only reason that it's been used as a split between "system" and "user" commands is that "system" commands often were statically linked, historically, so that they'd run even if you had a damaged system (e.g. because you'd put /lib on a different disk, and the driver for it was on /, or because /usr was network mounted).

Nowadays, the problems that the /bin split from /sbin was meant to solve are solved by the initramfs instead - if your system is so broken you need rescue tools to get it going, you use the initramfs tools, not the tools in / - indeed, you may not even be able to mount / without the initramfs tools, whereas the split comes from the days when the kernel mounted / as the very first thing it did, without any form of RAM FS.

Why split bin + sbin?

Posted Oct 2, 2025 18:10 UTC (Thu) by lkundrak (subscriber, #43452) [Link]

Yeah perhaps worth also mentioning, to complete the historical picture, that stuff (like init or mount) was moved over to /sbin from /etc.

Why split bin + sbin?

Posted Oct 19, 2025 4:40 UTC (Sun) by raven667 (subscriber, #5198) [Link]

I know I'm coming in late, catching up on messages, but I couldn't let this pass by without thanking you for keeping the light of history alive. I started in this industry long after these events, and like many others came up my own theories why things were the way they were and inherited some (incomplete, incorrect) lore, from people who were also a generation late, so actually understanding the real issues facing early Unix developers and not the "just so" stories that developed into industry lore, is incredibly useful as we now are the inheritors and designers of these computer systems for our needs and the future. It's always good to remember that the original designers were just people solving the problems in front of them, like running out of disk, and weren't impossible geniuses performing 7-dimensional chess, and that people updating the designs today are the same.

Why split bin + sbin?

Posted Oct 2, 2025 16:18 UTC (Thu) by mb (subscriber, #50428) [Link]

>In particular, in a world in which most users use sudo to invoke system commands

This, and also run0 doesn't work, if the invoked binary is not in the user's $PATH, because it checks that before elevating privileges.

Why split bin + sbin?

Posted Oct 2, 2025 12:26 UTC (Thu) by joib (subscriber, #8541) [Link] (5 responses)

> although it's weird that it was not about eliminating /usr altogether

There's probably too much stuff out there that has various /usr containing paths hardcoded to be worth the effort to get rid of /usr (POSIX might even mandate the presence of /usr/bin/env?).

(Another motivation put forth that I read somewhere (Lennart Poettering's blog maybe?) is that it makes it possible to have /usr as some kind of read-only atomic snapshot. Not perhaps the reality for most installations today, but maybe we're slowly going towards at least making that possible without excessive heroics.)

Why split bin + sbin?

Posted Oct 3, 2025 8:49 UTC (Fri) by jengelh (guest, #33263) [Link]

>Another motivation [..] I read somewhere [..is] to have /usr as some kind of read-only atomic snapshot.

More precisely, admins want to be able to reset either config or programs (or both), which means the two need to live in different subvolumes. That alone does not mandate any particular layout, though. Your initramfs could well do either of:

mount @config_subvol /realroot/etc
for i in @prog_subvol/*; do
j=${i##*/}
mount @prog_subvol/$j /realroot/$j
ln -s /$j /realroot/usr/$j
done

-or-

mount @config_subvol /realroot/etc
mount @prog_subvol /realroot/usr
for i in bin lib sbin; do ln -s usr/$i /realroot/$i; done

Why split bin + sbin?

Posted Oct 3, 2025 9:51 UTC (Fri) by farnz (subscriber, #17727) [Link] (3 responses)

The best motivation I've seen for /usr (rather than directly in /) is that it enables a setup where you do not mount anything over persistent filesystem volumes, and you swap persistent volumes for an upgrade.

That's great for image-based distributions; I can upgrade by downloading and writing a new version of /usr to my workstation, and then swap on reboot. But for this to be possible transparently to non-admin users (ones who don't install software to /, but instead use something like Flatpak to install it to their own home directory), you need non-image distros to agree that everything lives in /usr, too.

Why split bin + sbin?

Posted Oct 6, 2025 21:23 UTC (Mon) by ballombe (subscriber, #9523) [Link] (2 responses)

This will lead to ossification of the system.

Why split bin + sbin?

Posted Oct 7, 2025 5:18 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link]

What do you mean?

Why split bin + sbin?

Posted Oct 7, 2025 9:14 UTC (Tue) by farnz (subscriber, #17727) [Link]

How?

If I don't want an image based system, I can continue to run with a writeable /usr and change the contents freely, just like I can today. If I want an image based system, I can build my own images, or I can download other people's images.

why keep /usr

Posted Oct 2, 2025 13:25 UTC (Thu) by smcv (subscriber, #53363) [Link] (4 responses)

> weird that it was not about eliminating /usr altogether

This was a frequently asked question during Debian's implementation of the same /usr merge. The subdirectories of /usr, together with the subdirectories of the root that get merged into /usr by the /usr merge, have more in common with each other than they do with any other subdirectory of the root: they're all "owned" by the packaging system (.deb or .rpm or equivalent), they're all read-only during normal system operation (only modified when packages are added, removed or changed), they can reasonably be immutable on an image-based system, in an ideal world they're a deterministic product of the list of packages that have been installed, it is plausible to share them between identically set up machines using NFS or similar, and so on. (Unlike, for example, /etc, which contains the hostname and machine ID so is specific to a single machine, even if there is no local/sysadmin configuration that differs.)

If you're going to do anything like sharing a /usr between containers, or NFS-sharing /usr, then it's easier to do that with 1 mount point than with n >= 3 mount points (/lib, /share, /bin, maybe /sbin, maybe /games, maybe /lib64, etc.).

Debian GNU/Hurd did try the opposite of the /usr merge (normalizing to /bin, /lib, etc. with a compatibility symlink /usr -> /) a while ago, but with hindsight that approach doesn't have the desirable property that all the "/usr-like" directories are kept together, so the /usr merge was the better way round to do it.

why keep /usr

Posted Oct 6, 2025 17:31 UTC (Mon) by NYKevin (subscriber, #129325) [Link] (3 responses)

There is /usr/local, which is emphatically not owned by the packaging system. But it's arguably the exception that proves the rule. "Everyone" knows that you're supposed to install weird (non-managed) stuff into /usr/local or /opt, not any other part of /usr.

It would almost be worth trying to unify /usr/local with /opt, but unfortunately I think they are slightly too different for that to work. The subdirectories of /usr/local are usually very similar to the /usr subdirectories, but /opt has no structure, and it is probably too late to try and impose the former on the latter.

why keep /usr

Posted Oct 6, 2025 18:50 UTC (Mon) by quotemstr (subscriber, #45331) [Link] (2 responses)

/usr/local and /opt get used differently. On one hand, /usr/local is a miniature FS of its own, with include/, lib/, bin/, and so on. On the other hand, /opt is usually used by making a top-level program-specific directory, e.g. /opt/inicorp/, and then putting whatever under that. It'd be weird to merge them.

why keep /usr

Posted Oct 6, 2025 21:41 UTC (Mon) by NekkoDroid (guest, #176638) [Link] (1 responses)

I think the current plan for the next version (or at least what is currently being discussed) is to have `/usr/local` be a symlink to `/opt/local/`. Mostly so that `/usr/` can actually be RO and you can still have your selfcontained local installs, just in `/opt/`, which somewhat makes a bit more sense IMO.

why keep /usr

Posted Oct 7, 2025 13:57 UTC (Tue) by smcv (subscriber, #53363) [Link]

That makes sense. I believe Fedora's image-based variants use a symlink /usr/local -> /var/usrlocal, which is the same general idea.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds