/[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.13 - (show annotations) (download) (as text)
Tue Aug 24 00:00:35 2004 UTC (9 years, 11 months ago) by pylon
Branch: MAIN
Changes since 1.12: +3 -5 lines
File MIME type: application/xml
Changes that has been known since the (inofficial) 2004.2 ppc-LiveCD has been released.

Mostly it's kernel-2.4 stuff that has been deleted.  And some updates about the Pegasos support.

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

  ViewVC Help
Powered by ViewVC 1.1.20