Product SiteDocumentation Site

An Introduction to Disk Partitions

Note

This appendix is not necessarily applicable to non-x86-based architectures. However, the general concepts mentioned here may apply.
This appendix is not necessarily applicable to non-x86-based architectures. However, the general concepts mentioned here may apply.
If you are reasonably comfortable with disk partitions, you could skip ahead to 「Making Room For Fedora」, for more information on the process of freeing up disk space to prepare for a Fedora installation. This section also discusses the partition naming scheme used by Linux systems, sharing disk space with other operating systems, and related topics.

A.1. Hard Disk Basic Concepts

Hard disks perform a very simple function — they store data and reliably retrieve it on command.
ディスクパーティション設定などの問題を論議する場合、背後にあるハードウェアについて少々の知識を持っていることが重要です。但し、詳細に深入りしてしまう可能性が あります。そこで、この付録では、簡潔化したディスクの図を使用して、ディスクドライブが パーティションされる時に実際に何が起こっているのかを説明する手助けとします。 図A.1「An Unused Disk Drive」 では、新品の未使用のディスクドライブを示しています。
An Unused Disk Drive
Image of an unused disk drive.
図A.1 An Unused Disk Drive

Not much to look at, is it? But if we are talking about disk drives on a basic level, it is adequate. Say that we would like to store some data on this drive. As things stand now, it will not work. There is something we need to do first.

A.1.1. It is Not What You Write, it is How You Write It

経験のあるユーザーなら多分すぐにお分かりでしょう。ドライブを フォーマット する必要があります。フォーマット(通常『ファイルシステムを作る』と言う意味で知られています)とはドライブに情報を書き込んで、未フォーマットのドライブの空白の領域に順番を付けることです。
Disk Drive with a File System
Image of a formatted disk drive.
図A.2 Disk Drive with a File System

図A.2「Disk Drive with a File System」 で判るように、ファイルシステムで与えられる順序には、いくらかのトレードオフがあります:
  • ドライブの使用可能領域のごく一部がファイルシステム自身に関連するデータの保存に使用されますが、これはオーバーヘッド(必要経費)と考えていいでしょう。
  • ファイルシステムは残りの領域を小規模で均一なサイズのセグメントに分割します。 Linux ではこれらのセグメントは ブロック [6]と呼ばれます。
Given that file systems make things like directories and files possible, these trade-offs are usually seen as a small price to pay.
It is also worth noting that there is no single, universal file system. As 図A.3「Disk Drive with a Different File System」, shows, a disk drive may have one of many different file systems written on it. As you might guess, different file systems tend to be incompatible; that is, an operating system that supports one file system (or a handful of related file system types) may not support another. This last statement is not a hard-and-fast rule, however. For example, Fedora supports a wide variety of file systems (including many commonly used by other operating systems), making data interchange between different file systems easy.
Disk Drive with a Different File System
Image of a disk drive with a different file system.
図A.3 Disk Drive with a Different File System

Of course, writing a file system to disk is only the beginning. The goal of this process is to actually store and retrieve data. Let us take a look at our drive after some files have been written to it.
Disk Drive with Data Written to It
Image of a disk drive with data written to it.
図A.4 Disk Drive with Data Written to It

図A.4「Disk Drive with Data Written to It」 で示してあるように 以前に空きブロックだった位置にデータが保管されています。しかし、この図を見るだけでは このドライブに存在するファイルの数量を確実に判定することは出来ません。全てのファイルは 最低でも1つのブロックを使い、その一部は複数のブロックを占有しますのでたった1つの ファイルかも知れないし、多くのファイルがあるかも知れません。もう1つ注意すべき点は使用済みのブロックは連続領域を持つ必要がないことです。使用ブロックと未使用ブロックが 交互に混ざっているかも知れません。これは フラグメンテーション と呼ばれます。フラグメンテーションは、既存パーティションのサイズ変更時に役めを果たします。
As with most computer-related technologies, disk drives changed over time after their introduction. In particular, they got bigger. Not larger in physical size, but bigger in their capacity to store information. And, this additional capacity drove a fundamental change in the way disk drives were used.

A.1.2. Partitions: Turning One Drive Into Many

