Should /usr and /home be on different partitions

directory-structure

In studying for the lcpi exam, I met the following statement.

If multiple disks are available it is good practice to also have the /usr and /home directories on different partitions. http://en.wikibooks.org/wiki/LPI_Linux_Certification/Design_Hard_Disk_Layout

For desktop workstations, it makes sense to put your home directory on a separate drive or partition.

I've loged into a lot of linux servers, and I have never seen the system admin put these folders on separate partitions.

Is is common practice to separate these folders on linux servers?
What reasons might you separate /usr and /home? (Besides making reinstalling easier).

Best Answer

The 3 primary reasons you would create these as separate partitions are as follows:

  1. performance
  2. isolation
  3. security

Examples

  • By separating /home you can put this data on a shared network disk so that when UserA logs into servers in a given domain, their /home/$USER will be a single copy that follows them from machine to machine. This is typically done using NFS and automounts (aka. autofs).

  • By putting /usr data on it's own partition, it can be mounted read-only, offering a level of protection to the data under this directory so that it cannot be tampered with so easily.

  • Some additional reasoning for isolating /usr, is for making it easier to deploy identical systems, these partitions can be prepared one time and then replicated across systems more easily.

  • Also separating the data out can make it easier for backup cycles.

  • Finally separating volatile directories such as /home can protect a system from having it's primary disk fill up by either an accidental or malicious user.

Over the course of my 15+ years of doing this I've only ever seen /home separated (as a network share via NFS) and the /boot and /var directories as being isolated as separate partitions. Outside of some esoteric Solaris boxes I can't recall ever seeing a Linux system having a separate /usr - and note that if you don't have /usr mounted before init starts, your system will break in esoteric and silent ways.

Related Question