/[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.32 - (hide annotations) (download) (as text)
Thu Aug 25 19:22:50 2005 UTC (8 years, 10 months ago) by neysx
Branch: MAIN
Changes since 1.31: +3 -10 lines
File MIME type: application/xml
#103723 warning about mount -t ext3 not required anymore

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 neysx 1.32 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.31 2005/08/09 09:43:58 swift Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.20
11 neysx 1.32 <version>2.4</version>
12     <date>2005-08-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     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 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 swift 1.28 <ti>(Not applicable</ti>
100     <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     <ti>(Not needed)</ti>
112     <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     initialing the partition map.
142 sejo 1.19 </note>
143 dertobi123 1.21
144 swift 1.28 <warn>
145     <c>parted</c> is able to resize partitions. On the Installation CD there
146 swift 1.31 are patches included to resize HFS+ filesystem. Unfortunately it is risky to
147     resize HFS+ journaled filesystems, be sure to switch off journaling in Mac OS X
148     first and make sure to run a disk checking tool after the resize. Everything
149     you do with resizing in parted you do it at your own risk! Be sure to have a
150     backup of your data!
151 swift 1.28 </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 swift 1.31 partitions you need, read on. Otherwise continue now with
156     <uri link="#mac-fdisk"> Default: Using mac-fdisk (Apple) to Partition your Disk
157     </uri> or <uri link="#parted">Alternative: Using parted (IBM/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 swift 1.31 choice of filesystem will then maximize your performance. Gameservers will have
174 swift 1.22 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 swift 1.31 majority of applications, the Portage tree alone takes around 500 MB
178 swift 1.29 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 swift 1.31 <section id="mac-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.31 It will ask for the partition number to delete. The first partition on Apple
231     machines (Apple_partition_map) can not be deleted.
232 swift 1.1 </p>
233    
234     <p>
235 swift 1.31 On NewWorld Macs, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>.
236     It will ask for what block you want to start. Enter the number of your first
237     free 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 swift 1.31 you want -- 512MB is recommended though). When asked for a name, enter
252     <c>swap</c> (mandatory).
253 swift 1.1 </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 swift 1.31 <title>Using parted (Mostly 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 swift 1.31 If the drive isn't partitioned, run <c>mklabel amiga</c> to create a new
303 swift 1.6 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 swift 1.31 to store the MorphOS kernel. If you have a Pegasos I or intend to use reiserfs
316     or 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.31 Several filesystems are available. ext2, ext3, ReiserFS and XFS have been found
376     stable on the PPC architecture.
377 swift 1.1 </p>
378    
379     <p>
380     <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
381     journaling, which means that routine ext2 filesystem checks at startup time can
382     be quite time-consuming. There is now quite a selection of newer-generation
383     journaled filesystems that can be checked for consistency very quickly and are
384     thus generally preferred over their non-journaled counterparts. Journaled
385     filesystems prevent long delays when you boot your system and your filesystem
386     happens to be in an inconsistent state.
387     </p>
388    
389     <p>
390     <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
391     journaling for fast recovery in addition to other enhanced journaling modes like
392     full data and ordered data journaling. ext3 is a very good and reliable
393     filesystem. It has an additional hashed b-tree indexing option that enables
394 swift 1.30 high performance in almost all situations. You can enable this indexing by
395     adding <c>-O dir_index</c> to the <c>mke2fs</c> command. In short, ext3 is an
396     excellent filesystem.
397 swift 1.1 </p>
398    
399     <p>
400     <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
401     performance and greatly outperforms both ext2 and ext3 when dealing with small
402     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
403     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
404     solid and usable as both general-purpose filesystem and for extreme cases such
405     as the creation of large filesystems, the use of many small files, very large
406 swift 1.31 files and directories containing tens of thousands of files.
407 swift 1.1 </p>
408    
409     <p>
410 neysx 1.10 <b>XFS</b> is a filesystem with metadata journaling which comes with a robust
411     feature-set and is optimized for scalability. We only recommend using this
412     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
413     an uninterruptible power supply. Because XFS aggressively caches in-transit data
414     in RAM, improperly designed programs (those that don't take proper precautions
415     when writing files to disk and there are quite a few of them) can lose a good
416     deal of data if the system goes down unexpectedly.
417 swift 1.1 </p>
418    
419     </body>
420     </subsection>
421     <subsection id="filesystems-apply">
422     <title>Applying a Filesystem to a Partition</title>
423     <body>
424    
425     <p>
426     To create a filesystem on a partition or volume, there are tools available for
427     each possible filesystem:
428     </p>
429    
430     <table>
431     <tr>
432     <th>Filesystem</th>
433     <th>Creation Command</th>
434     </tr>
435     <tr>
436     <ti>ext2</ti>
437 swift 1.28 <ti><c>mkfs.ext2</c></ti>
438 swift 1.1 </tr>
439     <tr>
440     <ti>ext3</ti>
441 swift 1.28 <ti><c>mkfs.ext3</c></ti>
442 swift 1.1 </tr>
443     <tr>
444     <ti>reiserfs</ti>
445 swift 1.28 <ti><c>mkfs.reiserfs</c></ti>
446 swift 1.1 </tr>
447     <tr>
448     <ti>xfs</ti>
449     <ti><c>mkfs.xfs</c></ti>
450     </tr>
451     </table>
452    
453     <p>
454 swift 1.22 For instance, to have the root partition (<path>/dev/hda4</path> in our example)
455 swift 1.1 in ext3 (as in our example), you would use:
456     </p>
457    
458     <pre caption="Applying a filesystem on a partition">
459 swift 1.28 # <i>mkfs.ext3 /dev/hda4</i>
460 swift 1.1 </pre>
461    
462     <p>
463     Now create the filesystems on your newly created partitions (or logical
464     volumes).
465     </p>
466    
467 dertobi123 1.11 <note>
468 swift 1.31 On the PegasosII your partition which holds the kernel must be ext2 or ext3.
469     NewWorld machines can boot from any of ext2, ext3, XFS, ReiserFS or even
470     HFS/HFS+ filesystems. On OldWorld machines booting with BootX, the kernel must
471     be placed on an HFS partition, but this will be completed when you configure
472     your bootloader.
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     <pre caption="Mounting partitions">
516 pylon 1.4 # <i>mkdir /mnt/gentoo</i>
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
527     <p>
528 sejo 1.24 We will have to mount the proc filesystem (a virtual interface with the
529 swift 1.22 kernel) on <path>/proc</path>. But first we will need to place our files on the
530     partitions.
531 swift 1.12 </p>
532    
533     <p>
534     Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
535 swift 1.1 Installation Files</uri>.
536     </p>
537    
538     </body>
539     </section>
540     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20