296 lines
6.4 KiB
HTML
296 lines
6.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Partition Types</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux Partition HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Devices"
|
|
HREF="devices.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Partitioning requirements"
|
|
HREF="requirements.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Linux Partition HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="devices.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="requirements.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="partition-types"
|
|
></A
|
|
>3. Partition Types</H1
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="types"
|
|
></A
|
|
>3.1. Partition Types</H2
|
|
><P
|
|
> A partition is labeled to host a certain kind of file system (not to
|
|
be confused with a volume label (see <A
|
|
HREF="labels.html"
|
|
>Section 6</A
|
|
>)).
|
|
Such a file system could be the linux standard ext2 file system or
|
|
linux swap space, or even foreign file systems like (Microsoft) NTFS
|
|
or (Sun) UFS. There is a numerical code associated with each
|
|
partition type. For example, the code for ext2 is
|
|
<TT
|
|
CLASS="literal"
|
|
>0x83</TT
|
|
> and linux swap is <TT
|
|
CLASS="literal"
|
|
>0x82</TT
|
|
>.
|
|
To see a list of partition types and their codes, execute
|
|
<TT
|
|
CLASS="userinput"
|
|
><B
|
|
><B
|
|
CLASS="command"
|
|
>/sbin/sfdisk</B
|
|
> -T </B
|
|
></TT
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="AEN429"
|
|
></A
|
|
>3.2. Foreign Partition Types</H2
|
|
><P
|
|
> The partition type codes have been arbitrarily chosen (you can't
|
|
figure out what they should be) and they are particular to a given
|
|
operating system. Therefore, it is theoretically possible that if
|
|
you use two operating systems with the same hard drive, the same
|
|
code might be used to designate two different partition types. OS/2
|
|
marks its partitions with a 0x07 type and so does Windows NT's NTFS.
|
|
MS-DOS allocates several type codes for its various flavors of FAT
|
|
file systems: 0x01, 0x04 and 0x06 are known. DR-DOS used 0x81 to
|
|
indicate protected FAT partitions, creating a type clash with
|
|
Linux/Minix at that time, but neither Linux/Minix nor DR-DOS are
|
|
widely used any more.
|
|
</P
|
|
><P
|
|
>
|
|
OS/2 marks its partitions with a <TT
|
|
CLASS="literal"
|
|
>0x07</TT
|
|
> type and
|
|
so does Windows NT's NTFS. MS-DOS allocates several type codes for
|
|
its various flavors of FAT file systems: 0x01,
|
|
<TT
|
|
CLASS="literal"
|
|
>0x04</TT
|
|
> and <TT
|
|
CLASS="literal"
|
|
>0x06</TT
|
|
> are known.
|
|
DR-DOS used <TT
|
|
CLASS="literal"
|
|
>0x81</TT
|
|
> to indicate protected FAT
|
|
partitions, creating a type clash with Linux/Minix at that time,
|
|
but neither Linux/Minix nor DR-DOS are widely used any more.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="primary"
|
|
></A
|
|
>3.3. Primary Partitions</H2
|
|
><P
|
|
> The number of partitions on an Intel-based system was limited from
|
|
the very beginning: The original partition table was installed as
|
|
part of the boot sector and held space for only four partition
|
|
entries. These partitions are now called primary partitions.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="logical"
|
|
></A
|
|
>3.4. Logical Partitions</H2
|
|
><P
|
|
> One primary partition of a hard drive may be subpartitioned. These
|
|
are logical partitions. This effectively allows us to skirt the
|
|
historical four partition limitation.
|
|
</P
|
|
><P
|
|
> The primary partition used to house the logical partitions is called
|
|
an extended partition and it has its own file system type (0x05).
|
|
Unlike primary partitions, logical partitions must be contiguous.
|
|
Each logical partition contains a pointer to the next logical
|
|
partition, which implies that the number of logical partitions is
|
|
unlimited. However, linux imposes limits on the total number of any
|
|
type of partition on a drive, so this effectively limits the number
|
|
of logical partitions. This is at most 15 partitions total on an
|
|
SCSI disk and 63 total on an IDE disk.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="swap-partitions"
|
|
></A
|
|
>3.5. Swap Partitions</H2
|
|
><P
|
|
> Every process running on your computer is allocated a number of
|
|
blocks of RAM. These blocks are called pages. The set of in-memory
|
|
pages which will be referenced by the processor in the very near
|
|
future is called a "working set." Linux tries to predict these
|
|
memory accesses (assuming that recently used pages will be used
|
|
again in the near future) and keeps these pages in RAM if possible.
|
|
</P
|
|
><P
|
|
> If you have too many processes running on a machine, the kernel will
|
|
try to free up RAM by writing pages to disk. This is what swap space
|
|
is for. It effectively increases the amount of memory you have
|
|
available. However, disk I/O is about a hundred times slower than
|
|
reading from and writing to RAM. Consider this emergency memory and
|
|
not extra memory.
|
|
</P
|
|
><P
|
|
> If memory becomes so scarce that the kernel pages out from the
|
|
working set of one process in order to page in for another, the
|
|
machine is said to be thrashing. Some readers might have
|
|
inadvertenly experienced this: the hard drive is grinding away like
|
|
crazy, but the computer is slow to the point of being unusable. Swap
|
|
space is something you need to have, but it is no substitute for
|
|
sufficient RAM. See the discussion in <A
|
|
HREF="requirements.html#SwapSize"
|
|
>Section 4.4</A
|
|
> for tips on determining the size of swap space
|
|
you need.
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="devices.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="requirements.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Devices</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Partitioning requirements</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |