Fedora to simplify filesystem hierarchy
Binaries consolidated, but what about shell scripts and the LSB?
Since 1979 (or thereabouts), Linux and UNIX-like operating systems have followed a particular, if arcane, way of organizing files. Now the Fedora Project is proposing a plan that will drastically change the way this filesystem hierarchy stores binary applications... if they can work out the potential kinks.
Specifically, the developers in the Fedora Project are proposing to move all executable files into the /usr/bin directory and their libraries into /usr/lib or /usr/lib64, as needed.
The proposal, made by Red Hat developers Harald Hoyer and Kay Sievers, is an attempt to clean up the mess that was made when the /sbin and /bin directories were first split off from each other, and would essentially pull in every component of the operating system to a single mounted volume.
If all of the binaries and libraries were on such a volume, it would be far simpler to run multiple instances of the operating system on different machines on a network, as well as facilitate the use of snapshots, according to Red Hat's Lennart Poettering, who colorfully summed up a defense of the proposal on the [fedora-devel] mailing list.
"Having all static, distro-specific, sharable OS in a single dir makes snapshots of the OS independently of its state and configuration truly atomic. In a btrfs world doing 5 snapshots of /lib, /lib64, /bin, /sbin and /usr instead of just one is not atomic, and hence racy, and ugly, and boooh!"
I did say "colorfully," didn't I?
To get a feel for the changes, here's a plain-text diagram from Hoyer and Sievers' proposal page:
/ |-- etc |-- usr | |-- bin | |-- lib | `-- lib64 |-- run |-- var |-- bin -> usr/bin |-- sbin -> usr/bin |-- lib -> usr/lib `-- lib64 -> usr/lib64
On the surface, this seems like a pretty good idea, though right off the bat it's clear that this proposed change will run counter to the Filesystem Hierarchy Standard (FHS) that was set up based on the old filesystem hierarchies of Version 7 UNIX and SunOS/Solaris.
Poettering acknowledges this, but challenges the notion of dealing with complexity because it's always been that way.
"Splitting things up complicates stuff. If you want to keep things separate you really need a good reason for that. We should always focus on simplifying things," Poettering wrote. "And merging things into /usr does just that: it drastically simplifies the complexities we have collected over 30+ years of Unix heritage."
Plus, as most people are quick to point out, it's not as if the FHS was rigidly adhered to by all the Linux distributions, either.
But, there is another standard that Fedora could be bucking if they implement this change: the Linux Standard Base (LSB). Filesystem hierarchy is definitely one of the characteristics that fall under the LSB, and this might be affected by Fedora's proposal.
One of the biggest potential hurdles against LSB (and indeed the whole plan) could be /bin/sh. A lot of shell scripts have
#!/bin/sh as their first line (or
#!/bin/bash or what have you). If /bin went away, any script with a call like this inside would break. Some scripts might use env to locate the script interpreter, and since env is already in /usr/bin/env, these won't have problems.
Then there's the convention used to override shell built-ins by calling the full path to the non-built-in version. If the full path is used and the built-in has been relocated, that's going to break, too.
None of these are deal breakers, per se, but it will be something developers want to pay attention to. LSB, for instance, simply requires that when a script executes, the POSIX shell comes up. Symlinks between /usr/bin and wherever the LSB expects something to be could handle this issue. And, indeed, any full-path calls within scripts and executables.
LSB compliance may not be of concern to Fedora, regardless. I am not clear and (with some Linux Foundation sites still down 51 days after the initial attack was announced) I can't check if Fedora is LSB-compliant.
If these changes can be made correctly, with legacy issues in mind, this may be something that we'll see a lot more of in Linux distros. Fedora Project developers are making a strong case for the simplification, which we could likely see in Red Hat Enterprise Linux releases if the experiment is successful.
Read more of Brian Proffitt's Open for Discussion blog and follow the latest IT news at ITworld. Drop Brian a line or follow Brian on Twitter at @TheTechScribe. For the latest IT news, analysis and how-tos, follow ITworld on Twitter and Facebook.