/[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.35 - (hide annotations) (download) (as text)
Tue Jul 25 18:01:45 2006 UTC (7 years, 11 months ago) by josejx
Branch: MAIN
Changes since 1.34: +8 -3 lines
File MIME type: application/xml
Added note that MacOS is MacOS 9 or earlier.  Added example for boot arguments.  Added note about OldWorld partitioning.

1 swift 1.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 swift 1.29 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.1
7 josejx 1.35 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.34 2006/02/27 00:55:34 fox2mike Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.20
11 josejx 1.35 <version>2.6</version>
12     <date>2006-07-25</date>
13 swift 1.20
14 swift 1.1 <section>
15     <title>Introduction to Block Devices</title>
16     <subsection>
17     <title>Block Devices</title>
18     <body>
19    
20     <p>
21     We'll take a good look at disk-oriented aspects of Gentoo Linux
22     and Linux in general, including Linux filesystems, partitions and block devices.
23     Then, once you're familiar with the ins and outs of disks and filesystems,
24     you'll be guided through the process of setting up partitions and filesystems
25     for your Gentoo Linux installation.
26     </p>
27    
28     <p>
29 fox2mike 1.34 To begin, we'll introduce <e>block devices</e>. The most common block device is
30     the one that represents the first IDE drive in a Linux system, namely
31     <path>/dev/hda</path>. If you are installing onto SCSI, FireWire, USB or SATA
32     drives, then your first hard drive would be <path>/dev/sda</path>.
33 swift 1.1 </p>
34    
35     <p>
36     The block devices above represent an abstract interface to the disk. User
37     programs can use these block devices to interact with your disk without worrying
38     about whether your drives are IDE, SCSI or something else. The program can
39     simply address the storage on the disk as a bunch of contiguous,
40     randomly-accessible 512-byte blocks.
41     </p>
42    
43     </body>
44     </subsection>
45     <subsection>
46 swift 1.31 <title>Partitions</title>
47 swift 1.1 <body>
48    
49     <p>
50     Although it is theoretically possible to use a full disk to house your Linux
51     system, this is almost never done in practice. Instead, full disk block devices
52     are split up in smaller, more manageable block devices. On most systems,
53 swift 1.31 these are called <e>partitions</e>.
54 swift 1.1 </p>
55    
56     </body>
57     </subsection>
58     </section>
59     <section>
60     <title>Designing a Partitioning Scheme</title>
61     <subsection>
62     <title>Default Partitioning Scheme</title>
63     <body>
64    
65     <p>
66     If you are not interested in drawing up a partitioning scheme for your system,
67     you can use the partitioning scheme we use throughout this book:
68     </p>
69    
70 josejx 1.35 <note>
71     If you are using an OldWorld machine, you will need to keep MacOS available.
72     The layout here assumes MacOS is installed on a separate drive.
73     </note>
74    
75 swift 1.1 <table>
76     <tr>
77     <th>Partition NewWorld</th>
78     <th>Partition OldWorld</th>
79 swift 1.8 <th>Partition Pegasos</th>
80 swift 1.28 <th>Partition RS/6000</th>
81 swift 1.1 <th>Filesystem</th>
82     <th>Size</th>
83     <th>Description</th>
84     </tr>
85     <tr>
86     <ti><path>/dev/hda1</path></ti>
87 swift 1.28 <ti><path>/dev/hda1</path></ti>
88     <ti>(Not applicable)</ti>
89 swift 1.8 <ti>(Not applicable)</ti>
90 sejo 1.18 <ti>(Partition Map)</ti>
91 sejo 1.17 <ti>32k</ti>
92     <ti>Apple_partition_map</ti>
93     </tr>
94     <tr>
95     <ti><path>/dev/hda2</path></ti>
96 swift 1.31 <ti>(Not applicable)</ti>
97 sejo 1.17 <ti>(Not applicable)</ti>
98 swift 1.28 <ti>(Not applicable)</ti>
99 sejo 1.17 <ti>(bootstrap)</ti>
100 swift 1.1 <ti>800k</ti>
101     <ti>Apple_Bootstrap</ti>
102     </tr>
103     <tr>
104 vanquirius 1.33 <ti>(Not applicable)</ti>
105 swift 1.28 <ti>(Not applicable)</ti>
106     <ti>(Not applicable)</ti>
107     <ti><path>/dev/sda1</path></ti>
108     <ti>(PReP Boot)</ti>
109     <ti>800k</ti>
110     <ti>Type 0x41</ti>
111     </tr>
112     <tr>
113 swift 1.31 <ti>(Not applicable)</ti>
114     <ti><path>/dev/hda2</path> (If using quik)</ti>
115 swift 1.28 <ti><path>/dev/hda1</path></ti>
116 fox2mike 1.34 <ti>(Not applicable)</ti>
117 swift 1.28 <ti>ext2</ti>
118     <ti>32MB</ti>
119     <ti>Boot partition</ti>
120     </tr>
121     <tr>
122 sejo 1.17 <ti><path>/dev/hda3</path></ti>
123 swift 1.31 <ti><path>/dev/hda2</path>(<path>/dev/hda3</path> if using quik)</ti>
124 swift 1.28 <ti><path>/dev/hda2</path></ti>
125     <ti><path>/dev/sda2</path></ti>
126 swift 1.1 <ti>(swap)</ti>
127     <ti>512M</ti>
128 swift 1.28 <ti>Swap partition, Type 0x82</ti>
129 swift 1.1 </tr>
130     <tr>
131 sejo 1.17 <ti><path>/dev/hda4</path></ti>
132 swift 1.31 <ti><path>/dev/hda3</path> (<path>/dev/hda4</path> if using quik)</ti>
133 swift 1.28 <ti><path>/dev/hda3</path></ti>
134     <ti><path>/dev/sda3</path></ti>
135     <ti>ext3, xfs</ti>
136 swift 1.1 <ti>Rest of the disk</ti>
137 swift 1.28 <ti>Root partition, Type 0x83</ti>
138 swift 1.1 </tr>
139     </table>
140 dertobi123 1.21
141 sejo 1.19 <note>
142 swift 1.31 There are some partitions named: <path>Apple_Driver43, Apple_Driver_ATA,
143     Apple_FWDriver, Apple_Driver_IOKit, Apple_Patches</path>. If you are not
144     planning to use MacOS 9 you can delete them, because MacOS X and Linux don't
145     need them. To delete them, either use parted or erase the whole disk by
146 fox2mike 1.34 initializing the partition map.
147 sejo 1.19 </note>
148 fox2mike 1.34
149 swift 1.28 <warn>
150 fox2mike 1.34 <c>parted</c> is able to resize partitions including HFS+. Unfortunately it is
151     not possible to resize HFS+ journaled filesystems, so switch off journaling in
152     Mac OS X before resizing. Remeber that any resizing operation is dangerous,
153     so attempt at your own risk! Be sure to always have a backup of your data
154     before resizing!
155 swift 1.28 </warn>
156 fox2mike 1.34
157 swift 1.1 <p>
158 swift 1.22 If you are interested in knowing how big a partition should be, or even how many
159 swift 1.31 partitions you need, read on. Otherwise continue now with
160     <uri link="#mac-fdisk"> Default: Using mac-fdisk (Apple) to Partition your Disk
161     </uri> or <uri link="#parted">Alternative: Using parted (IBM/Pegasos) to
162 swift 1.6 Partition your Disk</uri>.
163 swift 1.1 </p>
164    
165     </body>
166     </subsection>
167     <subsection>
168     <title>How Many and How Big?</title>
169     <body>
170    
171     <p>
172     The number of partitions is highly dependent on your environment. For instance,
173     if you have lots of users, you will most likely want to have your
174     <path>/home</path> separate as it increases security and makes backups easier.
175 swift 1.22 If you are installing Gentoo to perform as a mailserver, your <path>/var</path>
176     should be separate as all mails are stored inside <path>/var</path>. A good
177 swift 1.31 choice of filesystem will then maximize your performance. Gameservers will have
178 swift 1.22 a separate <path>/opt</path> as most gaming servers are installed there. The
179 swift 1.29 reason is similar for <path>/home</path>: security and backups. You will
180     definitely want to keep <path>/usr</path> big: not only will it contain the
181 swift 1.31 majority of applications, the Portage tree alone takes around 500 MB
182 swift 1.29 excluding the various sources that are stored in it.
183 swift 1.1 </p>
184    
185     <p>
186     As you can see, it very much depends on what you want to achieve. Separate
187     partitions or volumes have the following advantages:
188     </p>
189    
190     <ul>
191     <li>
192 neysx 1.9 You can choose the best performing filesystem for each partition or volume
193 swift 1.1 </li>
194     <li>
195     Your entire system cannot run out of free space if one defunct tool is
196     continuously writing files to a partition or volume
197     </li>
198     <li>
199     If necessary, file system checks are reduced in time, as multiple checks can
200     be done in parallel (although this advantage is more with multiple disks than
201     it is with multiple partitions)
202     </li>
203     <li>
204 swift 1.28 Security can be enhanced by mounting some partitions or volumes read-only,
205 swift 1.1 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
206     </li>
207     </ul>
208    
209     <p>
210 swift 1.28 However, multiple partitions have one big disadvantage: if not configured
211     properly, you might result in having a system with lots of free space on one
212     partition and none on another. There is also a 15-partition limit for SCSI and
213     SATA.
214 swift 1.1 </p>
215    
216     </body>
217     </subsection>
218     </section>
219 swift 1.31 <section id="mac-fdisk">
220 swift 1.28 <title>Default: Using mac-fdisk (Apple) Partition your Disk</title>
221 swift 1.1 <body>
222    
223     <p>
224     At this point, create your partitions using <c>mac-fdisk</c>:
225     </p>
226    
227     <pre caption="Starting mac-fdisk">
228     # <i>mac-fdisk /dev/hda</i>
229     </pre>
230    
231     <p>
232     First delete the partitions you have cleared previously to make room for your
233     Linux partitions. Use <c>d</c> in <c>mac-fdisk</c> to delete those partition(s).
234 swift 1.31 It will ask for the partition number to delete. The first partition on Apple
235     machines (Apple_partition_map) can not be deleted.
236 swift 1.1 </p>
237    
238     <p>
239 swift 1.31 On NewWorld Macs, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>.
240     It will ask for what block you want to start. Enter the number of your first
241     free partition, followed by a <c>p</c>. For instance this is <c>2p</c>.
242 swift 1.1 </p>
243    
244     <note>
245 swift 1.28 This partition is <e>not</e> a <path>/boot</path> partition. It is not used by
246     Linux at all; you don't have to place any filesystem on it and you should never
247     mount it. Apple users don't need an extra partition for <path>/boot</path>.
248 swift 1.1 </note>
249    
250     <p>
251     Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will
252 swift 1.22 ask for what block you want to start this partition from. As we used <c>2</c>
253 swift 1.1 before to create the Apple_Bootstrap partition, you now have to enter
254 swift 1.22 <c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size
255 swift 1.31 you want -- 512MB is recommended though). When asked for a name, enter
256     <c>swap</c> (mandatory).
257 swift 1.1 </p>
258    
259     <p>
260 swift 1.22 To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select
261 swift 1.1 from what block the root partition should start. When asked for the size, enter
262 swift 1.22 <c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available
263 swift 1.1 space". When asked for the name, enter <c>root</c> (mandatory).
264     </p>
265    
266     <p>
267     To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to
268     quit <c>mac-fdisk</c>.
269     </p>
270 dertobi123 1.21
271 sejo 1.19 <note>
272 dertobi123 1.21 To make sure everything is ok, you should run mac-fdisk once more and check
273     whether all the partitions are there. If you don't see any of the partitions
274     you created, or the changes you made, you should reinitialize your partitions
275     by pressing "i" in mac-fdisk. Note that this will recreate the partition map
276     and thus remove all your partitions.
277 sejo 1.19 </note>
278 dertobi123 1.21
279 swift 1.1 <p>
280 swift 1.22 Now that your partitions are created, you can continue with <uri
281 swift 1.1 link="#filesystems">Creating Filesystems</uri>.
282     </p>
283    
284     </body>
285     </section>
286 swift 1.6 <section id="parted">
287 swift 1.31 <title>Using parted (Mostly Pegasos) to Partition your Disk</title>
288 swift 1.6 <body>
289    
290     <p>
291 dertobi123 1.11 <c>parted</c>, the Partition Editor, can now handle HFS+ partitions used by
292 swift 1.28 Mac OS and Mac OS X. With this tool you can resize your Mac-partitions and
293 dertobi123 1.11 create space for your Linux partitions. Nevertheless, the example below
294     describes partitioning for Pegasos machines only.
295     </p>
296    
297     <p>
298 swift 1.6 To begin let's fire up <c>parted</c>:
299     </p>
300    
301     <pre caption="Starting parted">
302     # <i>parted /dev/hda</i>
303     </pre>
304    
305     <p>
306 swift 1.31 If the drive isn't partitioned, run <c>mklabel amiga</c> to create a new
307 swift 1.6 disklabel for the drive.
308     </p>
309    
310     <p>
311     You can type <c>print</c> at any time in parted to display the current partition
312 swift 1.28 table. If at any time you change your mind or made a mistake you can press
313     <c>Ctrl-c</c> to abort parted.
314 swift 1.6 </p>
315    
316     <p>
317     If you intend to also install MorphOS on your Pegasos create an affs1 filesystem
318 swift 1.28 named "BI0" (BI zero) at the start of the drive. 32MB should be more than enough
319 swift 1.31 to store the MorphOS kernel. If you have a Pegasos I or intend to use reiserfs
320     or xfs, you will also have to store your Linux kernel on this partition (the
321 swift 1.28 Pegasos II can only boot from ext2/ext3 or affs1 partitions). To create the partition run
322 swift 1.6 <c>mkpart primary affs1 START END</c> where <c>START</c> and <c>END</c> should
323 swift 1.28 be replaced with the megabyte range (e.g. <c>0 32</c> creates a 32 MB partition
324     starting at 0MB and ending at 32MB.
325 swift 1.6 </p>
326    
327     <p>
328     You need to create two partitions for Linux, one root filesystem for all your
329     program files etc, and one swap partition. To create the root filesystem you
330     must first decide which filesystem to use. Possible options are ext2, ext3,
331 neysx 1.14 reiserfs and xfs. Unless you know what you are doing, use ext3. Run
332 swift 1.6 <c>mkpart primary ext3 START END</c> to create an ext3 partition. Again, replace
333     <c>START</c> and <c>END</c> with the megabyte start and stop marks for the
334     partition.
335     </p>
336    
337     <p>
338     It is generally recommended that you create a swap partition the same size as
339     the amount of RAM in your computer times two. You will probably get away with a
340     smaller swap partition unless you intend to run a lot of applications at the
341     same time (although at least 512MB is recommended). To create the swap
342     partition, run <c>mkpart primary linux-swap START END</c>.
343     </p>
344    
345     <p>
346     Write down the partition minor numbers as they are required during the
347 swift 1.22 installation process. To display the minor numbers run <c>print</c>. Your drives
348 swift 1.6 are accessed as <path>/dev/hdaX</path> where X is replaced with the minor number
349     of the partition.
350     </p>
351    
352     <p>
353     When you are done in parted simply run <c>quit</c>.
354     </p>
355    
356     </body>
357     </section>
358 swift 1.1 <section id="filesystems">
359     <title>Creating Filesystems</title>
360     <subsection>
361     <title>Introduction</title>
362     <body>
363    
364     <p>
365 swift 1.28 Now that your partitions are created, it is time to place a filesystem on them.
366 swift 1.1 If you don't care about what filesystem to choose and are happy with what we use
367 swift 1.28 as default in this handbook, continue with <uri
368     link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
369 swift 1.1 Otherwise read on to learn about the available filesystems...
370     </p>
371    
372     </body>
373     </subsection>
374     <subsection>
375     <title>Filesystems?</title>
376     <body>
377    
378     <p>
379 swift 1.31 Several filesystems are available. ext2, ext3, ReiserFS and XFS have been found
380     stable on the PPC architecture.
381 swift 1.1 </p>
382    
383     <p>
384     <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
385     journaling, which means that routine ext2 filesystem checks at startup time can
386     be quite time-consuming. There is now quite a selection of newer-generation
387     journaled filesystems that can be checked for consistency very quickly and are
388     thus generally preferred over their non-journaled counterparts. Journaled
389     filesystems prevent long delays when you boot your system and your filesystem
390     happens to be in an inconsistent state.
391     </p>
392    
393     <p>
394     <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
395     journaling for fast recovery in addition to other enhanced journaling modes like
396     full data and ordered data journaling. ext3 is a very good and reliable
397     filesystem. It has an additional hashed b-tree indexing option that enables
398 swift 1.30 high performance in almost all situations. You can enable this indexing by
399     adding <c>-O dir_index</c> to the <c>mke2fs</c> command. In short, ext3 is an
400     excellent filesystem.
401 swift 1.1 </p>
402    
403     <p>
404     <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
405     performance and greatly outperforms both ext2 and ext3 when dealing with small
406     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
407     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
408     solid and usable as both general-purpose filesystem and for extreme cases such
409     as the creation of large filesystems, the use of many small files, very large
410 swift 1.31 files and directories containing tens of thousands of files.
411 swift 1.1 </p>
412    
413     <p>
414 neysx 1.10 <b>XFS</b> is a filesystem with metadata journaling which comes with a robust
415     feature-set and is optimized for scalability. We only recommend using this
416     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
417     an uninterruptible power supply. Because XFS aggressively caches in-transit data
418     in RAM, improperly designed programs (those that don't take proper precautions
419     when writing files to disk and there are quite a few of them) can lose a good
420     deal of data if the system goes down unexpectedly.
421 swift 1.1 </p>
422    
423     </body>
424     </subsection>
425     <subsection id="filesystems-apply">
426     <title>Applying a Filesystem to a Partition</title>
427     <body>
428    
429     <p>
430     To create a filesystem on a partition or volume, there are tools available for
431     each possible filesystem:
432     </p>
433    
434     <table>
435     <tr>
436     <th>Filesystem</th>
437     <th>Creation Command</th>
438     </tr>
439     <tr>
440     <ti>ext2</ti>
441 swift 1.28 <ti><c>mkfs.ext2</c></ti>
442 swift 1.1 </tr>
443     <tr>
444     <ti>ext3</ti>
445 swift 1.28 <ti><c>mkfs.ext3</c></ti>
446 swift 1.1 </tr>
447     <tr>
448     <ti>reiserfs</ti>
449 swift 1.28 <ti><c>mkfs.reiserfs</c></ti>
450 swift 1.1 </tr>
451     <tr>
452     <ti>xfs</ti>
453     <ti><c>mkfs.xfs</c></ti>
454     </tr>
455     </table>
456    
457     <p>
458 swift 1.22 For instance, to have the root partition (<path>/dev/hda4</path> in our example)
459 swift 1.1 in ext3 (as in our example), you would use:
460     </p>
461    
462     <pre caption="Applying a filesystem on a partition">
463 swift 1.28 # <i>mkfs.ext3 /dev/hda4</i>
464 swift 1.1 </pre>
465    
466     <p>
467     Now create the filesystems on your newly created partitions (or logical
468     volumes).
469     </p>
470    
471 dertobi123 1.11 <note>
472 swift 1.31 On the PegasosII your partition which holds the kernel must be ext2 or ext3.
473     NewWorld machines can boot from any of ext2, ext3, XFS, ReiserFS or even
474     HFS/HFS+ filesystems. On OldWorld machines booting with BootX, the kernel must
475     be placed on an HFS partition, but this will be completed when you configure
476     your bootloader.
477 dertobi123 1.11 </note>
478    
479 swift 1.1 </body>
480     </subsection>
481     <subsection>
482     <title>Activating the Swap Partition</title>
483     <body>
484    
485     <p>
486     <c>mkswap</c> is the command that is used to initialize swap partitions:
487     </p>
488    
489     <pre caption="Creating a Swap signature">
490 swift 1.22 # <i>mkswap /dev/hda3</i>
491 swift 1.1 </pre>
492    
493     <p>
494     To activate the swap partition, use <c>swapon</c>:
495     </p>
496    
497     <pre caption="Activating the swap partition">
498 swift 1.22 # <i>swapon /dev/hda3</i>
499 swift 1.1 </pre>
500    
501     <p>
502 swift 1.28 Create and activate the swap now.
503 swift 1.1 </p>
504    
505     </body>
506     </subsection>
507     </section>
508     <section>
509     <title>Mounting</title>
510     <body>
511    
512     <p>
513     Now that your partitions are initialized and are housing a filesystem, it is
514     time to mount those partitions. Use the <c>mount</c> command. Don't forget to
515     create the necessary mount directories for every partition you created. As an
516 swift 1.22 example we create a mount-point and mount the root partition:
517 swift 1.1 </p>
518    
519     <pre caption="Mounting partitions">
520 pylon 1.4 # <i>mkdir /mnt/gentoo</i>
521 swift 1.22 # <i>mount /dev/hda4 /mnt/gentoo</i>
522 swift 1.1 </pre>
523    
524     <note>
525     If you want your <path>/tmp</path> to reside on a separate partition, be sure to
526     change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
527     also holds for <path>/var/tmp</path>.
528     </note>
529    
530 pylon 1.4 <p>
531 sejo 1.24 We will have to mount the proc filesystem (a virtual interface with the
532 swift 1.22 kernel) on <path>/proc</path>. But first we will need to place our files on the
533     partitions.
534 swift 1.12 </p>
535    
536     <p>
537     Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
538 swift 1.1 Installation Files</uri>.
539     </p>
540    
541     </body>
542     </section>
543     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20