/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.46 - (show annotations) (download) (as text)
Tue Apr 1 08:53:46 2008 UTC (6 years ago) by nightmorph
Branch: MAIN
Changes since 1.45: +9 -77 lines
File MIME type: application/xml
release time. note that since this is beta1, the release dir and stage/media names have been adjusted accordingly. also, the handbooks are marked with a disclaimer=draft, so once the final is out, that will be removed and the release names adjusted. in the mean time, these are live. the beta is officially released. no, it's not april fools, but it is april 1st. :)

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/draft/hb-install-ppc-disk.xml,v 1.32 2008/03/31 21:48:59 nightmorph Exp $ -->
8
9 <sections>
10
11 <version>9.0</version>
12 <date>2008-04-01</date>
13
14 <section>
15 <title>Introduction to Block Devices</title>
16
17 <subsection>
18 <include href="hb-install-blockdevices.xml"/>
19 </subsection>
20
21 <subsection>
22 <title>Partitions</title>
23 <body>
24
25 <p>
26 Although it is theoretically possible to use a full disk to house your Linux
27 system, this is almost never done in practice. Instead, full disk block devices
28 are split up in smaller, more manageable block devices. On most systems,
29 these are called <e>partitions</e>.
30 </p>
31
32 </body>
33 </subsection>
34 </section>
35 <section>
36 <title>Designing a Partitioning Scheme</title>
37 <subsection>
38 <title>Default Partitioning Scheme</title>
39 <body>
40
41 <p>
42 If you are not interested in drawing up a partitioning scheme for your system,
43 you can use the partitioning scheme we use throughout this book. Choose the
44 filesystem layout that best matches the type of PowerPC system you are
45 installing on.
46 </p>
47
48 </body>
49 </subsection>
50 <subsection>
51 <title>Apple New World</title>
52 <body>
53
54 <p>
55 Apple New World machines are fairly straightforward to configure. The first
56 partition is always an <e>Apple Partition Map</e>. This partition keeps track
57 of the layout of the disk. You cannot remove this partition. The next
58 partition should always be a bootstrap partition. This partition contains a
59 small (800k) HFS filesystem that holds a copy of the bootloader Yaboot and its
60 configuration file. This partition is <e>not</e> the same as a
61 <path>/boot</path> partition as found on other architectures. After the boot
62 partition, the usual Linux filesystems are placed, according to the scheme
63 below. The swap partition is a temporary storage place for when your system
64 runs out of physical memory. The root partition will contain the filesystem
65 that Gentoo is installed on. If you wish to dual boot, the OSX partition
66 can go anywhere after the bootstrap partition to insure that yaboot starts
67 first.
68 </p>
69
70 <note>
71 There may be "Disk Driver" partitions on your disk such as
72 <path>Apple_Driver63</path>, <path>Apple_Driver_ATA</path>,
73 <path>Apple_FWDriver</path>, <path>Apple_Driver_IOKit</path>, and
74 <path>Apple_Patches</path>. These are used to boot MacOS, so if you have no
75 need for this, you can remove them by initializing the disk with mac-fdisk's
76 <c>i</c> option. This will completely erase the disk! If you are in doubt,
77 just let them be.
78 </note>
79
80 <note>
81 If you partitioned this disk with Apple's Disk Utility, there may be
82 128Mb spaces between partitions which Apple reserves for "future use". You
83 can safely remove these.
84 </note>
85
86 <table>
87 <tr>
88 <th>Partition</th>
89 <th>Size</th>
90 <th>Filesystem</th>
91 <th>Description</th>
92 </tr>
93 <tr>
94 <ti><path>/dev/hda1</path></ti>
95 <ti>32k</ti>
96 <ti>None</ti>
97 <ti>Apple Partition Map</ti>
98 </tr>
99 <tr>
100 <ti><path>/dev/hda2</path></ti>
101 <ti>800k</ti>
102 <ti>HFS</ti>
103 <ti>Apple Bootstrap</ti>
104 </tr>
105 <tr>
106 <ti><path>/dev/hda3</path></ti>
107 <ti>512Mb</ti>
108 <ti>Swap</ti>
109 <ti>Linux Swap</ti>
110 </tr>
111 <tr>
112 <ti><path>/dev/hda4</path></ti>
113 <ti>Rest of Disk</ti>
114 <ti>ext3, reiserfs, xfs</ti>
115 <ti>Linux Root</ti>
116 </tr>
117 </table>
118
119 </body>
120 </subsection>
121 <subsection>
122 <title>Apple Old World</title>
123 <body>
124
125 <p>
126 Apple Old World machines are a bit more complicated to configure. The first
127 partition is always an <e>Apple Partition Map</e>. This partition keeps track
128 of the layout of the disk. You cannot remove this partition. If you are using
129 BootX, the configuration below assumes that MacOS is installed on a seperate
130 disk. If this is not the case, there will be additional partitions for "Apple
131 Disk Drivers" such as <path>Apple_Driver63, Apple_Driver_ATA, Apple_FWDriver,
132 Apple_Driver_IOKit, Apple_Patches</path> and the MacOS install. If you are
133 using Quik, you will need to create a boot partition to hold the kernel, unlike
134 other Apple boot methods. After the boot partition, the usual Linux filesystems
135 are placed, according to the scheme below. The swap partition is a temporary
136 storage place for when your system runs out of physical memory. The root
137 partition will contain the filesystem that Gentoo is installed on.
138 </p>
139
140 <note>
141 If you are using an OldWorld machine, you will need to keep MacOS available.
142 The layout here assumes MacOS is installed on a separate drive.
143 </note>
144
145 <table>
146 <tr>
147 <th>Partition</th>
148 <th>Size</th>
149 <th>Filesystem</th>
150 <th>Description</th>
151 </tr>
152 <tr>
153 <ti><path>/dev/hda1</path></ti>
154 <ti>32k</ti>
155 <ti>None</ti>
156 <ti>Apple Partition Map</ti>
157 </tr>
158 <tr>
159 <ti><path>/dev/hda2</path></ti>
160 <ti>32Mb</ti>
161 <ti>ext2</ti>
162 <ti>Quik Boot Partition (quik only)</ti>
163 </tr>
164 <tr>
165 <ti><path>/dev/hda3</path></ti>
166 <ti>512Mb</ti>
167 <ti>Swap</ti>
168 <ti>Linux Swap</ti>
169 </tr>
170 <tr>
171 <ti><path>/dev/hda4</path></ti>
172 <ti>Rest of Disk</ti>
173 <ti>ext3, reiserfs, xfs</ti>
174 <ti>Linux Root</ti>
175 </tr>
176 </table>
177
178 </body>
179 </subsection>
180 <subsection>
181 <title>Pegasos</title>
182 <body>
183
184 <p>
185 The Pegasos partition layout is quite simple compared to the Apple layouts.
186 The first partition is a Boot Partition, which contains kernels to be booted,
187 along with an Open Firmware script that presents a menu on boot. After the boot
188 partition, the usual Linux filesystems are placed, according to the scheme
189 below. The swap partition is a temporary storage place for when your system
190 runs out of physical memory. The root partition will contain the filesystem
191 that Gentoo is installed on.
192 </p>
193
194 <table>
195 <tr>
196 <th>Partition</th>
197 <th>Size</th>
198 <th>Filesystem</th>
199 <th>Description</th>
200 </tr>
201 <tr>
202 <ti><path>/dev/hda1</path></ti>
203 <ti>32Mb</ti>
204 <ti>affs1 or ext2</ti>
205 <ti>Boot Partition</ti>
206 </tr>
207 <tr>
208 <ti><path>/dev/hda2</path></ti>
209 <ti>512Mb</ti>
210 <ti>Swap</ti>
211 <ti>Linux Swap</ti>
212 </tr>
213 <tr>
214 <ti><path>/dev/hda3</path></ti>
215 <ti>Rest of Disk</ti>
216 <ti>ext3, reiserfs, xfs</ti>
217 <ti>Linux Root</ti>
218 </tr>
219 </table>
220
221 </body>
222 </subsection>
223 <subsection>
224 <title>IBM PReP (RS/6000)</title>
225 <body>
226
227 <p>
228 The IBM PowerPC Reference Platform (PReP) requires a small PReP boot partition
229 on the disk's first partition, followed by the swap and root partitions.
230 </p>
231
232 <table>
233 <tr>
234 <th>Partition</th>
235 <th>Size</th>
236 <th>Filesystem</th>
237 <th>Description</th>
238 </tr>
239 <tr>
240 <ti><path>/dev/hda1</path></ti>
241 <ti>800k</ti>
242 <ti>None</ti>
243 <ti>PReP Boot Partition (Type 0x41)</ti>
244 </tr>
245 <tr>
246 <ti><path>/dev/hda2</path></ti>
247 <ti>512Mb</ti>
248 <ti>Swap</ti>
249 <ti>Linux Swap (Type 0x82)</ti>
250 </tr>
251 <tr>
252 <ti><path>/dev/hda3</path></ti>
253 <ti>Rest of Disk</ti>
254 <ti>ext3, reiserfs, xfs</ti>
255 <ti>Linux Root (Type 0x83)</ti>
256 </tr>
257 </table>
258
259 <warn>
260 <c>parted</c> is able to resize partitions including HFS+. Unfortunately there
261 may be issues with resizing HFS+ journaled filesystems, so, for the best
262 results, switch off journaling in Mac OS X before resizing. Remember that any
263 resizing operation is dangerous, so attempt at your own risk! Be sure to always
264 have a backup of your data before resizing!
265 </warn>
266
267 <p>
268 If you are interested in knowing how big a partition should be, or even how many
269 partitions you need, read on. Otherwise continue now with
270 <uri link="#mac-fdisk"> Default: Using mac-fdisk (Apple) to Partition your Disk
271 </uri> or <uri link="#parted">Alternative: Using parted (IBM/Pegasos) to
272 Partition your Disk</uri>.
273 </p>
274
275 </body>
276 </subsection>
277 <subsection>
278 <title>How Many and How Big?</title>
279 <body>
280
281 <p>
282 The number of partitions is highly dependent on your environment. For instance,
283 if you have lots of users, you will most likely want to have your
284 <path>/home</path> separate as it increases security and makes backups easier.
285 If you are installing Gentoo to perform as a mailserver, your <path>/var</path>
286 should be separate as all received mail is stored in <path>/var</path>. A good
287 choice of filesystem will then maximise your performance. Game servers should
288 have a separate <path>/opt</path> as most game servers are installed there. The
289 reason is similar for <path>/home</path>: security and backups. Whatever layout
290 you chose, you will definitely want to keep <path>/usr</path> large: not only
291 will it contain the majority of applications, the Portage tree alone takes
292 more than 500Mb excluding the various sources that are stored in it.
293 </p>
294
295 <p>
296 As you can see, it very much depends on what you want to achieve. Separate
297 partitions or volumes have the following advantages:
298 </p>
299
300 <ul>
301 <li>
302 You can choose the best performing filesystem for each partition or volume
303 </li>
304 <li>
305 Your entire system cannot run out of free space if one defunct tool is
306 continuously writing files to a partition or volume
307 </li>
308 <li>
309 If necessary, file system checks are reduced in time, as multiple checks can
310 be done in parallel (although this advantage is more with multiple disks than
311 it is with multiple partitions)
312 </li>
313 <li>
314 Security can be enhanced by mounting some partitions or volumes read-only,
315 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
316 </li>
317 </ul>
318
319 <p>
320 However, multiple partitions have one big disadvantage: if not configured
321 properly, you might result in having a system with lots of free space on one
322 partition and none on another. There is also a 15-partition limit for SCSI and
323 SATA.
324 </p>
325
326 </body>
327 </subsection>
328 </section>
329 <section id="mac-fdisk">
330 <title>Default: Using mac-fdisk (Apple) Partition your Disk</title>
331 <body>
332
333 <p>
334 At this point, create your partitions using <c>mac-fdisk</c>:
335 </p>
336
337 <pre caption="Starting mac-fdisk">
338 # <i>mac-fdisk /dev/hda</i>
339 </pre>
340
341 <p>
342 If you used Apple's Disk Utility to leave space for Linux, first delete the
343 partitions you have created previously to make room for your new install. Use
344 <c>d</c> in <c>mac-fdisk</c> to delete those partition(s). It will ask for the
345 partition number to delete. Usually the first partition on NewWorld machines
346 (Apple_partition_map) could not be deleted. If you would like to start with a
347 clean disk, you can simply initialize the disk by pressing <c>i</c>. This
348 will completely erase the disk, so use this with caution.
349 </p>
350
351 <p>
352 Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will
353 ask for what block you want to start. Enter the number of your first free
354 partition, followed by a <c>p</c>. For instance this is <c>2p</c>.
355 </p>
356
357 <note>
358 This partition is <e>not</e> a <path>/boot</path> partition. It is not used by
359 Linux at all; you don't have to place any filesystem on it and you should never
360 mount it. Apple users don't need an extra partition for <path>/boot</path>.
361 </note>
362
363 <p>
364 Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will
365 ask for what block you want to start this partition from. As we used <c>2</c>
366 before to create the Apple_Bootstrap partition, you now have to enter
367 <c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size
368 you want -- a minimum of 512MB is recommended, but 2 times your physical memory
369 is the generally accepted size). When asked for a name, enter <c>swap</c>.
370 </p>
371
372 <p>
373 To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select
374 from what block the root partition should start. When asked for the size, enter
375 <c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available
376 space". When asked for the name, enter <c>root</c>.
377 </p>
378
379 <p>
380 To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to
381 quit <c>mac-fdisk</c>.
382 </p>
383
384 <note>
385 To make sure everything is ok, you should run <c>mac-fdisk -l</c> and check
386 whether all the partitions are there. If you don't see any of the partitions
387 you created, or the changes you made, you should reinitialize your partitions
388 by pressing "i" in mac-fdisk. Note that this will recreate the partition map
389 and thus remove all your partitions.
390 </note>
391
392 <p>
393 Now that your partitions are created, you can continue with
394 <uri link="#filesystems">Creating Filesystems</uri>.
395 </p>
396
397 </body>
398 </section>
399 <section id="parted">
400 <title>Using parted to Partition your Disk (Pegasos and RS/6000)</title>
401 <body>
402
403 <p>
404 <c>parted</c>, the Partition Editor, can now handle HFS+ partitions used by
405 Mac OS and Mac OS X. With this tool you can resize your Mac-partitions and
406 create space for your Linux partitions. Nevertheless, the example below
407 describes partitioning for Pegasos machines only.
408 </p>
409
410 <p>
411 To begin let's fire up <c>parted</c>:
412 </p>
413
414 <pre caption="Starting parted">
415 # <i>parted /dev/hda</i>
416 </pre>
417
418 <p>
419 If the drive is unpartitioned, run <c>mklabel amiga</c> to create a new
420 disklabel for the drive.
421 </p>
422
423 <p>
424 You can type <c>print</c> at any time in parted to display the current partition
425 table. If at any time you change your mind or made a mistake you can press
426 <c>Ctrl-c</c> to abort parted.
427 </p>
428
429 <p>
430 If you intend to also install MorphOS on your Pegasos create an affs1 filesystem
431 at the start of the drive. 32MB should be more than enough to store the MorphOS
432 kernel. If you have a Pegasos I or intend to use any filesystem besides ext2 or
433 ext3, you will also have to store your Linux kernel on this partition (the
434 Pegasos II can only boot from ext2/ext3 or affs1 partitions). To create the
435 partition run <c>mkpart primary affs1 START END</c> where <c>START</c> and
436 <c>END</c> should be replaced with the megabyte range (e.g. <c>0 32</c>) which
437 creates a 32 MB partition starting at 0MB and ending at 32MB. If you chose to
438 create an ext2 or ext3 partition instead, substitute ext2 or ext3 for affs1 in
439 the mkpart command.
440 </p>
441
442 <p>
443 You will need to create two partitions for Linux, one root filesystem and one
444 swap partition. Run <c>mkpart primary START END</c> to create each partition,
445 replacing <c>START</c> and <c>END</c> with the desired megabyte boundries.
446 </p>
447
448 <p>
449 It is generally recommended that you create a swap partition that is two times
450 bigger than the amount of RAM in your computer, but at least 512Mb is
451 recommended. To create the swap partition, run
452 <c>mkpart primary linux-swap START END</c> with START and END again denoting
453 the partition boundries.
454 </p>
455
456 <p>
457 When you are done in parted simply type <c>quit</c>.
458 </p>
459
460 </body>
461 </section>
462 <section id="filesystems">
463 <title>Creating Filesystems</title>
464 <subsection>
465 <title>Introduction</title>
466 <body>
467
468 <p>
469 Now that your partitions are created, it is time to place a filesystem on them.
470 If you're not sure which filesystems to choose and are happy with our defaults,
471 continue with
472 <uri link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
473 Otherwise, read on to learn about the available filesystems.
474 </p>
475
476 </body>
477 </subsection>
478
479 <subsection>
480 <include href="hb-install-filesystems.xml"/>
481 </subsection>
482
483 <subsection>
484 <title>Activating the Swap Partition</title>
485 <body>
486
487 <p>
488 <c>mkswap</c> is the command that is used to initialize swap partitions:
489 </p>
490
491 <pre caption="Creating a swap signature">
492 # <i>mkswap /dev/hda3</i>
493 </pre>
494
495 <p>
496 To activate the swap partition, use <c>swapon</c>:
497 </p>
498
499 <pre caption="Activating the swap partition">
500 # <i>swapon /dev/hda3</i>
501 </pre>
502
503 <p>
504 Create and activate the swap now before creating other filesystems.
505 </p>
506
507 </body>
508 </subsection>
509 <subsection id="filesystems-apply">
510 <title>Applying a Filesystem to a Partition</title>
511 <body>
512
513 <p>
514 To create a filesystem on a partition or volume, there are tools available for
515 each possible filesystem:
516 </p>
517
518 <table>
519 <tr>
520 <th>Filesystem</th>
521 <th>Creation Command</th>
522 </tr>
523 <tr>
524 <ti>ext2</ti>
525 <ti><c>mke2fs</c></ti>
526 </tr>
527 <tr>
528 <ti>ext3</ti>
529 <ti><c>mke2fs -j</c></ti>
530 </tr>
531 <tr>
532 <ti>reiserfs</ti>
533 <ti><c>mkreiserfs</c></ti>
534 </tr>
535 <tr>
536 <ti>xfs</ti>
537 <ti><c>mkfs.xfs</c></ti>
538 </tr>
539 </table>
540
541 <p>
542 For instance, to make an ext3 filesystem on the root partition
543 (<path>/dev/hda4</path> in our example), you would use:
544 </p>
545
546 <pre caption="Applying a filesystem on a partition">
547 # <i>mke2fs -j /dev/hda4</i>
548 </pre>
549
550 <p>
551 Now create the filesystems on your newly created partitions (or logical
552 volumes).
553 </p>
554
555 <impo>
556 If you choose to use ReiserFS for <path>/</path>, do not change its default
557 block size if you will also be using <c>yaboot</c> as your bootloader, as
558 explained in <uri link="?part=1&amp;chap=10">Configuring the Bootloader</uri>.
559 </impo>
560
561 <note>
562 On the PegasosII your partition which holds the kernel must be ext2, ext3 or
563 affs1. NewWorld machines can boot from any of ext2, ext3, XFS, ReiserFS or
564 even HFS/HFS+ filesystems. On OldWorld machines booting with BootX, the kernel
565 must be placed on an HFS partition, but this will be completed when you
566 configure your bootloader.
567 </note>
568
569 </body>
570 </subsection>
571 </section>
572 <section>
573 <title>Mounting</title>
574 <body>
575
576 <p>
577 Now that your partitions are initialized and are housing a filesystem, it is
578 time to mount those partitions. Use the <c>mount</c> command. As an example we
579 mount the root partition:
580 </p>
581
582 <pre caption="Mounting partitions">
583 # <i>mount /dev/hda4 /mnt/gentoo</i>
584 </pre>
585
586 <note>
587 If you want your <path>/tmp</path> to reside on a separate partition, be sure to
588 change its permissions after mounting and unpacking with
589 <c>chmod 1777 /mnt/gentoo/tmp</c>. This is also true for <path>/var/tmp</path>.
590 </note>
591
592 <p>
593 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
594 Installation Files</uri>.
595 </p>
596
597 </body>
598 </section>
599 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20