As disk drive capacities soared, some people began to wonder if having all of that formatted space in one big chunk was such a great idea. This line of thinking was driven by several issues, some philosophical, some technical. On the philosophical side, above a certain size, it seemed that the additional space provided by a larger drive created more clutter. On the technical side, some file systems were never designed to support anything above a certain capacity. Or the file systems could support larger drives with a greater capacity, but the overhead imposed by the file system to track files became excessive.
The solution to this problem was to divide disks into partitions. Each partition can be accessed as if it was a separate disk. This is done through the addition of a partition table.

Note

While the diagrams in this chapter show the partition table as being separate from the actual disk drive, this is not entirely accurate. In reality, the partition table is stored at the very start of the disk, before any file system or user data. But for clarity, they are separate in our diagrams.
Disk Drive with Partition Table
Image of an unused disk drive with a partition table.
図A.5 Disk Drive with Partition Table

図A.5「Disk Drive with Partition Table」 で示してあるように パーティションテーブルは四つのセクション、則ち、四つの プライマリ パーティションに分割されています。プライマリパーティションは 論理ドライブ (又はセクション) を1つだけ含むことができるパーティションです。各セクションは 単独パーティションを定義する為に必要な情報を保持することができます。これはパーティションテーブルが四つまでのパーティションしか定義できないと言う意味です。
Each partition table entry contains several important characteristics of the partition:
  • The points on the disk where the partition starts and ends
  • パーティションが「アクティブ」かどうか
  • パーティションのタイプ
これらの特長について詳しく見てみましょう。開始点と終了点によって実際のパーティションサイズとディスク上の物理的な位置が定義されます。「アクティブ」フラグは幾つかの OS のブートローダーによって使用されます。つまり、「アクティブ」に設定されたパーティションに含まれる OS がブートすることになります。
パーティションのタイプについては少々混乱を招くかもしれません。タイプとは予測されたパーティションの用途を識別する番号です。この表現では曖昧に響くかもしれませんが、それはパーティションの意味がやや曖昧だからです。数種の OS はパーティションタイプを使い分けることで特殊なファイルシステムタイプを表現するとか、フラグを付けて一定の OS に関連しているパーティションを区別とか、起動可能な OS を含んでいるパーティション表示とか、さらにはその 3 つの組合せなどの目的で使用します。
この時点で、この複雑さがどのように実際に使用されるのか不思議に思うかも知れません。 その例として、図A.6「Disk Drive With Single Partition」 を参照して 下さい。
Disk Drive With Single Partition
Image of a disk drive with a single partition.
図A.6 Disk Drive With Single Partition

In many cases, there is only a single partition spanning the entire disk, essentially duplicating the method used before partitions. The partition table has only one entry used, and it points to the start of the partition.
We have labeled this partition as being of the "DOS" type. Although it is only one of several possible partition types listed in 表A.1「Partition Types」, it is adequate for the purposes of this discussion.
表A.1「Partition Types」 に、一般的 (及びあまり知られていない) パーティション タイプとその 16 進数の数値の一覧を示します。
表A.1 Partition Types
パーティションタイプ パーティションタイプ
空白 00 Novell Netware 386 65
DOS 12-ビット FAT 01 PIC/IX 75
XENIX root 02 Old MINIX 80
XENIX usr 03 Linux/MINUX 81
DOS 16-bit <=32M 04 Linux swap 82
Extended 05 Linux native 83
DOS 16-bit >=32 06 Linux extended 85
OS/2 HPFS 07 Amoeba 93
AIX 08 Amoeba BBT 94
AIX bootable 09 BSD/386 a5
OS/2 Boot Manager 0a OpenBSD a6
Win95 FAT32 0b NEXTSTEP a7
Win95 FAT32 (LBA) 0c BSDI fs b7
Win95 FAT16 (LBA) 0e BSDI swap b8
Win95 Extended (LBA) 0f Syrinx c7
Venix 80286 40 CP/M db
Novell 51 DOS access e1
PReP ブート 41 DOS R/O e3
GNU HURD 63 DOS secondary f2
Novell Netware 286 64 BBT ff

A.1.3. Partitions within Partitions — An Overview of Extended Partitions

