Image of grog
Greg's disk partitioning recommendations
Greg's diary
Greg's home page
HOWTO index
Google

Over the course of decades, I've settled on a file system layout that doesn't match the conventional views. In particular, it tries to separate the system installation (kernel, userland, ports collection and corresponding configuration files) from the data on the system, which helps with upgrades. Here's my recommendation; see below for the rationale.

This layout allows for easy backup of the file systems, and it also allows for easy upgrading to a new system version: you just need to replace the root file system. It's not a perfect fit for all applications, though. Ultimately you need to make your own decisions.

Rationale

This is an extract from The Complete FreeBSD, written in 2001, but it applies equally well to any normal UNIX installation. In that time, the sizes have changed, so the sizes in the recommendation don't quite match the sizes above. I have also refined the method a little since then, so not all of the text above occurs.

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 just recently sysinstall has been changed to create a /tmp file system by default.

It's relatively simple to estimate the size of the root file system, and sysinstall's 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 this book, only six years ago, showed how to install on a 200 MB drive. The smallest disk drives in current production are 20 GB in size, more than will fit on many tapes.

This was written in 2001. Disks have continued to grow, and at the time of writing this web page (January 2010) typical sizes are between 500 GB and 1000 GB. All the more reason for this rationale.

As a result of these considerations, I have changed my recommendations. In earlier editions of this book, 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:

This layout allows for easy backup of the file systems, and it also allows for easy upgrading to a new system version: you just need to replace the root file system. It's not a perfect fit for all applications, though. Ultimately you need to make your own decisions.


Greg's home page Greg's diary Greg's photos Copyright

Valid XHTML 1.0!

$Id: diskpartition.php,v 1.3 2011/05/22 01:38:04 grog Exp $