Why not the other way round?
Why not the other way round?
Posted Jan 10, 2016 10:57 UTC (Sun) by Yenya (subscriber, #52846)Parent article: Preparing for a merged /usr in Debian
Posted Jan 10, 2016 14:08 UTC (Sun)
by raven667 (subscriber, #5198)
[Link] (5 responses)
Posted Jan 10, 2016 17:48 UTC (Sun)
by bronson (subscriber, #4806)
[Link]
Too funny. You can never go home.
Posted Jan 11, 2016 12:56 UTC (Mon)
by Yenya (subscriber, #52846)
[Link] (3 responses)
Of course. Now why this is a problem? Why it is necessary to add another level of indirection to the "dummy" root filesystem instead of having the root filesystem with the binaries, libraries, data files, etc., and have _other_ types of data as mountpoints? After all, this is what has been done to the /var/run directory as well. And we need the binaries, ld.so, etc. in the early stages of boot, so it does not make sense (to me)
Posted Jan 11, 2016 15:29 UTC (Mon)
by anselm (subscriber, #2796)
[Link] (2 responses)
“The early stages of the boot” have by now pretty much been taken over by the initramfs, so being able to put stuff into /bin to have it available “from the start” is no longer a viable argument except as far as the most simplistic deployments are concerned.
In addition, not putting all binaries, libraries, etc. directly onto the root file system makes it possible to have a very small root file system (possibly in RAM) which should appeal, e.g., to appliance makers.
Posted Jan 11, 2016 15:47 UTC (Mon)
by Yenya (subscriber, #52846)
[Link] (1 responses)
* having a small filesystem (possibly in RAM) for / and mounting binaries from r/only media to /usr,
The only (albeit minor) difference is that the second approach has shorter paths (/lib instead of /usr/lib, etc.).
Also, my argument is not "to have stuff in /bin available from the start" (it can be surely be done for binaries in /bin as well as in /usr/bin), but to avoid having a separate root filesystem and longer paths for no good reason.
Having r/only binaries and r/w variable data on separate filesystems is a valid requirement for some systems. However, this does not imply that the / directory should belong to the former or to the later.
Posted Jan 12, 2016 12:44 UTC (Tue)
by smcv (subscriber, #53363)
[Link]
OK, so you mount your root filesystem, you look in /etc/fstab for the machine-specific list of what else to mount, oops! you don't have /etc yet.
That's why /etc is required to be on the root filesystem in Debian (and, as far as I know, in all general-purpose distributions). The first filesystem you mount (plus the initramfs, if present) must contain enough configuration to mount the rest. In Debian's support for having the initramfs mount a separate /usr, the initramfs mounts / first, and reads /etc/fstab to find out where /usr is.
It would be possible to hard-code the partition layout in the initramfs (for example by copying /etc/fstab into it), but it seems better to minimize the set of system configuration changes that require an initramfs rebuild before they will actually take effect.
Posted Jan 11, 2016 23:10 UTC (Mon)
by Karellen (subscriber, #67644)
[Link] (2 responses)
To start a new container, you can create your new "root" directory, with (nearly?) empty /var, /home and /etc, mount an appropriate /dev, /proc and /sys, then put a tmpfs on /tmp and /run, and finally bind-mount /usr read-only.... and that's it! Your chroot/jail/container-of-choice is ready to go.
OK, mounting a single /usr is only slightly easier than mounting /bin, /lib and /sbin separately; but the container angle is the one that let me see how /usr is a logical unit of the filesystem that makes sense to have its own top-level subdir.
Posted Jan 12, 2016 9:09 UTC (Tue)
by Yenya (subscriber, #52846)
[Link] (1 responses)
Posted Jan 13, 2016 0:23 UTC (Wed)
by raven667 (subscriber, #5198)
[Link]
Why not the other way round?
Why not the other way round?
Why not the other way round?
to have it on a separate filesystem anyway.
Why not the other way round?
Why not the other way round?
and
* having these r/only media mounted as / and mounting the said small RAM-based filesystem as /var or /etc.
Why not the other way round?
Why not the other way round?
Why not the other way round?
Why not the other way round?