Of course, over time it became obvious that four partitions would not be enough. As disk drives continued to grow, it became more and more likely that a person could configure four reasonably-sized partitions and still have disk space left over. There needed to be some way of creating more partitions.
Enter the extended partition. As you may have noticed in 表A.1「Partition Types」, there is an "Extended" partition type. It is this partition type that is at the heart of extended partitions.
When a partition is created and its type is set to "Extended," an extended partition table is created. In essence, the extended partition is like a disk drive in its own right — it has a partition table that points to one or more partitions (now called logical partitions, as opposed to the four primary partitions) contained entirely within the extended partition itself. 図A.7「Disk Drive With Extended Partition」, shows a disk drive with one primary partition and one extended partition containing two logical partitions (along with some unpartitioned free space).
Disk Drive With Extended Partition
Image of a disk drive with an extended partition.
図A.7 Disk Drive With Extended Partition

As this figure implies, there is a difference between primary and logical partitions — there can only be four primary partitions, but there is no fixed limit to the number of logical partitions that can exist. However, due to the way in which partitions are accessed in Linux, you should avoid defining more than 12 logical partitions on a single disk drive.
Now that we have discussed partitions in general, let us review how to use this knowledge to install Fedora.

A.1.4. Making Room For Fedora

The following list presents some possible scenarios you may face when attempting to repartition your hard disk:
  • Unpartitioned free space is available
  • An unused partition is available
  • Free space in an actively used partition is available
Let us look at each scenario in order.

Note

Keep in mind that the following illustrations are simplified in the interest of clarity and do not reflect the exact partition layout that you encounter when actually installing Fedora.

A.1.4.1. Using Unpartitioned Free Space

この状況では、既に定義されているパーティションはハードディスク全体に拡がることはありません。定義済みのパーティションの一部ではない未割り当ての領域が残ります。図A.8「Disk Drive with Unpartitioned Free Space」 では、 このような状況を示します。
Disk Drive with Unpartitioned Free Space
Image of a disk drive with unpartitioned free space, where 1 represents an undefined partition with unallocated space and 2 represents a defined partition with allocated space.
図A.8 Disk Drive with Unpartitioned Free Space

図A.8「Disk Drive with Unpartitioned Free Space」 では 1 は領域が割り当てられていない未定義のパーティションを表し、2 は割り当てられた領域で定義済みのパーティションを表します。
If you think about it, an unused hard disk also falls into this category. The only difference is that all the space is not part of any defined partition.
In any case, you can create the necessary partitions from the unused space. Unfortunately, this scenario, although very simple, is not very likely (unless you have just purchased a new disk just for Fedora). Most pre-installed operating systems are configured to take up all available space on a disk drive (refer to 「Using Free Space from an Active Partition」).
Next, we will discuss a slightly more common situation.

A.1.4.2. Using Space from an Unused Partition

この場合、もう使用しなくなった1つ、又は複数のパーティションがあるかも知れません。以前に他のオペレーティングシステムを娯楽で使用していて、それに割り当てていたパーティションが 無用になっているかも知れません。図A.9「Disk Drive With an Unused Partition」 では そのような状況を示します。
Disk Drive With an Unused Partition
Image of a disk drive with an unused partition, where 1 represents an unused partition and 2 represents reallocating an unused partition for Linux.
図A.9 Disk Drive With an Unused Partition

図A.9「Disk Drive With an Unused Partition」 では、1 は未使用のパーティションを示し、2 はLinux 用に未使用パーティションの再割り当てをするところを示します。
If you find yourself in this situation, you can use the space allocated to the unused partition. You first must delete the partition and then create the appropriate Linux partition(s) in its place. You can delete the unused partition and manually create new partitions during the installation process.

A.1.4.3. Using Free Space from an Active Partition

This is the most common situation. It is also, unfortunately, the hardest to handle. The main problem is that, even if you have enough free space, it is presently allocated to a partition that is already in use. If you purchased a computer with pre-installed software, the hard disk most likely has one massive partition holding the operating system and data.
Aside from adding a new hard drive to your system, you have two choices:
破壊的なパーティション再設定
Basically, you delete the single large partition and create several smaller ones. As you might imagine, any data you had in the original partition is destroyed. This means that making a complete backup is necessary. For your own sake, make two backups, use verification (if available in your backup software), and try to read data from your backup before you delete the partition.

Warning

