/[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.52 - (show annotations) (download) (as text)
Sun Oct 28 10:29:03 2012 UTC (23 months, 3 weeks ago) by swift
Branch: MAIN
Changes since 1.51: +11 -7 lines
File MIME type: application/xml
Fix bug #334167 - Add in ext4 support, now for ppc/ppc64

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

  ViewVC Help
Powered by ViewVC 1.1.20