| … | |
… | |
| 2 | <!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
2 | <!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
| 3 | |
3 | |
| 4 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
4 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 5 | <!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
5 | <!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
| 6 | |
6 | |
| 7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.20 2004/11/09 13:01:52 swift Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.23 2004/11/20 22:23:30 neysx Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | |
10 | |
| 11 | <version>1.19</version> |
11 | <version>1.19</version> |
| 12 | <date>November 2, 2004</date> |
12 | <date>2004-11-02</date> |
| 13 | |
13 | |
| 14 | <section> |
14 | <section> |
| 15 | <title>Introduction to Block Devices</title> |
15 | <title>Introduction to Block Devices</title> |
| 16 | <subsection> |
16 | <subsection> |
| 17 | <title>Block Devices</title> |
17 | <title>Block Devices</title> |
| … | |
… | |
| 108 | <ti>ext3</ti> |
108 | <ti>ext3</ti> |
| 109 | <ti>Rest of the disk</ti> |
109 | <ti>Rest of the disk</ti> |
| 110 | <ti>Root partition</ti> |
110 | <ti>Root partition</ti> |
| 111 | </tr> |
111 | </tr> |
| 112 | </table> |
112 | </table> |
|
|
113 | |
| 113 | <note> |
114 | <note> |
| 114 | There are some partitions named like this: <path>Apple_Driver43, |
115 | There are some partitions named like this: <path>Apple_Driver43, |
| 115 | Apple_Driver_ATA, Apple_FWDriver, Apple_Driver_IOKit, |
116 | Apple_Driver_ATA, Apple_FWDriver, Apple_Driver_IOKit, |
| 116 | Apple_Patches</path>. If you are not planning to use MacOS 9 you can |
117 | 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 | 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 | You might have to use parted in order to delete them, as mac-fdisk can't delete them yet. |
| 119 | </note> |
120 | </note> |
|
|
121 | |
| 120 | <p> |
122 | <p> |
| 121 | If you are interested in knowing how big a partition should be, or even how |
123 | If you are interested in knowing how big a partition should be, or even how many |
| 122 | many partitions you need, read on. Otherwise continue now with |
124 | partitions you need, read on. Otherwise continue now with <uri |
| 123 | <uri link="#fdisk">Default: Using mac-fdisk (Apple/IBM) to Partition your |
125 | link="#fdisk">Default: Using mac-fdisk (Apple/IBM) to Partition your Disk</uri> |
| 124 | Disk</uri> or <uri link="#parted">Alternative: Using parted (especially Pegasos) to |
126 | or <uri link="#parted">Alternative: Using parted (especially Pegasos) to |
| 125 | Partition your Disk</uri>. |
127 | Partition your Disk</uri>. |
| 126 | </p> |
128 | </p> |
| 127 | |
129 | |
| 128 | </body> |
130 | </body> |
| 129 | </subsection> |
131 | </subsection> |
| … | |
… | |
| 133 | |
135 | |
| 134 | <p> |
136 | <p> |
| 135 | The number of partitions is highly dependent on your environment. For instance, |
137 | 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 |
138 | 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. |
139 | <path>/home</path> separate as it increases security and makes backups easier. |
| 138 | If you are installing Gentoo to perform as a mailserver, your |
140 | If you are installing Gentoo to perform as a mailserver, your <path>/var</path> |
| 139 | <path>/var</path> should be separate as all mails are stored inside |
141 | should be separate as all mails are stored inside <path>/var</path>. A good |
| 140 | <path>/var</path>. A good choice of filesystem will then maximise your |
142 | choice of filesystem will then maximise your performance. Gameservers will have |
| 141 | performance. Gameservers will have a separate <path>/opt</path> as most gaming |
143 | a separate <path>/opt</path> as most gaming servers are installed there. The |
| 142 | servers are installed there. The reason is similar for <path>/home</path>: |
144 | reason is similar for <path>/home</path>: security and backups. |
| 143 | security and backups. |
|
|
| 144 | </p> |
145 | </p> |
| 145 | |
146 | |
| 146 | <p> |
147 | <p> |
| 147 | As you can see, it very much depends on what you want to achieve. Separate |
148 | As you can see, it very much depends on what you want to achieve. Separate |
| 148 | partitions or volumes have the following advantages: |
149 | partitions or volumes have the following advantages: |
| … | |
… | |
| 190 | </pre> |
191 | </pre> |
| 191 | |
192 | |
| 192 | <p> |
193 | <p> |
| 193 | First delete the partitions you have cleared previously to make room for your |
194 | 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 | 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 | It will ask for the partition number to delete. Usually the first partition on |
|
|
197 | NewWorld machines (Apple_partition_map) could not be deleted. |
| 196 | </p> |
198 | </p> |
| 197 | |
199 | |
| 198 | <p> |
200 | <p> |
| 199 | Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will |
201 | Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will |
| 200 | ask for what block you want to start. Enter the number of your first free |
202 | ask for what block you want to start. Enter the number of your first free |
| 201 | partition, followed by a <c>p</c>. For instance this is <c>1p</c>. |
203 | partition, followed by a <c>p</c>. For instance this is <c>2p</c>. |
| 202 | </p> |
204 | </p> |
| 203 | |
205 | |
| 204 | <note> |
206 | <note> |
| 205 | This partition is <e>not</e> a "boot" partition. It is not used by Linux at all; |
207 | 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 |
208 | you don't have to place any filesystem on it and you should never mount it. PPC |
| 207 | users don't need a an extra partition for <path>/boot</path>. |
209 | users don't need an extra partition for <path>/boot</path>. |
| 208 | </note> |
210 | </note> |
| 209 | |
211 | |
| 210 | <p> |
212 | <p> |
| 211 | Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will |
213 | Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will |
| 212 | ask for what block you want to start this partition from. As we used <c>1</c> |
214 | ask for what block you want to start this partition from. As we used <c>2</c> |
| 213 | before to create the Apple_Bootstrap partition, you now have to enter |
215 | before to create the Apple_Bootstrap partition, you now have to enter |
| 214 | <c>2p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size |
216 | <c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size |
| 215 | you want -- 512MB is recommended though). When asked for a name, enter <c>swap</c> |
217 | you want -- 512MB is recommended though). When asked for a name, enter <c>swap</c> |
| 216 | (mandatory). |
218 | (mandatory). |
| 217 | </p> |
219 | </p> |
| 218 | |
220 | |
| 219 | <p> |
221 | <p> |
| 220 | To create the root partition, enter <c>c</c>, followed by <c>3p</c> to select |
222 | To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select |
| 221 | from what block the root partition should start. When asked for the size, enter |
223 | from what block the root partition should start. When asked for the size, enter |
| 222 | <c>3p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available |
224 | <c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available |
| 223 | space". When asked for the name, enter <c>root</c> (mandatory). |
225 | space". When asked for the name, enter <c>root</c> (mandatory). |
| 224 | </p> |
226 | </p> |
| 225 | |
227 | |
| 226 | <p> |
228 | <p> |
| 227 | To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to |
229 | To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to |
| 228 | quit <c>mac-fdisk</c>. |
230 | quit <c>mac-fdisk</c>. |
| 229 | </p> |
231 | </p> |
| 230 | |
232 | |
| 231 | <note> |
233 | <note> |
| 232 | To make sure everything is ok, you should run mac-fdisk once more and check whether all the partitions are there. |
234 | To make sure everything is ok, you should run mac-fdisk once more and check |
| 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. |
235 | whether all the partitions are there. If you don't see any of the partitions |
| 234 | Note that this will recreate the partition map and thus remove all your partitions. |
236 | you created, or the changes you made, you should reinitialize your partitions |
|
|
237 | by pressing "i" in mac-fdisk. Note that this will recreate the partition map |
|
|
238 | and thus remove all your partitions. |
| 235 | </note> |
239 | </note> |
| 236 | |
240 | |
| 237 | <p> |
241 | <p> |
| 238 | Now that your partitions are created, you can now continue with <uri |
242 | Now that your partitions are created, you can continue with <uri |
| 239 | link="#filesystems">Creating Filesystems</uri>. |
243 | link="#filesystems">Creating Filesystems</uri>. |
| 240 | </p> |
244 | </p> |
| 241 | |
245 | |
| 242 | </body> |
246 | </body> |
| 243 | </section> |
247 | </section> |
| … | |
… | |
| 277 | named "BI0" (BI zero) at the start of the drive. 50MB should be more than enough |
281 | named "BI0" (BI zero) at the start of the drive. 50MB should be more than enough |
| 278 | to store the MorphOS kernel. If you have a Pegasos I or intend to use reiserfs or |
282 | 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 |
283 | xfs, you will also have to store your Linux kernel on this partition (the |
| 280 | Pegasos II can boot from ext2/ext3 drives). To create the partition run |
284 | 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 |
285 | <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 |
286 | be replaced with the megabyte range (e.g. <c>5 55</c> creates a 50 MB partition |
| 283 | starting at 5MB and ending at 55MB. |
287 | starting at 5MB and ending at 55MB. |
| 284 | </p> |
288 | </p> |
| 285 | |
289 | |
| 286 | <p> |
290 | <p> |
| 287 | You need to create two partitions for Linux, one root filesystem for all your |
291 | You need to create two partitions for Linux, one root filesystem for all your |
| … | |
… | |
| 301 | partition, run <c>mkpart primary linux-swap START END</c>. |
305 | partition, run <c>mkpart primary linux-swap START END</c>. |
| 302 | </p> |
306 | </p> |
| 303 | |
307 | |
| 304 | <p> |
308 | <p> |
| 305 | Write down the partition minor numbers as they are required during the |
309 | 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 |
310 | installation process. To display 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 |
311 | are accessed as <path>/dev/hdaX</path> where X is replaced with the minor number |
| 308 | of the partition. |
312 | of the partition. |
| 309 | </p> |
313 | </p> |
| 310 | |
314 | |
| 311 | <p> |
315 | <p> |
| … | |
… | |
| 333 | <subsection> |
337 | <subsection> |
| 334 | <title>Filesystems?</title> |
338 | <title>Filesystems?</title> |
| 335 | <body> |
339 | <body> |
| 336 | |
340 | |
| 337 | <p> |
341 | <p> |
| 338 | Several filesystems are available. ext2, ext3, reiserfs and xfs are found stable |
342 | Several filesystems are available. ext2, ext3, ReiserFS and XFS are found stable |
| 339 | on the PPC architecture. jfs is unsupported. |
343 | on the PPC architecture. jfs is unsupported. |
| 340 | </p> |
344 | </p> |
| 341 | |
345 | |
| 342 | <p> |
346 | <p> |
| 343 | <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata |
347 | <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata |
| … | |
… | |
| 411 | <ti><c>mkfs.xfs</c></ti> |
415 | <ti><c>mkfs.xfs</c></ti> |
| 412 | </tr> |
416 | </tr> |
| 413 | </table> |
417 | </table> |
| 414 | |
418 | |
| 415 | <p> |
419 | <p> |
| 416 | For instance, to have the root partition (<path>/dev/hda3</path> in our example) |
420 | For instance, to have the root partition (<path>/dev/hda4</path> in our example) |
| 417 | in ext3 (as in our example), you would use: |
421 | in ext3 (as in our example), you would use: |
| 418 | </p> |
422 | </p> |
| 419 | |
423 | |
| 420 | <pre caption="Applying a filesystem on a partition"> |
424 | <pre caption="Applying a filesystem on a partition"> |
| 421 | # <i>mke2fs -j /dev/hda3</i> |
425 | # <i>mke2fs -j /dev/hda4</i> |
| 422 | </pre> |
426 | </pre> |
| 423 | |
427 | |
| 424 | <p> |
428 | <p> |
| 425 | Now create the filesystems on your newly created partitions (or logical |
429 | Now create the filesystems on your newly created partitions (or logical |
| 426 | volumes). |
430 | volumes). |
| 427 | </p> |
431 | </p> |
| 428 | |
432 | |
| 429 | <note> |
433 | <note> |
| 430 | Be sure that the partition which will host your kernel (the |
434 | On OldWorld machines and the PegasosII your partition which holds the kernel must |
| 431 | <path>/boot</path>-path) must be ext2 or ext3. The bootloader can only handle |
435 | be ext2 or ext3. NewWorld machines can boot from any of ext2, ext3, XFS, |
| 432 | this filesystem. |
436 | ReiserFS or even HFS/HFS+ filesystems. |
| 433 | </note> |
437 | </note> |
| 434 | |
438 | |
| 435 | </body> |
439 | </body> |
| 436 | </subsection> |
440 | </subsection> |
| 437 | <subsection> |
441 | <subsection> |
| … | |
… | |
| 441 | <p> |
445 | <p> |
| 442 | <c>mkswap</c> is the command that is used to initialize swap partitions: |
446 | <c>mkswap</c> is the command that is used to initialize swap partitions: |
| 443 | </p> |
447 | </p> |
| 444 | |
448 | |
| 445 | <pre caption="Creating a Swap signature"> |
449 | <pre caption="Creating a Swap signature"> |
| 446 | # <i>mkswap /dev/hda2</i> |
450 | # <i>mkswap /dev/hda3</i> |
| 447 | </pre> |
451 | </pre> |
| 448 | |
452 | |
| 449 | <p> |
453 | <p> |
| 450 | To activate the swap partition, use <c>swapon</c>: |
454 | To activate the swap partition, use <c>swapon</c>: |
| 451 | </p> |
455 | </p> |
| 452 | |
456 | |
| 453 | <pre caption="Activating the swap partition"> |
457 | <pre caption="Activating the swap partition"> |
| 454 | # <i>swapon /dev/hda2</i> |
458 | # <i>swapon /dev/hda3</i> |
| 455 | </pre> |
459 | </pre> |
| 456 | |
460 | |
| 457 | <p> |
461 | <p> |
| 458 | Create and activate the swap now. |
462 | Create and activate the swap now. |
| 459 | </p> |
463 | </p> |
| … | |
… | |
| 467 | |
471 | |
| 468 | <p> |
472 | <p> |
| 469 | Now that your partitions are initialized and are housing a filesystem, it is |
473 | 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 |
474 | 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 |
475 | create the necessary mount directories for every partition you created. As an |
| 472 | example we create a mount-point and mount the root and boot partition: |
476 | example we create a mount-point and mount the root partition: |
| 473 | </p> |
477 | </p> |
| 474 | |
478 | |
| 475 | <pre caption="Mounting partitions"> |
479 | <pre caption="Mounting partitions"> |
| 476 | # <i>mkdir /mnt/gentoo</i> |
480 | # <i>mkdir /mnt/gentoo</i> |
| 477 | # <i>mount /dev/hda3 /mnt/gentoo</i> |
481 | # <i>mount /dev/hda4 /mnt/gentoo</i> |
| 478 | </pre> |
482 | </pre> |
| 479 | |
483 | |
| 480 | <note> |
484 | <note> |
| 481 | If you want your <path>/tmp</path> to reside on a separate partition, be sure to |
485 | 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 |
486 | change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This |
| … | |
… | |
| 493 | # <i>mkdir /mnt/gentoo/dev</i> |
497 | # <i>mkdir /mnt/gentoo/dev</i> |
| 494 | # <i>mount -o bind /dev /mnt/gentoo/dev</i> |
498 | # <i>mount -o bind /dev /mnt/gentoo/dev</i> |
| 495 | </pre> |
499 | </pre> |
| 496 | |
500 | |
| 497 | <p> |
501 | <p> |
| 498 | We will also have to mount the proc filesystem (a virtual interface with the |
502 | 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. |
503 | kernel) on <path>/proc</path>. But first we will need to place our files on the |
|
|
504 | partitions. |
| 500 | </p> |
505 | </p> |
| 501 | |
506 | |
| 502 | <p> |
507 | <p> |
| 503 | Continue with <uri link="?part=1&chap=5">Installing the Gentoo |
508 | Continue with <uri link="?part=1&chap=5">Installing the Gentoo |
| 504 | Installation Files</uri>. |
509 | Installation Files</uri>. |