Author: Eddie Kuns
Email: ekuns@kilroy.chi.il.us
Web Page: http://www.physics.rutgers.edu/~ekuns/
Date Submitted: Fri, Jan 23, 1998
Status: New Entry

Releases: all
Platform: all
Category:  Installation Issues
Category Listing:  On install, what partitions should I create, and why?

Issue

I'm about to install Red Hat. I have x amount of disk space. Should 
I create more than one partition? How large should the partitions 
be? Why is it useful to create multiple partitions when one large 
partition would work just as well? 

Response


From ekuns@rci.rutgers.edu Sat Jan 24 20:17:51 1998
From: "Edward W. Kuns, Ph.D." 
To: ekuns@rci.rutgers.edu, rhlufaq-ideas@aturner.vip.best.com
Date: Sat, 24 Jan 1998 00:45:37 -0600
Subject: Text of my FAQ entry -- formatted

A full install of Red Hat Linux will take approximately 500 Meg.  (This number
comes from Red Hat 4.2, including X and kernel source installation.)  The
first time I partitioned my hard disk and installed Red Hat, I had no idea
how much space each partition would need.  I ended up with very little free
space in some partitions, a rediculous amount of free space in others.

So why partition?  There are several reasons.

1) Putting disk areas with a lot of disk activity on a separate partition
   reduces the risk of damage.  If one partition is corrupted, the damage is
   limited to that one partition only.

2) If /home and /usr/local are separate partitions from everything else,
   these partitions can be unmounted before updates or reinstalls are applied.
   There is absolutely no risk of accidentally overwriting a partition which
   is not mounted.

3) You will notice that Linux periodically performs an fsck (file system check)
   on each mounted partition on each device.  This can take a long time, but it
   isn't wise to disable this feature as it can catch disk corruption before
   it becomes a serious problem.  However, a partition mounted read-only
   (I believe) does not need this check and you can save booting time safely.

4) You can mount disk areas read-only which do not normally change except while
   installing or configuring programs.  When a partition is mounted read-only,
   you cannot accidentally delete or corrupt files it contains.  In addition,
   someone trying to break into your system has one more step before being
   able to corrupt these files.

So what do I recommend?  These suggestions come from my experience with Red Hat
4.0 through 4.2.  If you receive a large USENet feed or a high volume of EMail,
some of these suggestions may not apply.  Also, the minimum size of /home
assumes only one user on a system with very limited disk space.

  partition     min size     goal    read-only?

  /               20 Meg   40 Meg       yes
  /usr           350 Meg  650 Meg       yes
  /usr/src        80 Meg  125 Meg       yes
  /usr/local      80 Meg  175 Meg       yes
  /var            50 Meg   75 Meg        no
  /var/spool      50 Meg  100 Meg        no

  swap           depends-on-memory       no

  /home           50 Meg  infinity       no
                 -------  -------
                 680 Meg  >1.2 Gig

Note that /usr/src is only used if you rebuild the kernel or other packages on
your own.  Also, if you do not run X, and thus, do not install X, you can save
about 60 Meg in the /usr disk area.  The logic behind this partitioning is:

A small root partition is all you need.  It contains /boot, /etc, /bin, /sbin,
and a few other small disk areas.  Since the root partition uses so little
disk space, any extra disk space in the root partition is wasted.  If the root
partition is mounted read-only, except when installing or configuring files,
or when logged in as root (as opposed to using su to become root), you save
yourself some risk.

I would divide the /usr partition into three.  /usr/src is likely to have much
disk activity due to kernel recompiles and such.  Also, making this a separate
partition allows someone with limited disk resources to allocate disk to this
later -- when installing a new disk.  (Obviously, in that case, don't install
the source files until you have created the partition.)  /usr/local is where
you will probably install most custom software.  If it is a separate partition,
then you can dismount it before applying Red Hat updates or reinstalls, and
you thus do not risk accidentally corrupting all of your non Red Hat software.

For those with no Usenet feed, a separate /var/spool partition is not
necessary.  For those with a Usenet feed, the amount of disk space it will
take depends on many, many factors -- how many groups you receive, how long
articles stay before you expire them, and such.  In any case, /var/spool is
where all Usenet articles live (as well as UUCP temporary files).  If this
is a separate partition from /var, then a corruption of news areas will not
affect your log files, which are in /var/log.  I receive only a few Usenet
groups, and only one high-volume group; my /var/spool tree usually occupies
about 35 Meg.

For most people installing Red Hat on a home machine, there won't be much use
to making any partition much larger than the "goal" size.  Give the rest of
your disk space to /home (and maybe /usr/src if you are going to keep multiple
version of the kernel source around).  You'll be glad you did.

I would appreciate any feedback which would help make these suggestions more
useful.

References

Man pages on mount, umount, rpm, fstab.