/[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.37 - (hide annotations) (download) (as text)
Thu Nov 2 20:49:38 2006 UTC (7 years, 5 months ago) by nightmorph
Branch: MAIN
Changes since 1.36: +14 -13 lines
File MIME type: application/xml
Reworded reiserfs and ext3 descriptions for bug 153518

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 nightmorph 1.37 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.36 2006/08/30 22:52:28 nightmorph Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.20
11 nightmorph 1.37 <version>7.1</version>
12     <date>2006-11-02</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 nightmorph 1.36 <ti>(Not needed)</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 nightmorph 1.36 <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 nightmorph 1.36 There are some partitions named: <path>Apple_Driver63, Apple_Driver_ATA,
143 swift 1.31 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 nightmorph 1.36
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 nightmorph 1.36 Mac OS X before resizing. Remember that any resizing operation is dangerous,
153     so attempt at your own risk! Be sure to always have a backup of your data
154 fox2mike 1.34 before resizing!
155 swift 1.28 </warn>
156 nightmorph 1.36
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 nightmorph 1.36 choice of filesystem will then maximise 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 nightmorph 1.36 majority of applications, the Portage tree alone takes around 500 Mbyte
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 nightmorph 1.36 It will ask for the partition number to delete. Usually the first partition on
235     NewWorld machines (Apple_partition_map) could not be deleted.
236 swift 1.1 </p>
237    
238     <p>
239 nightmorph 1.36 Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will
240     ask for what block you want to start. Enter the number of your first free
241     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 nightmorph 1.36 you want -- 512MB is recommended though). When asked for a name, enter <c>swap</c>
256     (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 nightmorph 1.36 <title>Using parted (especially 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 nightmorph 1.36 If the drive is unpartitioned, 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 nightmorph 1.36 to store the MorphOS kernel. If you have a Pegasos I or intend to use reiserfs or
320     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 nightmorph 1.37 journaling for fast recovery in addition to other enhanced journaling modes
396     like full data and ordered data journaling. It uses a hashed B*-tree index that
397     enables high performance in almost all situations. In short, ext3 is a very
398     good and reliable filesystem.
399 swift 1.1 </p>
400    
401     <p>
402 nightmorph 1.37 <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
403     performance and greatly outperforms both ext2 and ext3 when dealing with small
404     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
405     extremely well and has metadata journaling. ReiserFS is solid and usable as
406     both general-purpose filesystem and for extreme cases such as the creation of
407     large filesystems, very large files and directories containing tens of
408     thousands of small files.
409 swift 1.1 </p>
410    
411     <p>
412 neysx 1.10 <b>XFS</b> is a filesystem with metadata journaling which comes with a robust
413     feature-set and is optimized for scalability. We only recommend using this
414     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
415     an uninterruptible power supply. Because XFS aggressively caches in-transit data
416     in RAM, improperly designed programs (those that don't take proper precautions
417     when writing files to disk and there are quite a few of them) can lose a good
418     deal of data if the system goes down unexpectedly.
419 swift 1.1 </p>
420    
421     </body>
422     </subsection>
423     <subsection id="filesystems-apply">
424     <title>Applying a Filesystem to a Partition</title>
425     <body>
426    
427     <p>
428     To create a filesystem on a partition or volume, there are tools available for
429     each possible filesystem:
430     </p>
431    
432     <table>
433     <tr>
434     <th>Filesystem</th>
435     <th>Creation Command</th>
436     </tr>
437     <tr>
438     <ti>ext2</ti>
439 swift 1.28 <ti><c>mkfs.ext2</c></ti>
440 swift 1.1 </tr>
441     <tr>
442     <ti>ext3</ti>
443 swift 1.28 <ti><c>mkfs.ext3</c></ti>
444 swift 1.1 </tr>
445     <tr>
446     <ti>reiserfs</ti>
447 swift 1.28 <ti><c>mkfs.reiserfs</c></ti>
448 swift 1.1 </tr>
449     <tr>
450     <ti>xfs</ti>
451     <ti><c>mkfs.xfs</c></ti>
452     </tr>
453     </table>
454    
455     <p>
456 swift 1.22 For instance, to have the root partition (<path>/dev/hda4</path> in our example)
457 swift 1.1 in ext3 (as in our example), you would use:
458     </p>
459    
460     <pre caption="Applying a filesystem on a partition">
461 swift 1.28 # <i>mkfs.ext3 /dev/hda4</i>
462 swift 1.1 </pre>
463    
464     <p>
465     Now create the filesystems on your newly created partitions (or logical
466     volumes).
467     </p>
468    
469 dertobi123 1.11 <note>
470 nightmorph 1.36 On the PegasosII your partition which holds the kernel must be ext2/ext3 or
471     affs1. NewWorld machines can boot from any of ext2, ext3, XFS, ReiserFS or
472     even HFS/HFS+ filesystems. On OldWorld machines booting with BootX, the kernel
473     must be placed on an HFS partition, but this will be completed when you
474     configure your bootloader.
475 dertobi123 1.11 </note>
476    
477 swift 1.1 </body>
478     </subsection>
479     <subsection>
480     <title>Activating the Swap Partition</title>
481     <body>
482    
483     <p>
484     <c>mkswap</c> is the command that is used to initialize swap partitions:
485     </p>
486    
487     <pre caption="Creating a Swap signature">
488 swift 1.22 # <i>mkswap /dev/hda3</i>
489 swift 1.1 </pre>
490    
491     <p>
492     To activate the swap partition, use <c>swapon</c>:
493     </p>
494    
495     <pre caption="Activating the swap partition">
496 swift 1.22 # <i>swapon /dev/hda3</i>
497 swift 1.1 </pre>
498    
499     <p>
500 swift 1.28 Create and activate the swap now.
501 swift 1.1 </p>
502    
503     </body>
504     </subsection>
505     </section>
506     <section>
507     <title>Mounting</title>
508     <body>
509    
510     <p>
511     Now that your partitions are initialized and are housing a filesystem, it is
512 nightmorph 1.36 time to mount those partitions. Use the <c>mount</c> command. As an example we
513     mount the root partition:
514 swift 1.1 </p>
515    
516     <pre caption="Mounting partitions">
517 swift 1.22 # <i>mount /dev/hda4 /mnt/gentoo</i>
518 swift 1.1 </pre>
519    
520     <note>
521     If you want your <path>/tmp</path> to reside on a separate partition, be sure to
522     change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
523     also holds for <path>/var/tmp</path>.
524     </note>
525    
526 pylon 1.4 <p>
527 sejo 1.24 We will have to mount the proc filesystem (a virtual interface with the
528 swift 1.22 kernel) on <path>/proc</path>. But first we will need to place our files on the
529     partitions.
530 swift 1.12 </p>
531    
532     <p>
533     Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
534 swift 1.1 Installation Files</uri>.
535     </p>
536    
537     </body>
538     </section>
539     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20