|
|
Subscribe / Log in / New account

Why not the other way round?

Why not the other way round?

Posted Jan 11, 2016 15:29 UTC (Mon) by anselm (subscriber, #2796)
In reply to: Why not the other way round? by Yenya
Parent article: Preparing for a merged /usr in Debian

“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.


to post comments

Why not the other way round?

Posted Jan 11, 2016 15:47 UTC (Mon) by Yenya (subscriber, #52846) [Link] (1 responses)

I fail to see the substantial difference between

* having a small filesystem (possibly in RAM) for / and mounting binaries from r/only media to /usr,
and
* having these r/only media mounted as / and mounting the said small RAM-based filesystem as /var or /etc.

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.

Why not the other way round?

Posted Jan 12, 2016 12:44 UTC (Tue) by smcv (subscriber, #53363) [Link]

> mounting the said small RAM-based filesystem as /var or /etc

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.


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