/[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.20 - (hide annotations) (download) (as text)
Tue Nov 9 13:01:52 2004 UTC (9 years, 11 months ago) by swift
Branch: MAIN
Changes since 1.19: +5 -1 lines
File MIME type: application/xml
Adding version/date information in pages

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

  ViewVC Help
Powered by ViewVC 1.1.20