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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.36 - (show annotations) (download) (as text)
Mon Oct 17 19:51:45 2011 UTC (3 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.35: +13 -7 lines
File MIME type: application/xml
Enhancing information on downsides wrt multiple partitions.

This hopefully also clears up some of the confusion that is surrounding
separate /usr partitions. Yes, it now mentions that an initramfs might be
needed in that case.

And no, we do not "recommend" a separate /usr partition, nor do we
"not recommend" it.

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.35 2010/07/21 01:55:53 nightmorph 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>11</version>
17 <date>2011-10-17</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</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 YMMV.
153 </p>
154
155 <p>
156 There is also a 15-partition limit for SCSI and SATA.
157 </p>
158
159 </body>
160 </subsection>
161 </section>
162 <section id="mac-fdisk">
163 <title>Default: Using mac-fdisk (Apple G5) to Partition your Disk</title>
164 <body>
165
166 <p>
167 At this point, create your partitions using <c>mac-fdisk</c>:
168 </p>
169
170 <pre caption="Starting mac-fdisk">
171 # <i>mac-fdisk /dev/sda</i>
172 </pre>
173
174 <p>
175 First delete the partitions you have cleared previously to make room for your
176 Linux partitions. Use <c>d</c> in <c>mac-fdisk</c> to delete those partition(s).
177 It will ask for the partition number to delete.
178 </p>
179
180 <p>
181 Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will
182 ask for what block you want to start. Enter the number of your first free
183 partition, followed by a <c>p</c>. For instance this is <c>2p</c>.
184 </p>
185
186 <note>
187 This partition is <e>not</e> a "boot" partition. It is not used by Linux at all;
188 you don't have to place any filesystem on it and you should never mount it. PPC
189 users don't need an extra partition for <path>/boot</path>.
190 </note>
191
192 <p>
193 Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will
194 ask for what block you want to start this partition from. As we used <c>2</c>
195 before to create the Apple_Bootstrap partition, you now have to enter
196 <c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size
197 you want). When asked for a name, enter <c>swap</c> (mandatory).
198 </p>
199
200 <p>
201 To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select
202 from what block the root partition should start. When asked for the size, enter
203 <c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available
204 space". When asked for the name, enter <c>root</c> (mandatory).
205 </p>
206
207 <p>
208 To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to
209 quit <c>mac-fdisk</c>.
210 </p>
211
212 <note>
213 To make sure everything is ok, you should run mac-fdisk once more and check
214 whether all the partitions are there. If you don't see any of the partitions you
215 created, or the changes you made, you should reinitialize your partitions by
216 pressing <c>i</c> in mac-fdisk. Note that this will recreate the partition map
217 and thus remove all your partitions.
218 </note>
219
220 <p>
221 Now that your partitions are created, you can continue with <uri
222 link="#filesystems">Creating Filesystems</uri>.
223 </p>
224
225 </body>
226 </section>
227 <section id="fdisk">
228 <title>IBM pSeries, iSeries and OpenPower: using fdisk to Partition your Disk</title>
229 <subsection>
230 <body>
231
232 <note>
233 If you are planning to use a RAID disk array for your Gentoo installation and
234 you are using POWER5-based hardware, you should now run <c>iprconfig</c> to
235 format the disks to Advanced Function format and create the disk array. You
236 should emerge <c>iprutils</c> after your install is complete.
237 </note>
238
239 <p>
240 If you have an ipr-based SCSI adapter, you should start the ipr utilities now.
241 </p>
242
243 <pre caption="Starting ipr utilities">
244 # <i>/etc/init.d/iprinit start</i>
245 </pre>
246
247 <p>
248 The following parts explain how to create the example partition layout
249 described previously, namely:
250 </p>
251
252 <table>
253 <tr>
254 <th>Partition</th>
255 <th>Description</th>
256 </tr>
257 <tr>
258 <ti><path>/dev/sda1</path></ti>
259 <ti>PPC PReP Boot partition</ti>
260 </tr>
261 <tr>
262 <ti><path>/dev/sda2</path></ti>
263 <ti>Swap partition</ti>
264 </tr>
265 <tr>
266 <ti><path>/dev/sda3</path></ti>
267 <ti>Root partition</ti>
268 </tr>
269 </table>
270
271 <p>
272 Change your partition layout according to your own preference.
273 </p>
274
275 </body>
276 </subsection>
277 <subsection>
278 <title>Viewing the Current Partition Layout</title>
279 <body>
280
281 <p>
282 <c>fdisk</c> is a popular and powerful tool to split your disk into
283 partitions. Fire up <c>fdisk</c> on your disk (in our example, we
284 use <path>/dev/sda</path>):
285 </p>
286
287 <pre caption="Starting fdisk">
288 # <i>fdisk /dev/sda</i>
289 </pre>
290
291 <p>
292 Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like
293 this:
294 </p>
295
296 <pre caption="fdisk prompt">
297 Command (m for help):
298 </pre>
299
300 <p>
301 If you still have an AIX partition layout on your system, you will get the
302 following error message:
303 </p>
304
305 <pre caption="Error message from fdisk">
306 There is a valid AIX label on this disk.
307 Unfortunately Linux cannot handle these
308 disks at the moment. Nevertheless some
309 advice:
310 1. fdisk will destroy its contents on write.
311 2. Be sure that this disk is NOT a still vital
312 part of a volume group. (Otherwise you may
313 erase the other disks as well, if unmirrored.)
314 3. Before deleting this physical volume be sure
315 to remove the disk logically from your AIX
316 machine. (Otherwise you become an AIXpert).
317
318 Command (m for help):
319 </pre>
320
321 <p>
322 Don't worry, you can create a new empty DOS partition table by pressing
323 <c>o</c>.
324 </p>
325
326 <warn>
327 This will destroy any installed AIX version!
328 </warn>
329
330 <p>
331 Type <c>p</c> to display your disk current partition configuration:
332 </p>
333
334 <pre caption="An example partition configuration">
335 Command (m for help): <i>p</i>
336
337 Disk /dev/sda: 30.7 GB, 30750031872 bytes
338 141 heads, 63 sectors/track, 6761 cylinders
339 Units = cylinders of 8883 * 512 = 4548096 bytes
340
341 Device Boot Start End Blocks Id System
342 /dev/sda1 1 12 53266+ 83 Linux
343 /dev/sda2 13 233 981571+ 82 Linux swap
344 /dev/sda3 234 674 1958701+ 83 Linux
345 /dev/sda4 675 6761 27035410+ 5 Extended
346 /dev/sda5 675 2874 9771268+ 83 Linux
347 /dev/sda6 2875 2919 199836 83 Linux
348 /dev/sda7 2920 3008 395262 83 Linux
349 /dev/sda8 3009 6761 16668918 83 Linux
350
351 Command (m for help):
352 </pre>
353
354 <p>
355 This particular disk is configured to house six Linux filesystems
356 (each with a corresponding partition listed as "Linux") as well as a
357 swap partition (listed as "Linux swap").
358 </p>
359
360 </body>
361 </subsection>
362 <subsection>
363 <title>Removing all Partitions</title>
364 <body>
365
366 <p>
367 We will first remove all existing partitions from the disk. Type
368 <c>d</c> to delete a partition. For instance, to delete an existing
369 <path>/dev/sda1</path>:
370 </p>
371
372 <note>
373 If you don't want to delete all partitions just delete those you want to delete.
374 At this point you should create a backup of your data to avoid losing it.
375 </note>
376
377 <pre caption="Deleting a partition">
378 Command (m for help): <i>d</i>
379 Partition number (1-4): <i>1</i>
380 </pre>
381
382 <p>
383 The partition has been scheduled for deletion. It will no longer show up
384 if you type <c>p</c>, but it will not be erased until your changes have
385 been saved. If you made a mistake and want to abort without saving your
386 changes, type <c>q</c> immediately and hit Enter and your partition will
387 not be deleted.
388 </p>
389
390 <p>
391 Now, assuming that you do indeed want to wipe out all the partitions on
392 your system, repeatedly type <c>p</c> to print out a partition listing
393 and then type <c>d</c> and the number of the partition to delete it.
394 Eventually, you'll end up with a partition table with nothing in it:
395 </p>
396
397 <pre caption="An empty partition table">
398 Disk /dev/sda: 30.7 GB, 30750031872 bytes
399 141 heads, 63 sectors/track, 6761 cylinders
400 Units = cylinders of 8883 * 512 = 4548096 bytes
401
402 Device Boot Start End Blocks Id System
403
404 Command (m for help):
405 </pre>
406
407 <p>
408 Now that the in-memory partition table is empty, we're ready to create
409 the partitions. We will use a default partitioning scheme as discussed
410 previously. Of course, don't follow these instructions to the letter if
411 you don't want the same partitioning scheme!
412 </p>
413
414 </body>
415 </subsection>
416 <subsection>
417 <title>Creating the PPC PReP boot partition</title>
418 <body>
419
420 <p>
421 We first create a small PReP boot partition. Type <c>n</c> to create a new
422 partition, then <c>p</c> to select a primary partition, followed by
423 <c>1</c> to select the first primary partition. When prompted for the
424 first cylinder, hit enter. When prompted for the last cylinder, type
425 <c>+7M</c> to create a partition 7 MB in size. After you've done
426 this, type <c>t</c> to set the partition type, <c>1</c> to select the
427 partition you just created and then type in <c>41</c> to set the
428 partition type to "PPC PReP Boot". Finally, you'll need to mark the PReP
429 partition as bootable.
430 </p>
431
432 <note>
433 The PReP partition has to be smaller than 8 MB!
434 </note>
435
436 <pre caption="Creating the PReP boot partition">
437 Command (m for help): <i>p</i>
438
439 Disk /dev/sda: 30.7 GB, 30750031872 bytes
440 141 heads, 63 sectors/track, 6761 cylinders
441 Units = cylinders of 8883 * 512 = 4548096 bytes
442
443 Device Boot Start End Blocks Id System
444
445 Command (m for help): <i>n</i>
446 Command action
447 e extended
448 p primary partition (1-4)
449 <i>p</i>
450 Partition number (1-4): <i>1</i>
451 First cylinder (1-6761, default 1):
452 Using default value 1
453 Last cylinder or +size or +sizeM or +sizeK (1-6761, default
454 6761): <i>+8M</i>
455
456 Command (m for help): <i>t</i>
457 Selected partition 1
458 Hex code (type L to list codes): <i>41</i>
459 Changed system type of partition 1 to 41 (PPC PReP Boot)
460
461 Command (m for help): <i>a</i>
462 Partition number (1-4): <i>1</i>
463 Command (m for help):
464 </pre>
465
466 <p>
467 Now, when you type <c>p</c>, you should see the following partition information:
468 </p>
469
470 <pre caption="Created boot partition">
471 Command (m for help): <i>p</i>
472
473 Disk /dev/sda: 30.7 GB, 30750031872 bytes
474 141 heads, 63 sectors/track, 6761 cylinders
475 Units = cylinders of 8883 * 512 = 4548096 bytes
476
477 Device Boot Start End Blocks Id System
478 /dev/sda1 * 1 3 13293 41 PPC PReP Boot
479
480 Command (m for help):
481 </pre>
482 </body>
483 </subsection>
484 <subsection>
485 <title>Creating the Swap Partition</title>
486 <body>
487
488 <p>
489 Let's now create the swap partition. To do this, type <c>n</c> to create
490 a new partition, then <c>p</c> to tell fdisk that you want a primary
491 partition. Then type <c>2</c> to create the second primary partition,
492 <path>/dev/sda2</path> in our case. When prompted for the first
493 cylinder, hit enter. When prompted for the last cylinder, type
494 <c>+512M</c> to create a partition 512MB in size. After you've done
495 this, type <c>t</c> to set the partition type, <c>2</c> to select the
496 partition you just created and then type in <c>82</c> to set the
497 partition type to "Linux Swap". After completing these steps, typing
498 <c>p</c> should display a partition table that looks similar to this:
499 </p>
500
501 <pre caption="Partition listing after creating a swap partition">
502 Command (m for help): <i>p</i>
503
504 Disk /dev/sda: 30.7 GB, 30750031872 bytes
505 141 heads, 63 sectors/track, 6761 cylinders
506 Units = cylinders of 8883 * 512 = 4548096 bytes
507
508 Device Boot Start End Blocks Id System
509 /dev/sda1 1 3 13293 41 PPC PReP Boot
510 /dev/sda2 4 117 506331 82 Linux swap
511
512 Command (m for help):
513 </pre>
514
515 </body>
516 </subsection>
517 <subsection>
518 <title>Creating the Root Partition</title>
519 <body>
520
521 <p>
522 Finally, let's create the root partition. To do this, type <c>n</c> to
523 create a new partition, then <c>p</c> to tell fdisk that you want a
524 primary partition. Then type <c>3</c> to create the third primary
525 partition, <path>/dev/sda3</path> in our case. When prompted for the
526 first cylinder, hit enter. When prompted for the last cylinder, hit
527 enter to create a partition that takes up the rest of the remaining
528 space on your disk. After completing these steps, typing <c>p</c> should
529 display a partition table that looks similar to this:
530 </p>
531
532 <pre caption="Partition listing after creating the root partition">
533 Command (m for help): <i>p</i>
534
535 Disk /dev/sda: 30.7 GB, 30750031872 bytes
536 141 heads, 63 sectors/track, 6761 cylinders
537 Units = cylinders of 8883 * 512 = 4548096 bytes
538
539 Device Boot Start End Blocks Id System
540 /dev/sda1 1 3 13293 41 PPC PReP Boot
541 /dev/sda2 4 117 506331 82 Linux swap
542 /dev/sda3 118 6761 29509326 83 Linux
543
544 Command (m for help):
545 </pre>
546 </body>
547 </subsection>
548 <subsection>
549 <title>Saving the Partition Layout</title>
550 <body>
551
552 <p>
553 To save the partition layout and exit <c>fdisk</c>, type <c>w</c>.
554 </p>
555
556 <pre caption="Save and exit fdisk">
557 Command (m for help): <i>w</i>
558 </pre>
559
560 <p>
561 Now that your partitions are created, you can continue with <uri
562 link="#filesystems">Creating Filesystems</uri>.
563 </p>
564
565 </body>
566 </subsection>
567 </section>
568 <section id="filesystems">
569 <title>Creating Filesystems</title>
570 <subsection>
571 <title>Introduction</title>
572 <body>
573
574 <p>
575 Now that your partitions are created, it is time to place a filesystem on them.
576 If you don't care about what filesystem to choose and are happy with what we use
577 as default in this handbook, continue with <uri
578 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
579 Otherwise read on to learn about the available filesystems...
580 </p>
581
582 </body>
583 </subsection>
584
585 <subsection>
586 <include href="hb-install-filesystems.xml"/>
587 </subsection>
588
589 <subsection id="filesystems-apply">
590 <title>Applying a Filesystem to a Partition</title>
591 <body>
592
593 <p>
594 To create a filesystem on a partition or volume, there are tools available for
595 each possible filesystem:
596 </p>
597
598 <table>
599 <tr>
600 <th>Filesystem</th>
601 <th>Creation Command</th>
602 </tr>
603 <tr>
604 <ti>ext2</ti>
605 <ti><c>mke2fs</c></ti>
606 </tr>
607 <tr>
608 <ti>ext3</ti>
609 <ti><c>mke2fs -j</c></ti>
610 </tr>
611 <tr>
612 <ti>reiserfs</ti>
613 <ti><c>mkreiserfs</c></ti>
614 </tr>
615 <tr>
616 <ti>xfs</ti>
617 <ti><c>mkfs.xfs</c></ti>
618 </tr>
619 <tr>
620 <ti>jfs</ti>
621 <ti><c>mkfs.jfs</c></ti>
622 </tr>
623 </table>
624
625 <p>
626 For instance, to have the root partition (<path>/dev/sda4</path> in our example)
627 in ext3 (as in our example), you would use:
628 </p>
629
630 <pre caption="Applying a filesystem on a partition">
631 # <i>mke2fs -j /dev/sda4</i>
632 </pre>
633
634 <p>
635 Now create the filesystems on your newly created partitions (or logical
636 volumes).
637 </p>
638
639 <impo>
640 If you choose to use ReiserFS for <path>/</path>, do not change its default
641 block size if you will also be using <c>yaboot</c> as your bootloader, as
642 explained in <uri link="?part=1&amp;chap=10">Configuring the Bootloader</uri>.
643 </impo>
644
645 </body>
646 </subsection>
647 <subsection>
648 <title>Activating the Swap Partition</title>
649 <body>
650
651 <p>
652 <c>mkswap</c> is the command that is used to initialize swap partitions:
653 </p>
654
655 <pre caption="Creating a Swap signature">
656 # <i>mkswap /dev/sda3</i>
657 </pre>
658
659 <p>
660 To activate the swap partition, use <c>swapon</c>:
661 </p>
662
663 <pre caption="Activating the swap partition">
664 # <i>swapon /dev/sda3</i>
665 </pre>
666
667 <p>
668 Create and activate the swap with the commands mentioned above.
669 </p>
670
671 </body>
672 </subsection>
673 </section>
674 <section>
675 <title>Mounting</title>
676 <body>
677
678 <p>
679 Now that your partitions are initialized and are housing a filesystem, it is
680 time to mount those partitions. Use the <c>mount</c> command. Don't forget to
681 create the necessary mount directories for every partition you created. As an
682 example we create a mount point and mount the root partition:
683 </p>
684
685 <pre caption="Mounting partitions">
686 # <i>mkdir /mnt/gentoo</i>
687 # <i>mount /dev/sda4 /mnt/gentoo</i>
688 </pre>
689
690 <note>
691 If you want your <path>/tmp</path> to reside on a separate partition, be sure to
692 change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
693 also holds for <path>/var/tmp</path>.
694 </note>
695
696 <p>
697 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
698 Installation Files</uri>.
699 </p>
700
701 </body>
702 </section>
703 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20