/[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.54 - (show annotations) (download) (as text)
Sat Feb 23 18:38:22 2013 UTC (16 months, 3 weeks ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.53: +5 -5 lines
File MIME type: application/xml
Fix bug #451596 - Mark ext4 as recommended fs

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

  ViewVC Help
Powered by ViewVC 1.1.20