If there was an operating system of some type installed on that partition, it needs to be reinstalled as well. Be aware that some computers sold with pre-installed operating systems may not include the CD-ROM media to reinstall the original operating system. The best time to notice if this applies to your system is before you destroy your original partition and its operating system installation.
After creating a smaller partition for your existing operating system, you can reinstall any software, restore your data, and start your Fedora installation. 図A.10「Disk Drive Being Destructively Repartitioned」 shows this being done.
Disk Drive Being Destructively Repartitioned
Image of a disk drive being destructively repartitioned, where 1 represents before and 2 represents after.
図A.10 Disk Drive Being Destructively Repartitioned

図A.10「Disk Drive Being Destructively Repartitioned」 では、1 は「前」、2 は「後」を示します。

Warning

図A.10「Disk Drive Being Destructively Repartitioned」 で示してあるように、元来のパーティションに存在していたデータは、正しいバックアップなしでは消失します。
非破壊的なパーティション再設定
Here, you run a program that does the seemingly impossible: it makes a big partition smaller without losing any of the files stored in that partition. Many people have found this method to be reliable and trouble-free. What software should you use to perform this feat? There are several disk management software products on the market. Do some research to find the one that is best for your situation.
While the process of non-destructive repartitioning is rather straightforward, there are a number of steps involved:
  • Compress and backup existing data
  • 既存パーティションのサイズ変更
  • 新規パーティションの作成
Next we will look at each step in a bit more detail.
A.1.4.3.1. Compress existing data
As 図A.11「Disk Drive Being Compressed」, shows, the first step is to compress the data in your existing partition. The reason for doing this is to rearrange the data such that it maximizes the available free space at the "end" of the partition.
Disk Drive Being Compressed
Image of a disk drive being compressed, where 1 represents before and 2 represents after.
図A.11 Disk Drive Being Compressed

図A.11「Disk Drive Being Compressed」 では、1 は「前」を示し、2 は「後」を示します。
This step is crucial. Without it, the location of your data could prevent the partition from being resized to the extent desired. Note also that, for one reason or another, some data cannot be moved. If this is the case (and it severely restricts the size of your new partition(s)), you may be forced to destructively repartition your disk.
A.1.4.3.2. 既存パーティションのサイズ変更
図A.12「Disk Drive with Partition Resized」 に実際のサイズ変更のプロセスを示します。 実際のサイズ変更操作の結果は、使用するソフトウェアによって異なります。ほとんどの場合では 新しく解放した領域を使用することで、元のパーティションと同じタイプの未フォーマットパーティションが 作成されます。
Disk Drive with Partition Resized
Image of a disk drive with a resized partition, where 1 represents before and 2 represents after.
図A.12 Disk Drive with Partition Resized

図A.12「Disk Drive with Partition Resized」 では、1 は「前」を示し、2 は「後」を示します。
It is important to understand what the resizing software you use does with the newly freed space, so that you can take the appropriate steps. In the case we have illustrated, it would be best to delete the new DOS partition and create the appropriate Linux partition(s).
A.1.4.3.3. 新規パーティションの作成
前のステップで判断できるように、新しいパーティションを作成する必要があるかも 知れないし、ないかも知れません。しかし、使用中のサイズ変更ソフトウェアが Linux-認識 タイプでない限り、サイズ変更プロセスで作成されたパーティションを削除する可能性があります。 図A.13「Disk Drive with Final Partition Configuration」 では、その実行例を示します。
Disk Drive with Final Partition Configuration
Image of a disk drive with final partition configuration, where 1 represents before and 2 represents after.
図A.13 Disk Drive with Final Partition Configuration

図A.13「Disk Drive with Final Partition Configuration」 では、1 は「前」を示し、2 は「後」を示します。

Note

The following information is specific to x86-based computers only.
As a convenience to our customers, we provide the parted utility. This is a freely available program that can resize partitions.
If you decide to repartition your hard drive with parted, it is important that you be familiar with disk storage and that you perform a backup of your computer data. You should make two copies of all the important data on your computer. These copies should be to removable media (such as tape, CD-ROM, or diskettes), and you should make sure they are readable before proceeding.
Should you decide to use parted, be aware that after parted runs you are left with two partitions: the one you resized, and the one parted created out of the newly freed space. If your goal is to use that space to install Fedora, you should delete the newly created partition, either by using the partitioning utility under your current operating system or while setting up partitions during installation.

A.1.5. Partition Naming Scheme

