/[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.30 - (hide annotations) (download) (as text)
Tue Aug 2 08:03:53 2005 UTC (9 years, 1 month ago) by swift
Branch: MAIN
Changes since 1.29: +6 -5 lines
File MIME type: application/xml
#101034 - Adding "-O dir_index" information to the guide

Leaving it out of the real example mke2fs command to "stage" it. When we know
more about this b-tree stability and architectural support we can follow the
SPARC handbook and use it by default.

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

  ViewVC Help
Powered by ViewVC 1.1.20