| 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/2.5 -->
|
| 6 |
|
| 7 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc64-disk.xml,v 1.38 2012/10/28 10:29:03 swift Exp $ -->
|
| 8 |
|
| 9 |
<sections>
|
| 10 |
|
| 11 |
<abstract>
|
| 12 |
To be able to install Gentoo, you must create the necessary partitions.
|
| 13 |
This chapter describes how to partition a disk for future usage.
|
| 14 |
</abstract>
|
| 15 |
|
| 16 |
<version>14</version>
|
| 17 |
<date>2013-02-23</date>
|
| 18 |
|
| 19 |
<section>
|
| 20 |
<title>Introduction to Block Devices</title>
|
| 21 |
|
| 22 |
<subsection>
|
| 23 |
<include href="hb-install-blockdevices.xml"/>
|
| 24 |
</subsection>
|
| 25 |
|
| 26 |
<subsection>
|
| 27 |
<title>Partitions and Slices</title>
|
| 28 |
<body>
|
| 29 |
|
| 30 |
<p>
|
| 31 |
Although it is theoretically possible to use a full disk to house your Linux
|
| 32 |
system, this is almost never done in practice. Instead, full disk block devices
|
| 33 |
are split up in smaller, more manageable block devices. On most systems,
|
| 34 |
these are called <e>partitions</e>. Other architectures use a similar technique,
|
| 35 |
called <e>slices</e>.
|
| 36 |
</p>
|
| 37 |
|
| 38 |
</body>
|
| 39 |
</subsection>
|
| 40 |
</section>
|
| 41 |
<section>
|
| 42 |
<title>Designing a Partitioning Scheme</title>
|
| 43 |
<subsection>
|
| 44 |
<title>Default Partitioning Scheme</title>
|
| 45 |
<body>
|
| 46 |
|
| 47 |
<p>
|
| 48 |
If you are not interested in drawing up a partitioning scheme for your system,
|
| 49 |
you can use the partitioning scheme we use throughout this book:
|
| 50 |
</p>
|
| 51 |
|
| 52 |
<table>
|
| 53 |
<tr>
|
| 54 |
<th>Partition</th>
|
| 55 |
<th>Filesystem</th>
|
| 56 |
<th>Size</th>
|
| 57 |
<th>Description</th>
|
| 58 |
</tr>
|
| 59 |
<tr>
|
| 60 |
<ti><path>/dev/sda1</path></ti>
|
| 61 |
<ti>Partition map</ti>
|
| 62 |
<ti>31.5k</ti>
|
| 63 |
<ti>Partition map</ti>
|
| 64 |
</tr>
|
| 65 |
<tr>
|
| 66 |
<ti><path>/dev/sda2</path></ti>
|
| 67 |
<ti>(bootstrap)</ti>
|
| 68 |
<ti>800k</ti>
|
| 69 |
<ti>Apple_Bootstrap</ti>
|
| 70 |
</tr>
|
| 71 |
<tr>
|
| 72 |
<ti><path>/dev/sda3</path></ti>
|
| 73 |
<ti>(swap)</ti>
|
| 74 |
<ti>512M</ti>
|
| 75 |
<ti>Swap partition</ti>
|
| 76 |
</tr>
|
| 77 |
<tr>
|
| 78 |
<ti><path>/dev/sda4</path></ti>
|
| 79 |
<ti>ext3 or ext4</ti>
|
| 80 |
<ti>Rest of the disk</ti>
|
| 81 |
<ti>Root partition</ti>
|
| 82 |
</tr>
|
| 83 |
</table>
|
| 84 |
|
| 85 |
<note>
|
| 86 |
There are some partitions named like this: <path>Apple_Driver43</path>,
|
| 87 |
<path>Apple_Driver_ATA</path>, <path>Apple_FWDriver</path>,
|
| 88 |
<path>Apple_Driver_IOKit</path>, and <path>Apple_Patches</path>. If you are not
|
| 89 |
planning to use MacOS 9 you can delete them, because MacOS X and Linux don't
|
| 90 |
need them. You might have to use parted in order to delete them, as mac-fdisk
|
| 91 |
can't delete them yet.
|
| 92 |
</note>
|
| 93 |
|
| 94 |
<p>
|
| 95 |
If you are interested in knowing how big a partition should be, or even how
|
| 96 |
many partitions you need, read on. Otherwise continue now with
|
| 97 |
<uri link="#mac-fdisk">Apple G5: Using mac-fdisk to Partition your
|
| 98 |
Disk</uri> or <uri link="#fdisk">IBM pSeries: using fdisk to Partition
|
| 99 |
your Disk</uri>
|
| 100 |
</p>
|
| 101 |
|
| 102 |
</body>
|
| 103 |
</subsection>
|
| 104 |
<subsection>
|
| 105 |
<title>How Many and How Big?</title>
|
| 106 |
<body>
|
| 107 |
|
| 108 |
<p>
|
| 109 |
The number of partitions is highly dependent on your environment. For instance,
|
| 110 |
if you have lots of users, you will most likely want to have your
|
| 111 |
<path>/home</path> separate as it increases security and makes backups easier.
|
| 112 |
If you are installing Gentoo to perform as a mailserver, your <path>/var</path>
|
| 113 |
should be separate as all mails are stored inside <path>/var</path>. A good
|
| 114 |
choice of filesystem will then maximise your performance. Gameservers will have
|
| 115 |
a separate <path>/opt</path> as most gaming servers are installed there. The
|
| 116 |
reason is similar for <path>/home</path>: security and backups. You will
|
| 117 |
definitely want to keep <path>/usr</path> big: not only will it contain the
|
| 118 |
majority of applications, the Portage tree alone takes around 500 Mbyte
|
| 119 |
excluding the various sources that are stored in it.
|
| 120 |
</p>
|
| 121 |
|
| 122 |
<p>
|
| 123 |
As you can see, it very much depends on what you want to achieve. Separate
|
| 124 |
partitions or volumes have the following advantages:
|
| 125 |
</p>
|
| 126 |
|
| 127 |
<ul>
|
| 128 |
<li>
|
| 129 |
You can choose the best performing filesystem for each partition or volume
|
| 130 |
</li>
|
| 131 |
<li>
|
| 132 |
Your entire system cannot run out of free space if one defunct tool is
|
| 133 |
continuously writing files to a partition or volume
|
| 134 |
</li>
|
| 135 |
<li>
|
| 136 |
If necessary, file system checks are reduced in time, as multiple checks can
|
| 137 |
be done in parallel (although this advantage is more with multiple disks than
|
| 138 |
it is with multiple partitions)
|
| 139 |
</li>
|
| 140 |
<li>
|
| 141 |
Security can be enhanced by mounting some partitions or volumes read-only,
|
| 142 |
nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
|
| 143 |
</li>
|
| 144 |
</ul>
|
| 145 |
|
| 146 |
<p>
|
| 147 |
However, multiple partitions have disadvantages as well. If not configured
|
| 148 |
properly, you will have a system with lots of free space on one partition and
|
| 149 |
none on another. Another nuisance is that separate partitions - especially
|
| 150 |
for important mountpoints like <path>/usr</path> or <path>/var</path> - often
|
| 151 |
require the administrator to boot with an initramfs to mount the partition
|
| 152 |
before other boot scripts start. This isn't always the case though, so your
|
| 153 |
results may vary.
|
| 154 |
</p>
|
| 155 |
|
| 156 |
<p>
|
| 157 |
There is also a 15-partition limit for SCSI and SATA.
|
| 158 |
</p>
|
| 159 |
|
| 160 |
</body>
|
| 161 |
</subsection>
|
| 162 |
</section>
|
| 163 |
<section id="mac-fdisk">
|
| 164 |
<title>Default: Using mac-fdisk (Apple G5) to Partition your Disk</title>
|
| 165 |
<body>
|
| 166 |
|
| 167 |
<p>
|
| 168 |
At this point, create your partitions using <c>mac-fdisk</c>:
|
| 169 |
</p>
|
| 170 |
|
| 171 |
<pre caption="Starting mac-fdisk">
|
| 172 |
# <i>mac-fdisk /dev/sda</i>
|
| 173 |
</pre>
|
| 174 |
|
| 175 |
<p>
|
| 176 |
First delete the partitions you have cleared previously to make room for your
|
| 177 |
Linux partitions. Use <c>d</c> in <c>mac-fdisk</c> to delete those partition(s).
|
| 178 |
It will ask for the partition number to delete.
|
| 179 |
</p>
|
| 180 |
|
| 181 |
<p>
|
| 182 |
Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will
|
| 183 |
ask for what block you want to start. Enter the number of your first free
|
| 184 |
partition, followed by a <c>p</c>. For instance this is <c>2p</c>.
|
| 185 |
</p>
|
| 186 |
|
| 187 |
<note>
|
| 188 |
This partition is <e>not</e> a "boot" partition. It is not used by Linux at all;
|
| 189 |
you don't have to place any filesystem on it and you should never mount it. PPC
|
| 190 |
users don't need an extra partition for <path>/boot</path>.
|
| 191 |
</note>
|
| 192 |
|
| 193 |
<p>
|
| 194 |
Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will
|
| 195 |
ask for what block you want to start this partition from. As we used <c>2</c>
|
| 196 |
before to create the Apple_Bootstrap partition, you now have to enter
|
| 197 |
<c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size
|
| 198 |
you want). When asked for a name, enter <c>swap</c> (mandatory).
|
| 199 |
</p>
|
| 200 |
|
| 201 |
<p>
|
| 202 |
To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select
|
| 203 |
from what block the root partition should start. When asked for the size, enter
|
| 204 |
<c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available
|
| 205 |
space". When asked for the name, enter <c>root</c> (mandatory).
|
| 206 |
</p>
|
| 207 |
|
| 208 |
<p>
|
| 209 |
To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to
|
| 210 |
quit <c>mac-fdisk</c>.
|
| 211 |
</p>
|
| 212 |
|
| 213 |
<note>
|
| 214 |
To make sure everything is ok, you should run mac-fdisk once more and check
|
| 215 |
whether all the partitions are there. If you don't see any of the partitions you
|
| 216 |
created, or the changes you made, you should reinitialize your partitions by
|
| 217 |
pressing <c>i</c> in mac-fdisk. Note that this will recreate the partition map
|
| 218 |
and thus remove all your partitions.
|
| 219 |
</note>
|
| 220 |
|
| 221 |
<p>
|
| 222 |
Now that your partitions are created, you can continue with <uri
|
| 223 |
link="#filesystems">Creating Filesystems</uri>.
|
| 224 |
</p>
|
| 225 |
|
| 226 |
</body>
|
| 227 |
</section>
|
| 228 |
<section id="fdisk">
|
| 229 |
<title>IBM pSeries, iSeries and OpenPower: using fdisk to Partition your Disk</title>
|
| 230 |
<subsection>
|
| 231 |
<body>
|
| 232 |
|
| 233 |
<note>
|
| 234 |
If you are planning to use a RAID disk array for your Gentoo installation and
|
| 235 |
you are using POWER5-based hardware, you should now run <c>iprconfig</c> to
|
| 236 |
format the disks to Advanced Function format and create the disk array. You
|
| 237 |
should emerge <c>iprutils</c> after your install is complete.
|
| 238 |
</note>
|
| 239 |
|
| 240 |
<p>
|
| 241 |
If you have an ipr-based SCSI adapter, you should start the ipr utilities now.
|
| 242 |
</p>
|
| 243 |
|
| 244 |
<pre caption="Starting ipr utilities">
|
| 245 |
# <i>/etc/init.d/iprinit start</i>
|
| 246 |
</pre>
|
| 247 |
|
| 248 |
<p>
|
| 249 |
The following parts explain how to create the example partition layout
|
| 250 |
described previously, namely:
|
| 251 |
</p>
|
| 252 |
|
| 253 |
<table>
|
| 254 |
<tr>
|
| 255 |
<th>Partition</th>
|
| 256 |
<th>Description</th>
|
| 257 |
</tr>
|
| 258 |
<tr>
|
| 259 |
<ti><path>/dev/sda1</path></ti>
|
| 260 |
<ti>PPC PReP Boot partition</ti>
|
| 261 |
</tr>
|
| 262 |
<tr>
|
| 263 |
<ti><path>/dev/sda2</path></ti>
|
| 264 |
<ti>Swap partition</ti>
|
| 265 |
</tr>
|
| 266 |
<tr>
|
| 267 |
<ti><path>/dev/sda3</path></ti>
|
| 268 |
<ti>Root partition</ti>
|
| 269 |
</tr>
|
| 270 |
</table>
|
| 271 |
|
| 272 |
<p>
|
| 273 |
Change your partition layout according to your own preference.
|
| 274 |
</p>
|
| 275 |
|
| 276 |
</body>
|
| 277 |
</subsection>
|
| 278 |
<subsection>
|
| 279 |
<title>Viewing the Current Partition Layout</title>
|
| 280 |
<body>
|
| 281 |
|
| 282 |
<p>
|
| 283 |
<c>fdisk</c> is a popular and powerful tool to split your disk into
|
| 284 |
partitions. Fire up <c>fdisk</c> on your disk (in our example, we
|
| 285 |
use <path>/dev/sda</path>):
|
| 286 |
</p>
|
| 287 |
|
| 288 |
<pre caption="Starting fdisk">
|
| 289 |
# <i>fdisk /dev/sda</i>
|
| 290 |
</pre>
|
| 291 |
|
| 292 |
<p>
|
| 293 |
Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like
|
| 294 |
this:
|
| 295 |
</p>
|
| 296 |
|
| 297 |
<pre caption="fdisk prompt">
|
| 298 |
Command (m for help):
|
| 299 |
</pre>
|
| 300 |
|
| 301 |
<p>
|
| 302 |
If you still have an AIX partition layout on your system, you will get the
|
| 303 |
following error message:
|
| 304 |
</p>
|
| 305 |
|
| 306 |
<pre caption="Error message from fdisk">
|
| 307 |
There is a valid AIX label on this disk.
|
| 308 |
Unfortunately Linux cannot handle these
|
| 309 |
disks at the moment. Nevertheless some
|
| 310 |
advice:
|
| 311 |
1. fdisk will destroy its contents on write.
|
| 312 |
2. Be sure that this disk is NOT a still vital
|
| 313 |
part of a volume group. (Otherwise you may
|
| 314 |
erase the other disks as well, if unmirrored.)
|
| 315 |
3. Before deleting this physical volume be sure
|
| 316 |
to remove the disk logically from your AIX
|
| 317 |
machine. (Otherwise you become an AIXpert).
|
| 318 |
|
| 319 |
Command (m for help):
|
| 320 |
</pre>
|
| 321 |
|
| 322 |
<p>
|
| 323 |
Don't worry, you can create a new empty DOS partition table by pressing
|
| 324 |
<c>o</c>.
|
| 325 |
</p>
|
| 326 |
|
| 327 |
<warn>
|
| 328 |
This will destroy any installed AIX version!
|
| 329 |
</warn>
|
| 330 |
|
| 331 |
<p>
|
| 332 |
Type <c>p</c> to display your disk current partition configuration:
|
| 333 |
</p>
|
| 334 |
|
| 335 |
<pre caption="An example partition configuration">
|
| 336 |
Command (m for help): <i>p</i>
|
| 337 |
|
| 338 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 339 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 340 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 341 |
|
| 342 |
Device Boot Start End Blocks Id System
|
| 343 |
/dev/sda1 1 12 53266+ 83 Linux
|
| 344 |
/dev/sda2 13 233 981571+ 82 Linux swap
|
| 345 |
/dev/sda3 234 674 1958701+ 83 Linux
|
| 346 |
/dev/sda4 675 6761 27035410+ 5 Extended
|
| 347 |
/dev/sda5 675 2874 9771268+ 83 Linux
|
| 348 |
/dev/sda6 2875 2919 199836 83 Linux
|
| 349 |
/dev/sda7 2920 3008 395262 83 Linux
|
| 350 |
/dev/sda8 3009 6761 16668918 83 Linux
|
| 351 |
|
| 352 |
Command (m for help):
|
| 353 |
</pre>
|
| 354 |
|
| 355 |
<p>
|
| 356 |
This particular disk is configured to house six Linux filesystems
|
| 357 |
(each with a corresponding partition listed as "Linux") as well as a
|
| 358 |
swap partition (listed as "Linux swap").
|
| 359 |
</p>
|
| 360 |
|
| 361 |
</body>
|
| 362 |
</subsection>
|
| 363 |
<subsection>
|
| 364 |
<title>Removing all Partitions</title>
|
| 365 |
<body>
|
| 366 |
|
| 367 |
<p>
|
| 368 |
We will first remove all existing partitions from the disk. Type
|
| 369 |
<c>d</c> to delete a partition. For instance, to delete an existing
|
| 370 |
<path>/dev/sda1</path>:
|
| 371 |
</p>
|
| 372 |
|
| 373 |
<note>
|
| 374 |
If you don't want to delete all partitions just delete those you want to delete.
|
| 375 |
At this point you should create a backup of your data to avoid losing it.
|
| 376 |
</note>
|
| 377 |
|
| 378 |
<pre caption="Deleting a partition">
|
| 379 |
Command (m for help): <i>d</i>
|
| 380 |
Partition number (1-4): <i>1</i>
|
| 381 |
</pre>
|
| 382 |
|
| 383 |
<p>
|
| 384 |
The partition has been scheduled for deletion. It will no longer show up
|
| 385 |
if you type <c>p</c>, but it will not be erased until your changes have
|
| 386 |
been saved. If you made a mistake and want to abort without saving your
|
| 387 |
changes, type <c>q</c> immediately and hit Enter and your partition will
|
| 388 |
not be deleted.
|
| 389 |
</p>
|
| 390 |
|
| 391 |
<p>
|
| 392 |
Now, assuming that you do indeed want to wipe out all the partitions on
|
| 393 |
your system, repeatedly type <c>p</c> to print out a partition listing
|
| 394 |
and then type <c>d</c> and the number of the partition to delete it.
|
| 395 |
Eventually, you'll end up with a partition table with nothing in it:
|
| 396 |
</p>
|
| 397 |
|
| 398 |
<pre caption="An empty partition table">
|
| 399 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 400 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 401 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 402 |
|
| 403 |
Device Boot Start End Blocks Id System
|
| 404 |
|
| 405 |
Command (m for help):
|
| 406 |
</pre>
|
| 407 |
|
| 408 |
<p>
|
| 409 |
Now that the in-memory partition table is empty, we're ready to create
|
| 410 |
the partitions. We will use a default partitioning scheme as discussed
|
| 411 |
previously. Of course, don't follow these instructions to the letter if
|
| 412 |
you don't want the same partitioning scheme!
|
| 413 |
</p>
|
| 414 |
|
| 415 |
</body>
|
| 416 |
</subsection>
|
| 417 |
<subsection>
|
| 418 |
<title>Creating the PPC PReP boot partition</title>
|
| 419 |
<body>
|
| 420 |
|
| 421 |
<p>
|
| 422 |
We first create a small PReP boot partition. Type <c>n</c> to create a new
|
| 423 |
partition, then <c>p</c> to select a primary partition, followed by
|
| 424 |
<c>1</c> to select the first primary partition. When prompted for the
|
| 425 |
first cylinder, hit enter. When prompted for the last cylinder, type
|
| 426 |
<c>+7M</c> to create a partition 7 MB in size. After you've done
|
| 427 |
this, type <c>t</c> to set the partition type, <c>1</c> to select the
|
| 428 |
partition you just created and then type in <c>41</c> to set the
|
| 429 |
partition type to "PPC PReP Boot". Finally, you'll need to mark the PReP
|
| 430 |
partition as bootable.
|
| 431 |
</p>
|
| 432 |
|
| 433 |
<note>
|
| 434 |
The PReP partition has to be smaller than 8 MB!
|
| 435 |
</note>
|
| 436 |
|
| 437 |
<pre caption="Creating the PReP boot partition">
|
| 438 |
Command (m for help): <i>p</i>
|
| 439 |
|
| 440 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 441 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 442 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 443 |
|
| 444 |
Device Boot Start End Blocks Id System
|
| 445 |
|
| 446 |
Command (m for help): <i>n</i>
|
| 447 |
Command action
|
| 448 |
e extended
|
| 449 |
p primary partition (1-4)
|
| 450 |
<i>p</i>
|
| 451 |
Partition number (1-4): <i>1</i>
|
| 452 |
First cylinder (1-6761, default 1):
|
| 453 |
Using default value 1
|
| 454 |
Last cylinder or +size or +sizeM or +sizeK (1-6761, default
|
| 455 |
6761): <i>+8M</i>
|
| 456 |
|
| 457 |
Command (m for help): <i>t</i>
|
| 458 |
Selected partition 1
|
| 459 |
Hex code (type L to list codes): <i>41</i>
|
| 460 |
Changed system type of partition 1 to 41 (PPC PReP Boot)
|
| 461 |
|
| 462 |
Command (m for help): <i>a</i>
|
| 463 |
Partition number (1-4): <i>1</i>
|
| 464 |
Command (m for help):
|
| 465 |
</pre>
|
| 466 |
|
| 467 |
<p>
|
| 468 |
Now, when you type <c>p</c>, you should see the following partition information:
|
| 469 |
</p>
|
| 470 |
|
| 471 |
<pre caption="Created boot partition">
|
| 472 |
Command (m for help): <i>p</i>
|
| 473 |
|
| 474 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 475 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 476 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 477 |
|
| 478 |
Device Boot Start End Blocks Id System
|
| 479 |
/dev/sda1 * 1 3 13293 41 PPC PReP Boot
|
| 480 |
|
| 481 |
Command (m for help):
|
| 482 |
</pre>
|
| 483 |
</body>
|
| 484 |
</subsection>
|
| 485 |
<subsection>
|
| 486 |
<title>Creating the Swap Partition</title>
|
| 487 |
<body>
|
| 488 |
|
| 489 |
<p>
|
| 490 |
Let's now create the swap partition. To do this, type <c>n</c> to create
|
| 491 |
a new partition, then <c>p</c> to tell fdisk that you want a primary
|
| 492 |
partition. Then type <c>2</c> to create the second primary partition,
|
| 493 |
<path>/dev/sda2</path> in our case. When prompted for the first
|
| 494 |
cylinder, hit enter. When prompted for the last cylinder, type
|
| 495 |
<c>+512M</c> to create a partition 512MB in size. After you've done
|
| 496 |
this, type <c>t</c> to set the partition type, <c>2</c> to select the
|
| 497 |
partition you just created and then type in <c>82</c> to set the
|
| 498 |
partition type to "Linux Swap". After completing these steps, typing
|
| 499 |
<c>p</c> should display a partition table that looks similar to this:
|
| 500 |
</p>
|
| 501 |
|
| 502 |
<pre caption="Partition listing after creating a swap partition">
|
| 503 |
Command (m for help): <i>p</i>
|
| 504 |
|
| 505 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 506 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 507 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 508 |
|
| 509 |
Device Boot Start End Blocks Id System
|
| 510 |
/dev/sda1 1 3 13293 41 PPC PReP Boot
|
| 511 |
/dev/sda2 4 117 506331 82 Linux swap
|
| 512 |
|
| 513 |
Command (m for help):
|
| 514 |
</pre>
|
| 515 |
|
| 516 |
</body>
|
| 517 |
</subsection>
|
| 518 |
<subsection>
|
| 519 |
<title>Creating the Root Partition</title>
|
| 520 |
<body>
|
| 521 |
|
| 522 |
<p>
|
| 523 |
Finally, let's create the root partition. To do this, type <c>n</c> to
|
| 524 |
create a new partition, then <c>p</c> to tell fdisk that you want a
|
| 525 |
primary partition. Then type <c>3</c> to create the third primary
|
| 526 |
partition, <path>/dev/sda3</path> in our case. When prompted for the
|
| 527 |
first cylinder, hit enter. When prompted for the last cylinder, hit
|
| 528 |
enter to create a partition that takes up the rest of the remaining
|
| 529 |
space on your disk. After completing these steps, typing <c>p</c> should
|
| 530 |
display a partition table that looks similar to this:
|
| 531 |
</p>
|
| 532 |
|
| 533 |
<pre caption="Partition listing after creating the root partition">
|
| 534 |
Command (m for help): <i>p</i>
|
| 535 |
|
| 536 |
Disk /dev/sda: 30.7 GB, 30750031872 bytes
|
| 537 |
141 heads, 63 sectors/track, 6761 cylinders
|
| 538 |
Units = cylinders of 8883 * 512 = 4548096 bytes
|
| 539 |
|
| 540 |
Device Boot Start End Blocks Id System
|
| 541 |
/dev/sda1 1 3 13293 41 PPC PReP Boot
|
| 542 |
/dev/sda2 4 117 506331 82 Linux swap
|
| 543 |
/dev/sda3 118 6761 29509326 83 Linux
|
| 544 |
|
| 545 |
Command (m for help):
|
| 546 |
</pre>
|
| 547 |
</body>
|
| 548 |
</subsection>
|
| 549 |
<subsection>
|
| 550 |
<title>Saving the Partition Layout</title>
|
| 551 |
<body>
|
| 552 |
|
| 553 |
<p>
|
| 554 |
To save the partition layout and exit <c>fdisk</c>, type <c>w</c>.
|
| 555 |
</p>
|
| 556 |
|
| 557 |
<pre caption="Save and exit fdisk">
|
| 558 |
Command (m for help): <i>w</i>
|
| 559 |
</pre>
|
| 560 |
|
| 561 |
<p>
|
| 562 |
Now that your partitions are created, you can continue with <uri
|
| 563 |
link="#filesystems">Creating Filesystems</uri>.
|
| 564 |
</p>
|
| 565 |
|
| 566 |
</body>
|
| 567 |
</subsection>
|
| 568 |
</section>
|
| 569 |
<section id="filesystems">
|
| 570 |
<title>Creating Filesystems</title>
|
| 571 |
<subsection>
|
| 572 |
<title>Introduction</title>
|
| 573 |
<body>
|
| 574 |
|
| 575 |
<p>
|
| 576 |
Now that your partitions are created, it is time to place a filesystem on them.
|
| 577 |
If you don't care about what filesystem to choose and are happy with what we use
|
| 578 |
as default in this handbook, continue with <uri
|
| 579 |
link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
|
| 580 |
Otherwise read on to learn about the available filesystems...
|
| 581 |
</p>
|
| 582 |
|
| 583 |
</body>
|
| 584 |
</subsection>
|
| 585 |
|
| 586 |
<subsection>
|
| 587 |
<include href="hb-install-filesystems.xml"/>
|
| 588 |
</subsection>
|
| 589 |
|
| 590 |
<subsection id="filesystems-apply">
|
| 591 |
<title>Applying a Filesystem to a Partition</title>
|
| 592 |
<body>
|
| 593 |
|
| 594 |
<p>
|
| 595 |
To create a filesystem on a partition or volume, there are tools available for
|
| 596 |
each possible filesystem:
|
| 597 |
</p>
|
| 598 |
|
| 599 |
<table>
|
| 600 |
<tr>
|
| 601 |
<th>Filesystem</th>
|
| 602 |
<th>Creation Command</th>
|
| 603 |
</tr>
|
| 604 |
<tr>
|
| 605 |
<ti>ext2</ti>
|
| 606 |
<ti><c>mke2fs</c></ti>
|
| 607 |
</tr>
|
| 608 |
<tr>
|
| 609 |
<ti>ext3</ti>
|
| 610 |
<ti><c>mke2fs -j</c></ti>
|
| 611 |
</tr>
|
| 612 |
<tr>
|
| 613 |
<ti>ext4</ti>
|
| 614 |
<ti><c>mkfs.ext4</c></ti>
|
| 615 |
</tr>
|
| 616 |
<tr>
|
| 617 |
<ti>reiserfs</ti>
|
| 618 |
<ti><c>mkreiserfs</c></ti>
|
| 619 |
</tr>
|
| 620 |
<tr>
|
| 621 |
<ti>xfs</ti>
|
| 622 |
<ti><c>mkfs.xfs</c></ti>
|
| 623 |
</tr>
|
| 624 |
<tr>
|
| 625 |
<ti>jfs</ti>
|
| 626 |
<ti><c>mkfs.jfs</c></ti>
|
| 627 |
</tr>
|
| 628 |
</table>
|
| 629 |
|
| 630 |
<p>
|
| 631 |
For instance, to have the root partition (<path>/dev/sda4</path> in our example)
|
| 632 |
in ext4 (as in our example), you would use:
|
| 633 |
</p>
|
| 634 |
|
| 635 |
<pre caption="Applying a filesystem on a partition">
|
| 636 |
# <i>mkfs.ext4 /dev/sda4</i>
|
| 637 |
</pre>
|
| 638 |
|
| 639 |
<p>
|
| 640 |
Now create the filesystems on your newly created partitions (or logical
|
| 641 |
volumes).
|
| 642 |
</p>
|
| 643 |
|
| 644 |
<impo>
|
| 645 |
If you choose to use ReiserFS for <path>/</path>, do not change its default
|
| 646 |
block size if you will also be using <c>yaboot</c> as your bootloader, as
|
| 647 |
explained in <uri link="?part=1&chap=10">Configuring the Bootloader</uri>.
|
| 648 |
</impo>
|
| 649 |
|
| 650 |
</body>
|
| 651 |
</subsection>
|
| 652 |
<subsection>
|
| 653 |
<title>Activating the Swap Partition</title>
|
| 654 |
<body>
|
| 655 |
|
| 656 |
<p>
|
| 657 |
<c>mkswap</c> is the command that is used to initialize swap partitions:
|
| 658 |
</p>
|
| 659 |
|
| 660 |
<pre caption="Creating a Swap signature">
|
| 661 |
# <i>mkswap /dev/sda3</i>
|
| 662 |
</pre>
|
| 663 |
|
| 664 |
<p>
|
| 665 |
To activate the swap partition, use <c>swapon</c>:
|
| 666 |
</p>
|
| 667 |
|
| 668 |
<pre caption="Activating the swap partition">
|
| 669 |
# <i>swapon /dev/sda3</i>
|
| 670 |
</pre>
|
| 671 |
|
| 672 |
<p>
|
| 673 |
Create and activate the swap with the commands mentioned above.
|
| 674 |
</p>
|
| 675 |
|
| 676 |
</body>
|
| 677 |
</subsection>
|
| 678 |
</section>
|
| 679 |
<section>
|
| 680 |
<title>Mounting</title>
|
| 681 |
<body>
|
| 682 |
|
| 683 |
<p>
|
| 684 |
Now that your partitions are initialized and are housing a filesystem, it is
|
| 685 |
time to mount those partitions. Use the <c>mount</c> command. Don't forget to
|
| 686 |
create the necessary mount directories for every partition you created. As an
|
| 687 |
example we create a mount point and mount the root partition:
|
| 688 |
</p>
|
| 689 |
|
| 690 |
<pre caption="Mounting partitions">
|
| 691 |
# <i>mkdir /mnt/gentoo</i>
|
| 692 |
# <i>mount /dev/sda4 /mnt/gentoo</i>
|
| 693 |
</pre>
|
| 694 |
|
| 695 |
<note>
|
| 696 |
If you want your <path>/tmp</path> to reside on a separate partition, be sure to
|
| 697 |
change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
|
| 698 |
also holds for <path>/var/tmp</path>.
|
| 699 |
</note>
|
| 700 |
|
| 701 |
<p>
|
| 702 |
Continue with <uri link="?part=1&chap=5">Installing the Gentoo
|
| 703 |
Installation Files</uri>.
|
| 704 |
</p>
|
| 705 |
|
| 706 |
</body>
|
| 707 |
</section>
|
| 708 |
</sections>
|