Greg
There can only be one
Abolish superfluous file systems
Greg's home page
Greg's diary
Greg's rants
Google
This is a mildly frobbed version of the discussion in The Complete FreeBSD. The considerations apply to all UNIX-like operating systems.
When UNIX was young, disks were tiny. At the time of the third edition of UNIX, in 1972, the root file system was on a Digital RF-11, a fixed head disk with 512 kB. The system was growing, and it was no longer possible to keep the entire system on this disk, so a second file system became essential. It was mounted on a Digital RK03 with 2 MB of storage. To quote from a paper published in the Communications of the ACM in July 1974:
In our installation, for example, the root directory resides on the fixed-head disk, and the large disk drive, which contains user's files, is mounted by the system initialization program...

As time went on, UNIX got bigger, but so did the disks. By the early 80s, disks were large enough to put / and /usr on the same disk, and it would have been possible to merge / and /usr, but they didn't, mainly because of reliability concerns. Since that time, an additional file system, /var, has come into common use for frequently changed data, and some systems automatically add other file systems, such as /opt and /home. When I wrote the 4th edition of “The Complete FreeBSD” in 2003, the default installation gave you a 128 MB root file system, 256 MB /var, 256 MB /tmp, and the rest of the disk—even then 20 GB—as the /usr file system. And that's all.

It's relatively simple to estimate the size of the root file system, and the default value of 128 MB is reasonable. But what about /var and /tmp? Is 256 MB too much or too little? In fact, both file systems put together would be lost in the 18.7 GB of /usr file system. Why are things still this way? Let's look at the advantages and disadvantages:

In the early days of UNIX, system crashes were relatively common, and the damage they did to the file systems was relatively serious. Times have changed, and nowadays file system damage is relatively seldom, particularly on file systems that have little activity. On the other hand, disk drives have grown beyond most peoples' wildest expectations. The first edition of “The Complete FreeBSD”, in 1997, showed how to install on a 200 MB drive. The smallest disk drives in current production are now 80 GB in size, more than will fit on many tapes.

As a result of these considerations, I have changed my recommendations. In earlier editions of “The Complete FreeBSD”, I recommended putting a small root file system and a /usr file system on the first (or only) disk on the system. /var was to be a symbolic link to /usr/var.

This is still a valid layout, but it has a couple of problems:

As a result, I now recommend:

The second root file system is for upgrades. This layout allows for easy backup of the file systems, and it also allows for easy upgrading to a new system version: when you upgrade the system, you can install it on the other root file system. It's not a perfect fit for all applications, though. Ultimately you need to make your own decisions.


Rant index Greg's home page Greg's diary Greg's photos Greg's links
$Id: only-one.php,v 1.2 2009/06/26 02:53:31 grog Exp $
RSS 2.0 Valid XHTML 1.0!