Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2000 14:30:09 +0930
From:      Greg Lehey <grog@lemis.com>
To:        K H Tan <netline@pop.jaring.my>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Re-partioning hard disk
Message-ID:  <20000825143009.N39208@wantadilla.lemis.com>
In-Reply-To: <39A5FA47.B5620A41@pop.jaring.my>; from netline@pop.jaring.my on Fri, Aug 25, 2000 at 12:47:04PM %2B0800
References:  <39A5FA47.B5620A41@pop.jaring.my>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, 25 August 2000 at 12:47:04 +0800, K H Tan wrote:
> Hello,
>
> I've some questions :
>
> 1) I've decided to re-partition my hard disk, to allocate more space to
> /var for e.g. Is there a way to do this or do I have to reinstall the
> whole OS?

There are ways, but it might be easier just to reinstall.

While you're at it, take a look at my new recommendation on
partitioning, attached, from the upcoming fourth edition of "The
Complete FreeBSD"

> 2) Currently I have one NIC installed. If I install another one and
> connect both to a switching hub, will I get double bandwidth?

No.

> How do I go about making the NICs redundant - in case one fails, the
> other takes over?

We don't have any mechanism for that at the moment.

Greg

What size partitions?
_____________________

In our example, we have 20 GB of space to divide up.  How should we do it?  You
don't  have  to  worry about this issue, since sysinstall will do it for you if
you ask it, but we'll see below why this might not be the best choice.  In this
section  we'll  consider how UNIX file systems have changed over the years, and
we'll look at the issues in file system layout nowadays.

When UNIX was young, disks were tiny.  By the time  of  the  Third  Edition  of
UNIX,  in 1972, the system disk was a Digital RF-11, a fixed head disk with 512
kB.  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.  Since that time, an
additional file system, /var, has come into common use for  frequently  changed
data.  This is what sysinstall does by default:

         [Omitting PostScript image images/disk-label-default.ps 4i  ]
                   Figure 6-12: Default disk partition sizes

It's  relatively  simple  to  estimate  the  size  of the root file system, and
sysinstall's value of 50 MB is fine.  But what about /var?  20 MB  isn't  worth
the trouble any more.  In fact, both file systems put together would be lost in
the 19 GB of /usr file system.  Why do we still do things this way?  Let's look
at the advantages and disadvantages:

o If  you  write to a file system, a system crash can have serious consequences
  for the data integrity of that file system.

o If you have a crash and lose the root file system, recovery can be difficult.

o If a file system fills up, it can cause lots of trouble.  Most messages about
  file systems on the FreeBSD-questions mailing list are complaining about file
  systems  filling  up.   If you have a large number of small file systems, the
  chances are higher that one will fill up while space remains on another.

o In single-user mode,  only  the  root  file  system  is  mounted.   With  the
  classical  layout, this means that the only programs you can run are those in
  /bin and /sbin.  In order to run any other programs, you must first mount the
  file system on which they are located.

o It's  nice  to keep your personal files separate from the system files.  That
  way you can upgrade a system much more easily.

o It's very difficult to  calculate  the  sizes  of  some  file  systems.   For
  example,  on some systems /var can be very small, maybe only 2 or 3 MB.  It's
  hardly worth making a separate file system for that much data.  On the  other
  hand, other systems, such as ftp or web servers, may have a /var system of 50
  or 100 GB.  How do you choose the correct size for your system?

o When doing backups, it's a good idea to be able to get a  file  system  on  a
  single tape.

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 five years ago, showed how to  install  on  a  200  MB  drive.   The
smallest  disk  drives  in current production are 10 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  this book, I recommended to put 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:

o In  the  example  we're  looking  at,  /usr is about 19 GB in size.  Not many
  people have backup devices which can write this much data on a single medium.

o Many people had difficulty with the symbolic link to /usr/var.

As a result, I now recommend:

o Make a single root file system of between 2 and 4 GB.

o Do not have separate /usr or /var file systems.

o Use  the  rest  of the space on disk for a /home file system, as long as it's
  possible to back it up on  a  single  tape.   Otherwise  make  multiple  file
  systems.  /home is the normal directory for user files.

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 perfect, though: on a web server you probably wouldn't want
to put /var on the root file system.

--
When replying to this message, please copy the original recipients.
For more information, see http://www.lemis.com/questions.html
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000825143009.N39208>