| 1 |
<?xml version='1.0' encoding='UTF-8'?>
|
| 2 |
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
|
| 3 |
|
| 4 |
<!-- The content of this document is licensed under the CC-BY-SA license -->
|
| 5 |
<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
|
| 6 |
|
| 7 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc64-disk.xml,v 1.9 2004/11/15 12:47:47 swift Exp $ -->
|
| 8 |
|
| 9 |
<sections>
|
| 10 |
|
| 11 |
<version>1.7</version>
|
| 12 |
<date>2004-11-02</date>
|
| 13 |
|
| 14 |
<section>
|
| 15 |
<title>Introduction to Block Devices</title>
|
| 16 |
<subsection>
|
| 17 |
<title>Block Devices</title>
|
| 18 |
<body>
|
| 19 |
|
| 20 |
<p>
|
| 21 |
We'll take a good look at disk-oriented aspects of Gentoo Linux
|
| 22 |
and Linux in general, including Linux filesystems, partitions and block devices.
|
| 23 |
Then, once you're familiar with the ins and outs of disks and filesystems,
|
| 24 |
you'll be guided through the process of setting up partitions and filesystems
|
| 25 |
for your Gentoo Linux installation.
|
| 26 |
</p>
|
| 27 |
|
| 28 |
<p>
|
| 29 |
To begin, we'll introduce <e>block devices</e>. The most famous block device is
|
| 30 |
probably the one that represents the first IDE drive in a Linux system, namely
|
| 31 |
<path>/dev/hda</path>. If your system uses SCSI drives, then your first hard
|
| 32 |
drive would be <path>/dev/sda</path>. Serial ATA drives are also
|
| 33 |
<path>/dev/sda</path> even if they are IDE drives.
|
| 34 |
</p>
|
| 35 |
|
| 36 |
<p>
|
| 37 |
The block devices above represent an abstract interface to the disk. User
|
| 38 |
programs can use these block devices to interact with your disk without worrying
|
| 39 |
about whether your drives are IDE, SCSI or something else. The program can
|
| 40 |
simply address the storage on the disk as a bunch of contiguous,
|
| 41 |
randomly-accessible 512-byte blocks.
|
| 42 |
</p>
|
| 43 |
|
| 44 |
</body>
|
| 45 |
</subsection>
|
| 46 |
<subsection>
|
| 47 |
<title>Partitions and Slices</title>
|
| 48 |
<body>
|
| 49 |
|
| 50 |
<p>
|
| 51 |
Although it is theoretically possible to use a full disk to house your Linux
|
| 52 |
system, this is almost never done in practice. Instead, full disk block devices
|
| 53 |
are split up in smaller, more manageable block devices. On most systems,
|
| 54 |
these are called <e>partitions</e>. Other architectures use a similar technique,
|
| 55 |
called <e>slices</e>.
|
| 56 |
</p>
|
| 57 |
|
| 58 |
</body>
|
| 59 |
</subsection>
|
| 60 |
</section>
|
| 61 |
<section>
|
| 62 |
<title>Designing a Partitioning Scheme</title>
|
| 63 |
<subsection>
|
| 64 |
<title>Default Partitioning Scheme</title>
|
| 65 |
<body>
|
| 66 |
|
| 67 |
<p>
|
| 68 |
If you are not interested in drawing up a partitioning scheme for your system,
|
| 69 |
you can use the partitioning scheme we use throughout this book:
|
| 70 |
</p>
|
| 71 |
|
| 72 |
<table>
|
| 73 |
<tr>
|
| 74 |
<th>Partition</th>
|
| 75 |
<th>Filesystem</th>
|
| 76 |
<th>Size</th>
|
| 77 |
<th>Description</th>
|
| 78 |
</tr>
|
| 79 |
<tr>
|
| 80 |
<ti><path>/dev/sda1</path></ti>
|
| 81 |
<ti>Partition map</ti>
|
| 82 |
<ti>31.5k</ti>
|
| 83 |
<ti>Partition map</ti>
|
| 84 |
</tr>
|
| 85 |
<tr>
|
| 86 |
<ti><path>/dev/sda2</path></ti>
|
| 87 |
<ti>(bootstrap)</ti>
|
| 88 |
<ti>800k</ti>
|
| 89 |
<ti>Apple_Bootstrap</ti>
|
| 90 |
</tr>
|
| 91 |
<tr>
|
| 92 |
<ti><path>/dev/sda3</path></ti>
|
| 93 |
<ti>(swap)</ti>
|
| 94 |
<ti>512M</ti>
|
| 95 |
<ti>Swap partition</ti>
|
| 96 |
</tr>
|
| 97 |
<tr>
|
| 98 |
<ti><path>/dev/sda4</path></ti>
|
| 99 |
<ti>ext3</ti>
|
| 100 |
<ti>Rest of the disk</ti>
|
| 101 |
<ti>Root partition</ti>
|
| 102 |
</tr>
|
| 103 |
</table>
|
| 104 |
|
| 105 |
<note>
|
| 106 |
There are some partitions named like this: <path>Apple_Driver43,
|
| 107 |
Apple_Driver_ATA, Apple_FWDriver, Apple_Driver_IOKit,
|
| 108 |
Apple_Patches</path>. If you are not planning to use MacOS 9 you can
|
| 109 |
delete them, because MacOS X and Linux don't need them.
|
| 110 |
You might have to use parted in order to delete them, as mac-fdisk can't delete them yet.
|
| 111 |
</note>
|
| 112 |
|
| 113 |
<p>
|
| 114 |
If you are interested in knowing how big a partition should be, or even how
|
| 115 |
many partitions you need, read on. Otherwise continue now with
|
| 116 |
<uri link="#mac-fdisk">Apple G5: Using mac-fdisk to Partition your
|
| 117 |
Disk</uri> or <uri link="#fdisk">IBM pSeries: using fdisk to Partition
|
| 118 |
your Disk</uri>
|
| 119 |
</p>
|
| 120 |
|
| 121 |
</body>
|
| 122 |
</subsection>
|
| 123 |
<subsection>
|
| 124 |
<title>How Many and How Big?</title>
|
| 125 |
<body>
|
| 126 |
|
| 127 |
<p>
|
| 128 |
The number of partitions is highly dependent on your environment. For instance,
|
| 129 |
if you have lots of users, you will most likely want to have your
|
| 130 |
<path>/home</path> separate as it increases security and makes backups easier.
|
| 131 |
If you are installing Gentoo to perform as a mailserver, your
|
| 132 |
<path>/var</path> should be separate as all mails are stored inside
|
| 133 |
<path>/var</path>. A good choice of filesystem will then maximise your
|
| 134 |
performance. Gameservers will have a separate <path>/opt</path> as most gaming
|
| 135 |
servers are installed there. The reason is similar for <path>/home</path>:
|
| 136 |
security and backups.
|
| 137 |
</p>
|
| 138 |
|
| 139 |
<p>
|
| 140 |
As you can see, it very much depends on what you want to achieve. Separate
|
| 141 |
partitions or volumes have the following advantages:
|
| 142 |
</p>
|
| 143 |
|
| 144 |
<ul>
|
| 145 |
<li>
|
| 146 |
You can choose the best performing filesystem for each partition or volume
|
| 147 |
</li>
|
| 148 |
<li>
|
| 149 |
Your entire system cannot run out of free space if one defunct tool is
|
| 150 |
continuously writing files to a partition or volume
|
| 151 |
</li>
|
| 152 |
<li>
|
| 153 |
If necessary, file system checks are reduced in time, as multiple checks can
|
| 154 |
be done in parallel (although this advantage is more with multiple disks than
|
| 155 |
it is with multiple partitions)
|
| 156 |
</li>
|
| 157 |
<li>
|
| 158 |
Security can be enhanced by mounting some partitions or volumes read-only,
|
| 159 |
nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
|
| 160 |
</li>
|
| 161 |
</ul>
|
| 162 |
|
| 163 |
<p>
|
| 164 |
However, multiple partitions have one big disadvantage: if not configured
|
| 165 |
properly, you might result in having a system with lots
|
| 166 |
of free space on one partition and none on another. There is also a 15-partition
|
| 167 |
limit for SCSI and SATA.
|
| 168 |
</p>
|
| 169 |
|
| 170 |
</body>
|
| 171 |
</subsection>
|
| 172 |
</section>
|
| 173 |
<section id="mac-fdisk">
|
| 174 |
<title>Default: Using mac-fdisk (Apple G5) Partition your Disk</title>
|
| 175 |
<body>
|
| 176 |
|
| 177 |
<p>
|
| 178 |
At this point, create your partitions using <c>mac-fdisk</c>:
|
| 179 |
</p>
|
| 180 |
|
| 181 |
<pre caption="Starting mac-fdisk">
|
| 182 |
# <i>mac-fdisk /dev/sda</i>
|
| 183 |
</pre>
|
| 184 |
|
| 185 |
<p>
|
| 186 |
First delete the partitions you have cleared previously to make room for your
|
| 187 |
Linux partitions. Use <c>d</c> in <c>mac-fdisk</c> to delete those partition(s).
|
| 188 |
It will ask for the partition number to delete.
|
| 189 |
</p>
|
| 190 |
|
| 191 |
<p>
|
| 192 |
Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will
|
| 193 |
ask for what block you want to start. Enter the number of your first free
|
| 194 |
partition, followed by a <c>p</c>. For instance this is <c>1p</c>.
|
| 195 |
</p>
|
| 196 |
|
| 197 |
<note>
|
| 198 |
This partition is <e>not</e> a "boot" partition. It is not used by Linux at all;
|
| 199 |
you don't have to place any filesystem on it and you should never mount it. PPC
|
| 200 |
users don't need a an extra partition for <path>/boot</path>.
|
| 201 |
</note>
|
| 202 |
|
| 203 |
<p>
|
| 204 |
Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will
|
| 205 |
ask for what block you want to start this partition from. As we used <c>1</c>
|
| 206 |
before to create the Apple_Bootstrap partition, you now have to enter
|
| 207 |
<c>2p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size
|
| 208 |
you want -- 512MB is recommended though). When asked for a name, enter <c>swap</c>
|
| 209 |
(mandatory).
|
| 210 |
</p>
|
| 211 |
|
| 212 |
<p>
|
| 213 |
To create the root partition, enter <c>c</c>, followed by <c>3p</c> to select
|
| 214 |
from what block the root partition should start. When asked for the size, enter
|
| 215 |
<c>3p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available
|
| 216 |
space". When asked for the name, enter <c>root</c> (mandatory).
|
| 217 |
</p>
|
| 218 |
|
| 219 |
<p>
|
| 220 |
To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to
|
| 221 |
quit <c>mac-fdisk</c>.
|
| 222 |
</p>
|
| 223 |
|
| 224 |
<note>
|
| 225 |
To make sure everything is ok, you should run mac-fdisk once more and check whether all the partitions are there.
|
| 226 |
If you don't see any of the partitions you created, or the changes you made, you should reinitialize your partitions by pressing "i" in mac-fdisk.
|
| 227 |
Note that this will recreate the partition map and thus remove all your partitions.
|
| 228 |
</note>
|
| 229 |
|
| 230 |
<p>
|
| 231 |
Now that your partitions are created, you can now continue with <uri
|
| 232 |
link="#filesystems">Creating Filesystems</uri>.
|
| 233 |
</p>
|
| 234 |
|
| 235 |
</body>
|
| 236 |
</section>
|
| 237 |
<section id="fdisk">
|
| 238 |
<title>IBM pSeries: using fdisk to Partition your Disk</title>
|
| 239 |
<subsection>
|
| 240 |
<body>
|
| 241 |
|
| 242 |
<p>
|
| 243 |
The following parts explain how to create the example partition layout
|
| 244 |
described previously, namely:
|
| 245 |
</p>
|
| 246 |
|
| 247 |
<table>
|
| 248 |
<tr>
|
| 249 |
<th>Partition</th>
|
| 250 |
<th>Description</th>
|
| 251 |
</tr>
|
| 252 |
<tr>
|
| 253 |
<ti><path>/dev/sda1</path></ti>
|
| 254 |
<ti>PPC PReP Boot partition</ti>
|
| 255 |
</tr>
|
| 256 |
<tr>
|
| 257 |
<ti><path>/dev/sda2</path></ti>
|
| 258 |
<ti>Swap partition</ti>
|
| 259 |
</tr>
|
| 260 |
<tr>
|
| 261 |
<ti><path>/dev/sda3</path></ti>
|
| 262 |
<ti>Root partition</ti>
|
| 263 |
</tr>
|
| 264 |
</table>
|
| 265 |
|
| 266 |
<p>
|
| 267 |
Change your partition layout according to your own preference.
|
| 268 |
</p>
|
| 269 |
|
| 270 |
</body>
|
| 271 |
</subsection>
|
| 272 |
<subsection>
|
| 273 |
<title>Viewing the Current Partition Layout</title>
|
| 274 |
<body>
|
| 275 |
|
| 276 |
<p>
|
| 277 |
<c>fdisk</c> is a popular and powerful tool to split your disk into
|
| 278 |
partitions. Fire up <c>fdisk</c> on your disk (in our example, we
|
| 279 |
use <path>/dev/sda</path>):
|
| 280 |
</p>
|
| 281 |
|
| 282 |
<pre caption="Starting fdisk">
|
| 283 |
# <i>fdisk /dev/sda</i>
|
| 284 |
</pre>
|
| 285 |
|
| 286 |
<p>
|
| 287 |
Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like
|
| 288 |
this:
|
| 289 |
</p>
|
| 290 |
|
| 291 |
<pre caption="fdisk prompt">
|
| 292 |
Command (m for help):
|
| 293 |
</pre>
|
| 294 |
|
| 295 |
<p>
|
| 296 |
Type <c>p</c> to display your disk's current partition configuration:
|
| 297 |
</p>
|
| 298 |
|
| 299 |
<pre caption="An example partition configuration">
|
| 300 |
Command (m for help): p
|
| 301 |
|
| 302 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 303 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 304 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 305 |
|
| 306 |
Device Boot Start End Blocks Id System
|
| 307 |
/dev/hdb1 1 12 53266+ 83 Linux
|
| 308 |
/dev/hdb2 13 233 981571+ 82 Linux swap
|
| 309 |
/dev/hdb3 234 674 1958701+ 83 Linux
|
| 310 |
/dev/hdb4 675 6761 27035410+ 5 Extended
|
| 311 |
/dev/hdb5 675 2874 9771268+ 83 Linux
|
| 312 |
/dev/hdb6 2875 2919 199836 83 Linux
|
| 313 |
/dev/hdb7 2920 3008 395262 83 Linux
|
| 314 |
/dev/hdb8 3009 6761 16668918 83 Linux
|
| 315 |
|
| 316 |
Command (m for help):
|
| 317 |
</pre>
|
| 318 |
|
| 319 |
<p>
|
| 320 |
This particular disk is configured to house seven Linux filesystems
|
| 321 |
(each with a corresponding partition listed as "Linux") as well as a
|
| 322 |
swap partition (listed as "Linux swap").
|
| 323 |
</p>
|
| 324 |
|
| 325 |
</body>
|
| 326 |
</subsection>
|
| 327 |
<subsection>
|
| 328 |
<title>Removing all Partitions</title>
|
| 329 |
<body>
|
| 330 |
|
| 331 |
<p>
|
| 332 |
We will first remove all existing partitions from the disk. Type
|
| 333 |
<c>d</c> to delete a partition. For instance, to delete an existing
|
| 334 |
<path>/dev/sda1</path>:
|
| 335 |
</p>
|
| 336 |
|
| 337 |
<note>If you don't want to delete all partitions just delete those you
|
| 338 |
want to delete. At this point the author recommends a backup of your
|
| 339 |
data to avoid the lose of it.
|
| 340 |
</note>
|
| 341 |
|
| 342 |
<pre caption="Deleting a partition">
|
| 343 |
Command (m for help): <i>d</i>
|
| 344 |
Partition number (1-4): <i>1</i>
|
| 345 |
</pre>
|
| 346 |
|
| 347 |
<p>
|
| 348 |
The partition has been scheduled for deletion. It will no longer show up
|
| 349 |
if you type <c>p</c>, but it will not be erased until your changes have
|
| 350 |
been saved. If you made a mistake and want to abort without saving your
|
| 351 |
changes, type <c>q</c> immediately and hit enter and your partition will
|
| 352 |
not be deleted.
|
| 353 |
</p>
|
| 354 |
|
| 355 |
<p>
|
| 356 |
Now, assuming that you do indeed want to wipe out all the partitions on
|
| 357 |
your system, repeatedly type <c>p</c> to print out a partition listing
|
| 358 |
and then type <c>d</c> and the number of the partition to delete it.
|
| 359 |
Eventually, you'll end up with a partition table with nothing in it:
|
| 360 |
</p>
|
| 361 |
|
| 362 |
<pre caption="An empty partition table">
|
| 363 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 364 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 365 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 366 |
|
| 367 |
Device Boot Start End Blocks Id System
|
| 368 |
|
| 369 |
Command (m for help):
|
| 370 |
</pre>
|
| 371 |
|
| 372 |
<p>
|
| 373 |
Now that the in-memory partition table is empty, we're ready to create
|
| 374 |
the partitions. We will use a default partitioning scheme as discussed
|
| 375 |
previously. Of course, don't follow these instructions to the letter if
|
| 376 |
you don't want the same partitioning scheme!
|
| 377 |
</p>
|
| 378 |
|
| 379 |
</body>
|
| 380 |
</subsection>
|
| 381 |
<subsection>
|
| 382 |
<title>Creating the PPC PReP boot partition</title>
|
| 383 |
<body>
|
| 384 |
|
| 385 |
<p>
|
| 386 |
We first create a small PReP boot partition. Type <c>n</c> to create a new
|
| 387 |
partition, then <c>p</c> to select a primary partition, followed by
|
| 388 |
<c>1</c> to select the first primary partition. When prompted for the
|
| 389 |
first cylinder, hit enter. When prompted for the last cylinder, type
|
| 390 |
<c>+7M</c> to create a partition 7 Mbyte in size. After you've done
|
| 391 |
this, type <c>t</c> to set the partition type, <c>1</c> to select the
|
| 392 |
partition you just created and then type in <c>41</c> to set the
|
| 393 |
partition type to "PPC PReP Boot".
|
| 394 |
</p>
|
| 395 |
|
| 396 |
<note>
|
| 397 |
The PReP partition has to be smaller than 8 MByte!
|
| 398 |
</note>
|
| 399 |
|
| 400 |
<pre caption="Crating to PReP boot partition">
|
| 401 |
Command (m for help): <i>p</i>
|
| 402 |
|
| 403 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 404 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 405 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 406 |
|
| 407 |
Device Boot Start End Blocks Id System
|
| 408 |
|
| 409 |
Command (m for help): <i>n</i>
|
| 410 |
Command action
|
| 411 |
e extended
|
| 412 |
p primary partition (1-4)
|
| 413 |
<i>p</i>
|
| 414 |
Partition number (1-4): <i>1</i>
|
| 415 |
First cylinder (1-6761, default 1):
|
| 416 |
Using default value 1
|
| 417 |
Last cylinder or +size or +sizeM or +sizeK (1-6761, default
|
| 418 |
6761): <i>+8M</i>
|
| 419 |
|
| 420 |
Command (m for help): <i>t</i>
|
| 421 |
Selected partition 1
|
| 422 |
Hex code (type L to list codes): <i>41</i>
|
| 423 |
Changed system type of partition 1 to 41 (PPC PReP Boot)
|
| 424 |
|
| 425 |
Command (m for help):
|
| 426 |
</pre>
|
| 427 |
|
| 428 |
<p>
|
| 429 |
Now, when you type <c>p</c>, you should see the following partition
|
| 430 |
printout:
|
| 431 |
</p>
|
| 432 |
|
| 433 |
<pre caption="Created boot partition">
|
| 434 |
Command (m for help): <i>p</i>
|
| 435 |
|
| 436 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 437 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 438 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 439 |
|
| 440 |
Device Boot Start End Blocks Id System
|
| 441 |
/dev/hdb1 1 3 13293 41 PPC PReP Boot
|
| 442 |
|
| 443 |
Command (m for help):
|
| 444 |
</pre>
|
| 445 |
</body>
|
| 446 |
</subsection>
|
| 447 |
<subsection>
|
| 448 |
<title>Creating the Swap Partition</title>
|
| 449 |
<body>
|
| 450 |
|
| 451 |
<p>
|
| 452 |
Let's now create the swap partition. To do this, type <c>n</c> to create
|
| 453 |
a new partition, then <c>p</c> to tell fdisk that you want a primary
|
| 454 |
partition. Then type <c>2</c> to create the second primary partition,
|
| 455 |
<path>/dev/sda2</path> in our case. When prompted for the first
|
| 456 |
cylinder, hit enter. When prompted for the last cylinder, type
|
| 457 |
<c>+512M</c> to create a partition 512MB in size. After you've done
|
| 458 |
this, type <c>t</c> to set the partition type, <c>2</c> to select the
|
| 459 |
partition you just created and then type in <c>82</c> to set the
|
| 460 |
partition type to "Linux Swap". After completing these steps, typing
|
| 461 |
<c>p</c> should display a partition table that looks similar to this:
|
| 462 |
</p>
|
| 463 |
|
| 464 |
<pre caption="Partition listing after creating a swap partition">
|
| 465 |
Command (m for help): <i>p</i>
|
| 466 |
|
| 467 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 468 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 469 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 470 |
|
| 471 |
Device Boot Start End Blocks Id System
|
| 472 |
/dev/hdb1 1 3 13293 41 PPC PReP Boot
|
| 473 |
/dev/hdb2 4 117 506331 82 Linux swap
|
| 474 |
|
| 475 |
Command (m for help):
|
| 476 |
</pre>
|
| 477 |
|
| 478 |
</body>
|
| 479 |
</subsection>
|
| 480 |
<subsection>
|
| 481 |
<title>Creating the Root Partition</title>
|
| 482 |
<body>
|
| 483 |
|
| 484 |
<p>
|
| 485 |
Finally, let's create the root partition. To do this, type <c>n</c> to
|
| 486 |
create a new partition, then <c>p</c> to tell fdisk that you want a
|
| 487 |
primary partition. Then type <c>3</c> to create the third primary
|
| 488 |
partition, <path>/dev/sda3</path> in our case. When prompted for the
|
| 489 |
first cylinder, hit enter. When prompted for the last cylinder, hit
|
| 490 |
enter to create a partition that takes up the rest of the remaining
|
| 491 |
space on your disk. After completing these steps, typing <c>p</c> should
|
| 492 |
display a partition table that looks similar to this:
|
| 493 |
</p>
|
| 494 |
|
| 495 |
<pre caption="Partition listing after creating the root partition">
|
| 496 |
Command (m for help): p
|
| 497 |
|
| 498 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 499 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 500 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 501 |
|
| 502 |
Device Boot Start End Blocks Id System
|
| 503 |
/dev/hdb1 1 3 13293 41 PPC PReP Boot
|
| 504 |
/dev/hdb2 4 117 506331 82 Linux swap
|
| 505 |
/dev/hdb3 118 6761 29509326 83 Linux
|
| 506 |
|
| 507 |
Command (m for help):
|
| 508 |
</pre>
|
| 509 |
</body>
|
| 510 |
</subsection>
|
| 511 |
<subsection>
|
| 512 |
<title>Saving the Partition Layout</title>
|
| 513 |
<body>
|
| 514 |
|
| 515 |
<p>
|
| 516 |
To save the partition layout and exit <c>fdisk</c>, type <c>w</c>.
|
| 517 |
</p>
|
| 518 |
|
| 519 |
<pre caption="Save and exit fdisk">
|
| 520 |
Command (m for help): <i>w</i>
|
| 521 |
</pre>
|
| 522 |
|
| 523 |
<p>
|
| 524 |
Now that your partitions are created, you can now continue with <uri
|
| 525 |
link="#filesystems">Creating Filesystems</uri>.
|
| 526 |
</p>
|
| 527 |
|
| 528 |
</body>
|
| 529 |
</subsection>
|
| 530 |
<subsection>
|
| 531 |
<title>Filesystems?</title>
|
| 532 |
<body>
|
| 533 |
|
| 534 |
<note>
|
| 535 |
Several filesystems are available. Ext2 and ext3 are found stable on the
|
| 536 |
PPC64 architecture, reiserfs and xfs are in experimental stage. jfs is
|
| 537 |
unsupported.
|
| 538 |
</note>
|
| 539 |
|
| 540 |
<p>
|
| 541 |
<b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
|
| 542 |
journaling, which means that routine ext2 filesystem checks at startup time can
|
| 543 |
be quite time-consuming. There is now quite a selection of newer-generation
|
| 544 |
journaled filesystems that can be checked for consistency very quickly and are
|
| 545 |
thus generally preferred over their non-journaled counterparts. Journaled
|
| 546 |
filesystems prevent long delays when you boot your system and your filesystem
|
| 547 |
happens to be in an inconsistent state.
|
| 548 |
</p>
|
| 549 |
|
| 550 |
<p>
|
| 551 |
<b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
|
| 552 |
journaling for fast recovery in addition to other enhanced journaling modes like
|
| 553 |
full data and ordered data journaling. ext3 is a very good and reliable
|
| 554 |
filesystem. It has an additional hashed b-tree indexing option that enables
|
| 555 |
high performance in almost all situations. In short, ext3 is an excellent
|
| 556 |
filesystem.
|
| 557 |
</p>
|
| 558 |
|
| 559 |
<p>
|
| 560 |
<b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
|
| 561 |
performance and greatly outperforms both ext2 and ext3 when dealing with small
|
| 562 |
files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
|
| 563 |
extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
|
| 564 |
solid and usable as both general-purpose filesystem and for extreme cases such
|
| 565 |
as the creation of large filesystems, the use of many small files, very large
|
| 566 |
files and directories containing tens of thousands of files.
|
| 567 |
</p>
|
| 568 |
|
| 569 |
<p>
|
| 570 |
<b>XFS</b> is a filesystem with metadata journaling that is fully supported
|
| 571 |
under Gentoo Linux's xfs-sources kernel. It comes with a robust feature-set and
|
| 572 |
is optimized for scalability. We only recommend using this filesystem on Linux
|
| 573 |
systems with high-end SCSI and/or fibre channel storage and a uninterruptible
|
| 574 |
power supply. Because XFS aggressively caches in-transit data in RAM, improperly
|
| 575 |
designed programs (those that don't take proper precautions when writing files
|
| 576 |
to disk and there are quite a few of them) can lose a good deal of data if the
|
| 577 |
system goes down unexpectedly.
|
| 578 |
</p>
|
| 579 |
|
| 580 |
<p>
|
| 581 |
<b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
|
| 582 |
become production-ready and there hasn't been a sufficient track record to
|
| 583 |
comment positively nor negatively on its general stability at this point.
|
| 584 |
</p>
|
| 585 |
|
| 586 |
</body>
|
| 587 |
</subsection>
|
| 588 |
<subsection id="filesystems-apply">
|
| 589 |
<title>Applying a Filesystem to a Partition</title>
|
| 590 |
<body>
|
| 591 |
|
| 592 |
<p>
|
| 593 |
To create a filesystem on a partition or volume, there are tools available for
|
| 594 |
each possible filesystem:
|
| 595 |
</p>
|
| 596 |
|
| 597 |
<table>
|
| 598 |
<tr>
|
| 599 |
<th>Filesystem</th>
|
| 600 |
<th>Creation Command</th>
|
| 601 |
</tr>
|
| 602 |
<tr>
|
| 603 |
<ti>ext2</ti>
|
| 604 |
<ti><c>mke2fs</c></ti>
|
| 605 |
</tr>
|
| 606 |
<tr>
|
| 607 |
<ti>ext3</ti>
|
| 608 |
<ti><c>mke2fs -j</c></ti>
|
| 609 |
</tr>
|
| 610 |
<tr>
|
| 611 |
<ti>reiserfs</ti>
|
| 612 |
<ti><c>mkreiserfs</c></ti>
|
| 613 |
</tr>
|
| 614 |
<tr>
|
| 615 |
<ti>xfs</ti>
|
| 616 |
<ti><c>mkfs.xfs</c></ti>
|
| 617 |
</tr>
|
| 618 |
<tr>
|
| 619 |
<ti>jfs</ti>
|
| 620 |
<ti><c>mkfs.jfs</c></ti>
|
| 621 |
</tr>
|
| 622 |
</table>
|
| 623 |
|
| 624 |
<p>
|
| 625 |
For instance, to have the root partition (<path>/dev/sda4</path> in our example)
|
| 626 |
in ext3 (as in our example), you would use:
|
| 627 |
</p>
|
| 628 |
|
| 629 |
<pre caption="Applying a filesystem on a partition">
|
| 630 |
# <i>mke2fs -j /dev/sda4</i>
|
| 631 |
</pre>
|
| 632 |
|
| 633 |
<p>
|
| 634 |
Now create the filesystems on your newly created partitions (or logical
|
| 635 |
volumes).
|
| 636 |
</p>
|
| 637 |
|
| 638 |
</body>
|
| 639 |
</subsection>
|
| 640 |
<subsection>
|
| 641 |
<title>Activating the Swap Partition</title>
|
| 642 |
<body>
|
| 643 |
|
| 644 |
<p>
|
| 645 |
<c>mkswap</c> is the command that is used to initialize swap partitions:
|
| 646 |
</p>
|
| 647 |
|
| 648 |
<pre caption="Creating a Swap signature">
|
| 649 |
# <i>mkswap /dev/sda3</i>
|
| 650 |
</pre>
|
| 651 |
|
| 652 |
<p>
|
| 653 |
To activate the swap partition, use <c>swapon</c>:
|
| 654 |
</p>
|
| 655 |
|
| 656 |
<pre caption="Activating the swap partition">
|
| 657 |
# <i>swapon /dev/sda3</i>
|
| 658 |
</pre>
|
| 659 |
|
| 660 |
<p>
|
| 661 |
Create and activate the swap now.
|
| 662 |
</p>
|
| 663 |
|
| 664 |
</body>
|
| 665 |
</subsection>
|
| 666 |
</section>
|
| 667 |
<section>
|
| 668 |
<title>Mounting</title>
|
| 669 |
<body>
|
| 670 |
|
| 671 |
<p>
|
| 672 |
Now that your partitions are initialized and are housing a filesystem, it is
|
| 673 |
time to mount those partitions. Use the <c>mount</c> command. Don't forget to
|
| 674 |
create the necessary mount directories for every partition you created. As an
|
| 675 |
example we create a mount-point and mount the root and boot partition:
|
| 676 |
</p>
|
| 677 |
|
| 678 |
<pre caption="Mounting partitions">
|
| 679 |
# <i>mkdir /mnt/gentoo</i>
|
| 680 |
# <i>mount /dev/sda4 /mnt/gentoo</i>
|
| 681 |
</pre>
|
| 682 |
|
| 683 |
<note>
|
| 684 |
If you want your <path>/tmp</path> to reside on a separate partition, be sure to
|
| 685 |
change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
|
| 686 |
also holds for <path>/var/tmp</path>.
|
| 687 |
</note>
|
| 688 |
|
| 689 |
<p>
|
| 690 |
Finally we have to create the <path>/dev</path> files in our new home, which is
|
| 691 |
needed during the bootloader installation. This could be done by "bind"-mapping
|
| 692 |
the <path>/dev</path>-filesystem from the LiveCD:
|
| 693 |
</p>
|
| 694 |
|
| 695 |
<pre caption="Bind-mounting the /dev-filesystem">
|
| 696 |
# <i>mkdir /mnt/gentoo/dev</i>
|
| 697 |
# <i>mount -o bind /dev /mnt/gentoo/dev</i>
|
| 698 |
</pre>
|
| 699 |
|
| 700 |
<p>
|
| 701 |
We will also have to mount the proc filesystem (a virtual interface with the
|
| 702 |
kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
|
| 703 |
</p>
|
| 704 |
|
| 705 |
<p>
|
| 706 |
Continue with <uri link="?part=1&chap=5">Installing the Gentoo
|
| 707 |
Installation Files</uri>.
|
| 708 |
</p>
|
| 709 |
|
| 710 |
</body>
|
| 711 |
</section>
|
| 712 |
</sections>
|