4

i know that one reason for /root not being in /home is that usually /home is mounted on a different disk and if it were to fail, we still want root to be accessible. What are some of the other reasons for this structure?

6
  • 9
    Try to add a clear problem statement to your question. Surely you are content with other design choices that have zero or one reason.. so if you spell out the reason you are looking for additional explanations here, you might get a better answer.
    – anx
    Jun 27 at 9:32
  • 1
    Beyond the reason you give, for certain setups, the root home directory needs to be accessible during boot before the filesystem containing home is mounted... Jun 27 at 21:27
  • 1
    Does this answer your question? In Linux, why isn't superuser root's folder under /home?
    – phuclv
    Jun 28 at 1:32
  • That's one very good reason, who needs more?
    – hobbs
    Jun 28 at 3:03
  • phuclv, that does not answer the question. I was asked to find more answers other than that of /home is mounted on a different device, and was wandering if anyone here had more reasons.
    – dor
    Jun 28 at 6:23
12
  1. composability

    You want to build/diagnose/repair a system using that same system, so it makes sense to keep the next upper layer (multi-user features) independent from the lower layers. Many systems to this day equate recovery with single-user: not a special mode, but a merely a lack of some features built on top of it. And if /home is part of a layer on top of single-user systems, it cannot contain single-user essentials.

  2. privacy

    You should keep personal data separated from system data. Enforcing this separation even when not also expressed in distributing across different mounts makes sense to simplify safe defaults for common operations: Only multi-user directories require explicit exclusion when doing a system backup - the root users directory being considered system, not personal data here.

These two may not be strictly equal to the /home is a nfs use case, but obviously still strongly related. My main answer is and remains: being able to handle /home mounted from a different device is a good reason and when designing low-level software, one good reason is already enough.

1
  • 1
    Hmmm; I recall more than one system that when booted single user just didn't start the multi-user component; this resulted in getty directly starting /sbin/sh with HOME=/ like it is in the early boot env disregarding user login. This would let you boot single user with things like a damaged /etc/passwd or a lost root password.
    – joshudson
    Jun 28 at 4:02
7

Personally - without having read into *NIX (UNIX/Linux) design for a long time, I'd say you've likely answered you own question (/most likely implied the main reason), in that it boils down to recoverability/the bare-bones running system (- the *NIX equivalent of Windows 'Safe Mode'); what is the bare-minimum you need to be able to run the O/S (?) - should you need to diagnose an issue and work your way up step-by-step, i.e. mount one filesystem and/or start one service one at a time (- i.e. with the fewest dependencies/mandatory facets necessary to allow the system to spin-up successfully/be up & running so that an administrator is more likely to be able to initiate the diagnostic process).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.