/[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.34 - (hide annotations) (download) (as text)
Mon Feb 27 00:55:34 2006 UTC (8 years, 1 month ago) by fox2mike
Branch: MAIN
Changes since 1.33: +16 -18 lines
File MIME type: application/xml
Handbook for 2006.0, "Chuck Norris can divide by zero"

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

  ViewVC Help
Powered by ViewVC 1.1.20