Score:4

Why is the root home directory, /root not in /home? (looking for reasons other than /home is mounted on a different drive)

pl flag
dor

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?

anx avatar
fr flag
anx
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.
co flag
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...
phuclv avatar
rs flag
Does this answer your question? [In Linux, why isn't superuser root's folder under /home?](https://serverfault.com/questions/398355/in-linux-why-isnt-superuser-roots-folder-under-home)
ec flag
That's one very good reason, who needs more?
dor avatar
pl flag
dor
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.
mx flag
FYI, in earlier Unix systems root's home directory was `/`, not `/root`. Which may be why it was named "root".
Score:12
fr flag
anx
  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.

joshudson avatar
cn flag
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.
Score:7
us flag

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.