Linux がディスクパーティションを表現する際には文字と数字の組合せを使用しますが、これは特にハードディスクやパーティションを 「C ドライブ」の様に表すことに慣れている人々にとっては混乱のもとになるかもしれません。DOS や Windows の世界では、以下の様にしてパーティションに名前が付けられています。
  • 各パーティションのタイプがチェックされ、DOS/Windows で読み取れるかどうか調べられます。
  • パーティションのタイプが互換性を持つものであれば、「ドライブ文字」が割り当てられます。ハードディスクドライブの文字は「C」から始まり、ラベルを付けるパーティションの数により、次の文字へ進みます。
  • The drive letter can then be used to refer to that partition as well as the file system contained on that partition.
Fedora uses a naming scheme that is more flexible and conveys more information than the approach used by other operating systems. The naming scheme is file-based, with file names in the form of /dev/xxyN.
Here is how to decipher the partition naming scheme:
/dev/
This is the name of the directory in which all device files reside. Since partitions reside on hard disks, and hard disks are devices, the files representing all possible partitions reside in /dev/.
xx
The first two letters of the partition name indicate the type of device on which the partition resides, usually either hd (for IDE disks) or sd (for SCSI disks).
y
This letter indicates which device the partition is on. For example, /dev/hda (the first IDE hard disk) or /dev/sdb (the second SCSI disk).
N
The final number denotes the partition. The first four (primary or extended) partitions are numbered 1 through 4. Logical partitions start at 5. So, for example, /dev/hda3 is the third primary or extended partition on the first IDE hard disk, and /dev/sdb6 is the second logical partition on the second SCSI hard disk.

Note

There is no part of this naming convention that is based on partition type; unlike DOS/Windows, all partitions can be identified under Fedora. Of course, this does not mean that Fedora can access data on every type of partition, but in many cases it is possible to access data on a partition dedicated to another operating system.
Keep this information in mind; it makes things easier to understand when you are setting up the partitions Fedora requires.

A.1.6. Disk Partitions and Other Operating Systems

If your Fedora partitions are sharing a hard disk with partitions used by other operating systems, most of the time you will have no problems. However, there are certain combinations of Linux and other operating systems that require extra care.

A.1.7. Disk Partitions and Mount Points

Linux を始めて使用される多くの人々に取って混乱を招きやすい事柄のひとつは、どの様に Linux がパーティションを使い、アクセスするかと言う問題です。これは DOS/Windows の中では比較的簡単なことです。各パーティションは「ドライブ文字」を持っており、この「ドライブ文字」を使用して関連するパーティション上のファイルやディレクトリを参照します。
This is entirely different from how Linux deals with partitions and, for that matter, with disk storage in general. The main difference is that each partition is used to form part of the storage necessary to support a single set of files and directories. This is done by associating a partition with a directory through a process known as mounting. Mounting a partition makes its storage available starting at the specified directory (known as a mount point).
例えば、パーティション /dev/hda5/usr/ に マウントされている場合、これは /usr/ の基にある全てのファイルとディレクトリは物理的に /dev/hda5 上に存在することになります。 そして、ファイル /usr/share/doc/FAQ/txt/Linux-FAQ/dev/hda5 に保存され、ファイル /etc/gdm/custom.conf はそこには保存されません。
Continuing our example, it is also possible that one or more directories below /usr/ would be mount points for other partitions. For instance, a partition (say, /dev/hda7) could be mounted on /usr/local/, meaning that /usr/local/man/whatis would then reside on /dev/hda7 rather than /dev/hda5.

A.1.8. How Many Partitions?

At this point in the process of preparing to install Fedora, you must give some consideration to the number and size of the partitions to be used by your new operating system. The question of "how many partitions" continues to spark debate within the Linux community and, without any end to the debate in sight, it is safe to say that there are probably as many partition layouts as there are people debating the issue.
これを心に留めている状態で、他の方法で実行する理由がない限りは、少くとも以下のようなパーティションの作成が推奨されます: swap/boot/、及び、 / (root)。
詳細は、「Recommended Partitioning Scheme」 を参照して下さい。


[6] ブロックは、ここにあるイラストとは異り、実際には均一な サイズを持ちます。覚えておくべき事は、平均的ディスクドライブは数千のブロックを含んでいるという事です。しかしここにある説明の為の例が実際とは異ることを承知して下さい。