Ubuntu分区建议
A Linux system must have a / (root) partition. It is advisable to set up a swap partition as well. You can create additional partition/mount point pairs; this section
lists some of the more common ones. Any standard directories you do not create
partitions/mount points for automatically become subdirectories of the / (root)
directory and reside on the / (root) partition. For example, if you do not create a
partition to hold the /home filesystem, the installer creates home as a subdirectory
of / and the home directory resides on the / (root) partition.
(swap)
Linux temporarily stores programs and data on a swap partition when it does not
have enough RAM to hold all the information it is processing. The size of the swap
partition should be between one and two times the size of the RAM in the system,
with a minimum size of 256 megabytes. For example, a system with 1 gigabyte of
RAM should have a 1- to 2-gigabyte swap partition. Although a swap partition is
not required, most systems perform better with one. A swap partition is not
mounted so it is not associated with a mount point. See swap on page 564 for more
information.
/boot
This partition holds the kernel and other data the system needs when it boots. The
/boot partition is typically about 100 megabytes, although the amount of space
required depends on how many kernel images you want to keep on hand. This
partition can be as small as 50 megabytes. Although you can omit the /boot partition, it is useful in many cases. Many administrators put an ext2 filesystem on this
partition because the data on it does not change frequently enough to justify the
added overhead of the ext3 journal. Some older BIOSs require the /boot partition
[or the / (root) partition if there is no /boot partition] to appear near the beginning of the disk
/var
The name var is short for variable: The data in this partition changes frequently.
Because it holds the bulk of system logs, package information, and accounting data,
making /var a separate partition is a good idea. In this way, if a user runs a job that
consumes all of the user’s disk space, system logs will not be affected. The /var partition can occupy from 500 megabytes up to several gigabytes for extremely active
systems with many verbose daemons and a lot of printer activity (files in the print
queue are stored on /var). Systems that are license servers for licensed software
often qualify as extremely active systems. By default, Apache content (Web pages it
serves) is stored on /var under Ubuntu.
/home
It is a common strategy to put user home directories on their own disk or partition.
This partition is usually named /home. Having /home in a separate partition allows
you to perform a clean install without overwriting user files.
/ (root)
Some administrators choose to separate the / (root), /boot, and /usr partitions.
When you have Ubuntu decide how to partition the disk (guided partitioning), it
puts all directories in the root partition. By itself, the root partition usually consumes less than 30 megabytes of disk space. However, /lib, which can consume
more than 300 megabytes, is part of the root partition. On occasion, you may
install a special program that has many kernel drivers that consume a lot of space in
the root partition. Allot 1 gigabyte to the root partition at a minimum.
/usr
Separating the /usr partition can be useful if you plan to export /usr to another system and want the security that a separate partition can give. Many administrators put
an ext2 filesystem on this partition because the data on it does not change frequently
enough to justify the added overhead of the ext3 journal. The size of /usr depends on
the number of packages you install. On a default system, it is typically 2–4 gigabytes.
/usr/local
and /opt
Both /usr/local and /opt are candidates for separation. If you plan to install many
packages in addition to Ubuntu Linux, you may want to keep them on a separate
partition. If you install the additional software in the same partition as the users’
home directories, for example, it may encroach on the users’ disk space. Many sites
keep all /usr/local or /opt software on one server and export it to other systems. If
you choose to create a /usr/local or /opt partition, its size should be appropriate to
the software you plan to install.
Table 2-1 (next page) gives guidelines for minimum sizes for partitions used by Linux.
Set the sizes of other partitions, such as /home, /opt, and /usr/local, according to
need and the size of the hard disk. If you are not sure how you will use additional disk
space, you can create extra partitions using whatever names you like (for example,
/b01, /b02, and so on) or wait until later to divide the space into partitions.

浙公网安备 33010602011771号