News for hackers. Stuff that matters.
Re:Debian considers merging /usr by jeena on Tuesday November 22, 2016 @02:16AM (#13012272)
So what are the arguments actually?

A couple of days ago I was reading some POSIX book from 1991 and there the layout of /bin /lib /shared /usr/name/bin /usr/name/lib /usr/name/shared and so on was much more logical than what we have now which is just weird as far as I can see because I don't understand it.

Re:Debian considers merging /usr by hawski on Tuesday November 22, 2016 @04:36AM (#13012887)
The best explanation goes from Rob Landley:

http://lists.busybox.net/pipermail/busybox/2010-December/074...

Some fragment:

> When the operating system grew too big to fit on the first RK05 disk pack (their root filesystem) they let it leak into the second one, which is where all the user home directories lived (which is why the mount was called /usr). They replicated all the OS directories under there (/bin, /sbin, /lib, /tmp...) and wrote files to those new directories because their original disk was out of space. When they got a third disk, they mounted it on /home and relocated all the user directories to there so the OS could consume all the space on both disks and grow to THREE WHOLE MEGABYTES (ooooh!).

> Of course they made rules about "when the system first boots, it has to come up enough to be able to mount the second disk on /usr, so don't put things like the mount command /usr/bin or we'll have a chicken and egg problem bringing the system up." Fairly straightforward. Also fairly specific to v6 unix of 35 years ago.

It was discussed here few times:

https://news.ycombinator.com/item?id=3519952

https://news.ycombinator.com/item?id=9554134

Re:Debian considers merging /usr by torrent-of-ions on Tuesday November 22, 2016 @05:44AM (#13013162)
Considering this, I wonder why the /usr would be kept at all, assuming we keep /home. Why not just have /bin etc. since we can generally fit everything there these days?
Re:Debian considers merging /usr by vbernat on Tuesday November 22, 2016 @05:52AM (#13013188)
/usr can be made read-only. It is more convenient to have everything in /usr than to have /bin, /sbin, /lib, etc.
Re:Debian considers merging /usr by vbezhenar on Tuesday November 22, 2016 @07:24AM (#13013562)
I would argue, that it's better to mount / as RO and remount /var, /home as RW.
Re:Debian considers merging /usr by lomnakkus on Tuesday November 22, 2016 @08:12AM (#13013840)
It's not just amount mounting as RO. It could physically be RO (or use e.g. dm-verity or similar)... which would be quite inconvenient if you wanted to add-site-specific directories under /. (Or if a distro wants to add a directory, or whatever.).

Also, wouldn't mounting /var, /home etc. RW on top of a RO-mounted / require that they were actually on different file systems? I don't think you can have a RW bind mount on a RO-mounted file system. (Haven't tried it, though.)

Re:Debian considers merging /usr by thinkmassive on Tuesday November 22, 2016 @09:02PM (#13019363)
I recently joined a project that uses OSTree to deliver atomic OS updates (read-only), and flatpak for applications. I'm still learning the implementation details, so I might not be able to provide much detail yet, but it seems like an interesting approach to reliably deliver Linux to non-technical users.

https://endlessm.com/for-developers/

Re:Debian considers merging /usr by hawski on Tuesday November 22, 2016 @08:27AM (#13013926)
> It's not just amount mounting as RO. It could physically be RO (or use e.g. dm-verity or similar)... which would be quite inconvenient if you wanted to add-site-specific directories under /. (Or if a distro wants to add a directory, or whatever.).

You could use two partition update scheme as ChromeOS. I am working on Linux distribution that have rootfs as a squashfs image and I want to have as painless updates as on ChromeOS.

> Also, wouldn't mounting /var, /home etc. RW on top of a RO-mounted / require that they were actually on different file systems? I don't think you can have a RW bind mount on a RO-mounted file system. (Haven't tried it, though.)

You can mount RW fs on RO fs. Distributions on Live-CDs do it all the time.

Re:Debian considers merging /usr by lomnakkus on Tuesday November 22, 2016 @09:44AM (#13014423)
> You can mount RW fs on RO fs. Distributions on Live-CDs do it all the time.

Right, but that's with OverlayFS and such, right? (I.e. not just straight bind mounts.)

Seems awfully complicated to solve what essentially should be a non-problem... (I'm aware OverlayFS has other uses, but in this instance it seems like overkill.)

EDIT: I'll just note, I did say "separate filesystem" (i.e. non-bind), but I guess it might have been easy to miss.

Re:Debian considers merging /usr by hawski on Tuesday November 22, 2016 @10:07AM (#13014592)
> Right, but that's with OverlayFS and such, right? (I.e. not just straight bind mounts.)

Most probably yes, but there are probably distributions using ro rootfs + specific mounts. I think that in many cases embedded devices would use such a scheme instead of OverlayFS.

EDIT: But you probably have to mount workdir and upperdir somewhere over this ro rootfs for OverlayFS to work.

> EDIT: I'll just note, I did say "separate filesystem" (i.e. non-bind), but I guess it might have been easy to miss.

I was hoping that you could read between the lines also :) I mentioned my WIP distribution. I have mounted:

- squashfs ro on /

- ext4 rw on /mnt/rw

- /mnt/rw/var bind on /var

- /mnt/rw/home bind on /home

Re:Debian considers merging /usr by lomnakkus on Wednesday November 23, 2016 @07:15PM (#13026893)
> > EDIT: I'll just note, I did say "separate filesystem" (i.e. non-bind), but I guess it might have been easy to miss. > I was hoping that you could read between the lines also :) I mentioned my WIP distribution. I have mounted:

Oooh, burn! :) I honestly didn't see any relevant mention of the WIP-distro you're talking about... but now that you mention it I had a look back. "I am working on Linux distribution" (etc.).

> I have mounted:[snip]

So... separate file systems.

Re:Debian considers merging /usr by digi_owl on Tuesday November 22, 2016 @07:43AM (#13013658)
Because initramfs effectively already is /.
Re:Debian considers merging /usr by GFK_of_xmaspast on Tuesday November 22, 2016 @08:40AM (#13014001)
> Why not just have /bin etc. ....

Surely there's a lot of horrible software out there that Makes Assumptions.

Re:Debian considers merging /usr by VLM on Tuesday November 22, 2016 @09:28AM (#13014306)
There was a brief revival during the era of NFS mounting /usr, back in the era when /usr/doc could be a significant fraction of a filesystem and shipping whatever-doc packages made sense because it takes a long time to download at 14.4. I actually had deployed production systems with /usr/doc and some other stuff NFS mounted.

It doesn't make much sense anymore but before the turn of the century a meg of doc files might cost you a buck per machine, which might add up to a lot of money given a lot of machines and a lot of software... And usually you don't need /usr/doc but when you do need it you REALLY need it and don't mind if its a little slower to access via NFS than on a local drive.

In the same old days, some brave people exported /usr/src. Oh and X window fonts too.

Re:Debian considers merging /usr by digi_owl on Sunday November 27, 2016 @05:31AM (#13048586)
As an aside, Landley's focus have been for quite some time on the mobile/embedded uses of Linux.

The Linux "community" have a bad habit of turning solutions for special scenarios into generic ones by hook or by crook.

Never mind that this was addressed to the busybox mailing list, a project aimed at reimplmenting the unix coreutils as a single static binary.

Re:Debian considers merging /usr by hinkley on Tuesday November 22, 2016 @12:32PM (#13015694)
Situations not unlike this repeated during the initial growth phase of Linux as well. You had a bunch of undergrads and recent grads upgrading their system one piece at a time, or even taking castoffs from friends and family. Typically you had one good drive that wasn't quite big enough for all the junk you thought you needed.

You also had people who would build a Linux box out of any old hardware they had left over. That's how I ended up with my first firewall.

Re:Debian considers merging /usr by notalaser on Tuesday November 22, 2016 @04:52AM (#13012951)
Rusty Russell summarized this nicely a few years ago: http://rusty.ozlabs.org/?p=236 (careful, sarcasm follows).

The merge does involve some loss of flexibility (for instance, "traditionally", you could use the programs in /bin to recover a failing system), but there are fewer and fewer users relying on it. It also involves departing from the FHS, but Debian already does that (e.g. they use /lib/<GNU triplet> rather than /lib{32,64}). I haven't heard any super convincing arguments from either side; normally, I'd go by the "not broken -- nothing to fix" route, but it's also hard to poke holes in the "this additional complexity isn't needed anymore" line of reasoning. Plus, like most arguments that involve tradition, it's pretty hard to tell robustness from cruft.

Whether this change can be done cleanly and without breaking users' systems is an entirely different story and past experience has shown that moderation is a far better friend than optimism. It's particularly difficult to migrate existing installation to this scheme (e.g. Arch failed quite badly, as I remember from those particular two afternoons, thanks a lot Arch!, and it didn't go more smoothly for others, either), but Debian can benefit from the lessons learned by more up-to-da^H^H^H^H fast-moving distributions and do things better.

Re:Debian considers merging /usr by marios on Tuesday November 22, 2016 @06:35AM (#13013343)
Using programs in /bin to recover a failing system is a lost cause on Linux.

Pretty much every binary in /bin in Debian (the OS I have at hand to check) links to a library of some sort. Therefore, if my /lib is hosed, I can't use any of the tools in /bin (I've had this happen, and I couldn't even use "ls". This would not have occured if those binaries were statically linked (I believe OpenBSD does that for /bin and /sbin).

Re:Debian considers merging /usr by wyldfire on Tuesday November 22, 2016 @09:51AM (#13014477)
> Using programs in /bin to recover a failing system is a lost cause on Linux.

Agreed. If distros wanted to try and champion the cause for a statically linked subset of critical coreutils, they could still do it in the merged tree. The only thing the separation would facilitate would be separate mount points or physical devices.

Re:Debian considers merging /usr by notalaser on Tuesday November 22, 2016 @11:19AM (#13015107)
The point wasn't (only) that they were statically linked, but also that /bin and /lib were separate partitions (or even separate disks) and could be mounted read-only, could be used from tiny ramdisks etc.. In any case, though, I agree that even without the merge, it wouldn't be doable on any modern Linux system.

There are examples for both approaches. OpenBSD keeps /bin minimal and statically-linked, and it works. Solaris merged /bin and /usr/bin a long time ago, and -- unsurprisingly -- that works as well.

Frankly, as long as it doesn't bork my Debian machine when I move from Jessie to whatever Debian 9 is going to be called, they can merge all they want. At this point, seeing how many Linux systems are doing the merger, it's probably a good idea to do it, too. Packages whose developers give a flying fsck about portability (fewer and fewer nowadays because lockdown and unportability were bad only when Microsoft were doing it) already deal with both usr-merged and usr-unmerged systems (hardly rocket science in most cases), and the maintainers of packages whose developers don't give a flying fsck about portability and only develop for Linux can hope that four years from now, everyone will have merged, especially now that Debian is doing it too.

Re:Debian considers merging /usr by JdeBP on Tuesday November 22, 2016 @11:18AM (#13015099)
It's a trifle hard to align the idea of what is supposedly "traditional" with the /usr merger that was done in Solaris 2 in the 1990s and AT&T UNIX System 5 Release 4 in the late 1980s. (-:
Re:Debian considers merging /usr by notalaser on Tuesday November 22, 2016 @02:30PM (#13016794)
Hence the " ;-). Indeed, the heritage isn't nearly as unbroken as its proponents think. I think it's perceived as so traditional because most of the free Unices (and, for a long time, Linux) did it, and some of them still do. FreeBSD started dynamically linking things in /bin much later, around 2004 IIRC, but I think OpenBSD and NetBSD still ship only static binaries there.

I think the fact that I can't even remember the last time I cared how things in /bin are linked is good proof of how important this "tradition" is, at least for me...

Re:Debian considers merging /usr by digi_owl on Sunday November 27, 2016 @05:34AM (#13048595)
Lovely "con" side representation there...
Re:Debian considers merging /usr by pavanky on Tuesday November 22, 2016 @03:06AM (#13012486)
Re:Debian considers merging /usr by rwmj on Tuesday November 22, 2016 @04:04AM (#13012754)
That Fedora one is very biased, written by the advocates for UsrMove. A better way would be to search on Google for:

      site:bugzilla.redhat.com "UsrMove"
which produces page after page of bug reports.

The reality is it caused lots of breakage throughout the system which required many man-hours to fix over years.

The gain from it is pretty minimal. And there are still bugs everywhere, for example these two commands ought to the do the same thing, but in fact the first breaks and the second works:

    # dnf install /sbin/ifconfig
    # dnf install /usr/sbin/ifconfig
(It's something to do with either RPM or DNF not "knowing" that the two paths point to the same file, even though /sbin is a symlink to /usr/sbin. Various attempts have been made to fix this but obviously we're not there yet).

The good thing from Debian's point of view is that Fedora and Arch already fixed many of the bugs, so things will probably be smoother for Debian.

Re:Debian considers merging /usr by anexprogrammer on Tuesday November 22, 2016 @07:37AM (#13013619)
Way back when the world was in black and white, DEC PDP 11 RK05 disk packs could only hold 1.5 Meg.

/bin and /usr/bin were on different drives. Now all those weird splits and choices make sense.

Fuller explanation here: http://lists.busybox.net/pipermail/busybox/2010-December/074...

Re:Debian considers merging /usr by kbenson on Tuesday November 22, 2016 @02:49AM (#13012405)
Originally, disks weren't that big, and / was meant to house what was required to boot and run a minimal system, and additional software was installed in /usr, often on one or more different disks. There's some additional benefit to running a separate /usr partition, which is that you can mount / as read-only for some additional security (but not much, IMO).
Re:Debian considers merging /usr by rodgerd on Tuesday November 22, 2016 @03:17AM (#13012545)
Originally /usr was the user data. Then the disks got full and someone stuck binaries into it. Then people moved to /u, /usr2, /home, or whatever your ix variant (or site) wanted for user data.

The ix file system standards are the retcons of a bunch of hacks made by sysadmins trying to stave off users with pitchforks. Philosophy my arse.

Re:Debian considers merging /usr by B1FF_PSUVM on Tuesday November 22, 2016 @04:58AM (#13012978)
Eh, the seminal BOfH story: "AH! - You haven't got any files"

(Here: http://bofh.bjash.com/bofh/genesis2.html )

Re:Debian considers merging /usr by marcosdumay on Tuesday November 22, 2016 @09:57AM (#13014525)
Added to any historical reason, the separation between the / dirs and /usr dirs made Unix networks manageable. You could have a minimal setup on every machine, and just mount /usr (and /var) from a centralized server.

With this change, this management format is gone. What is not a big loss nowadays.

Re:Debian considers merging /usr by digi_owl on Tuesday November 22, 2016 @02:28AM (#13012318)
As best i can tell, thanks to systemd requirements etc initramfs has become bloated to the point that /sbin is largely redundant.
Re:Debian considers merging /usr by icebraining on Tuesday November 22, 2016 @02:46AM (#13012394)
The systemd devs claim it has nothing to do with it, but with a bunch of other software that expects /usr to be mounted at boot time: https://wiki.freedesktop.org/www/Software/systemd/separate-u...
Re:Debian considers merging /usr by groovy2shoes on Tuesday November 22, 2016 @03:14AM (#13012533)
That's why you mount /usr at boot time... in your initscript...
Re:Debian considers merging /usr by kbenson on Tuesday November 22, 2016 @02:52AM (#13012415)
Additionally, I think a good argument could be made that anything that systemd requires to boot should be in sbin, not specifically because systemd requires it, but because it's required or useful for the boot process, as systemd has illustrated, and thus should not be relegated to /usr (depending on where you draw the line between useful and required and whether useful is sufficient to be included in /).