25

You can create a user that has privileges like root, and it's home directory will fall under /home/username. Why does root get its own folder at the top level of the file system? Is this just convention, a security concern, or is there a performance-related reason?

2
  • Note that the root user and "admin" users are not normally the same thing at all. An "admin" user (assuming this is what you mean by "privileges like root") is typically just a regular user that is permitted to execute commands as root using something like sudo.
    – user83640
    Jun 14, 2012 at 13:29
  • Root is /root, because that is where the filesystem standard says it should be. :p pathname.com/fhs/pub/fhs-2.3.html
    – Zoredache
    Jun 14, 2012 at 22:51

2 Answers 2

58

One reason: On many systems, /home is on a separate partition (or network share) that might fail to mount and it is a good idea to allow root to login with his usual environment whenever possible.

13
  • 1
    This is the same reason why most unix systems have /sbin, /sbin and a /usr/bin and /usr/sbin. The first two contain essential binaries to bring the system up and are therefor located on the root filesystem.
    – Hennes
    Jun 13, 2012 at 17:15
  • 1
    @Hennes you repeated /sbin twice what did you mean to say? Jun 13, 2012 at 17:34
  • 1
    @jshin47 Same as the second part, without /usr/, I would guess. /bin/ and /sbin/.
    – Izkata
    Jun 13, 2012 at 18:09
  • There is a very good discussion at lists.busybox.net/pipermail/busybox/2010-December/074114.html. I think it may have started as a unique user system (the root user) and after some improvements (don't know if Unix refers to unique user of some sort) it may have been necessary to add different users with different configurations that need to reside on some other directory. Just guessing.
    – licorna
    Jun 13, 2012 at 18:50
  • 2
    @Alberto: Unix is ancient and the recovery abilities of modern systems couldn't even be imagined back in the days. There are many things in a Unix-like system that would certainly be handled differently from todays perspective. Also, what you put into your root folder is entirely up to you.
    – Sven
    Jun 14, 2012 at 20:24
7

root's home should be on the partition that the operating system resides on, which by definition is /, so that you can still login as root without issues if, say, another disk partitions are unavailable. /home is sometimes mounted on a separate partition or a separate drive. If this contains the root homedir and is offline, you may encounter difficulties with your login shell. Not a good idea if you're trying to fix things as the root user.

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.