| … | |
… | |
| 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/2.5 --> |
5 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 6 | |
6 | |
| 7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.34 2006/02/27 00:55:34 fox2mike Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml,v 1.42 2007/05/09 00:52:08 nightmorph Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | |
10 | |
| 11 | <version>2.5</version> |
11 | <version>8.1</version> |
| 12 | <date>2006-02-27</date> |
12 | <date>2007-05-08</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> |
| 18 | <body> |
18 | <body> |
| 19 | |
19 | |
| 20 | <p> |
20 | <p> |
| 21 | We'll take a good look at disk-oriented aspects of Gentoo Linux |
21 | We'll start by taking a good look at disk-oriented aspects of Gentoo Linux |
| 22 | and Linux in general, including Linux filesystems, partitions and block devices. |
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, |
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 |
24 | you'll be guided through the process of setting up partitions and filesystems |
| 25 | for your Gentoo Linux installation. |
25 | for your Gentoo Linux installation. |
| 26 | </p> |
26 | </p> |
| 27 | |
27 | |
| 28 | <p> |
28 | <p> |
| 29 | To begin, we'll introduce <e>block devices</e>. The most common block device is |
29 | To begin, we'll introduce <e>block devices</e>. The most common block device is |
| 30 | the one that represents the first IDE drive in a Linux system, namely |
30 | the one that represents the first IDE drive in a Linux system, namely |
| 31 | <path>/dev/hda</path>. If you are installing onto SCSI, FireWire, USB or SATA |
31 | <path>/dev/hda</path>. If you are installing onto SCSI, FireWire, USB or SATA |
| 32 | drives, then your first hard drive would be <path>/dev/sda</path>. |
32 | drives, then your first hard drive would be <path>/dev/sda</path>. Additional |
|
|
33 | drives are enumerated by the next letter in the alphabet. As an example, the |
|
|
34 | third IDE disk could be found at <path>/dev/hdc</path>. |
| 33 | </p> |
35 | </p> |
| 34 | |
36 | |
| 35 | <p> |
37 | <p> |
| 36 | The block devices above represent an abstract interface to the disk. User |
38 | 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 |
39 | programs can use these block devices to interact with the disk without worrying |
| 38 | about whether your drives are IDE, SCSI or something else. The program can |
40 | about whether the drives are IDE, SCSI or something else. The program can |
| 39 | simply address the storage on the disk as a bunch of contiguous, |
41 | simply address the storage on the disk as a bunch of contiguous, |
| 40 | randomly-accessible 512-byte blocks. |
42 | randomly-accessible 512-byte blocks. |
| 41 | </p> |
43 | </p> |
| 42 | |
44 | |
| 43 | </body> |
45 | </body> |
| … | |
… | |
| 62 | <title>Default Partitioning Scheme</title> |
64 | <title>Default Partitioning Scheme</title> |
| 63 | <body> |
65 | <body> |
| 64 | |
66 | |
| 65 | <p> |
67 | <p> |
| 66 | If you are not interested in drawing up a partitioning scheme for your system, |
68 | 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: |
69 | you can use the partitioning scheme we use throughout this book. Choose the |
|
|
70 | filesystem layout that best matches the type of PowerPC system you are |
|
|
71 | installing on. |
|
|
72 | </p> |
|
|
73 | |
|
|
74 | </body> |
|
|
75 | </subsection> |
|
|
76 | <subsection> |
|
|
77 | <title>Apple New World</title> |
|
|
78 | <body> |
|
|
79 | |
| 68 | </p> |
80 | <p> |
|
|
81 | Apple New World machines are fairly straightforward to configure. The first |
|
|
82 | partition is always an <e>Apple Partition Map</e>. This partition keeps track |
|
|
83 | of the layout of the disk. You cannot remove this partition. The next |
|
|
84 | partition should always be a bootstrap partition. This partition contains a |
|
|
85 | small (800k) HFS filesystem that holds a copy of the bootloader Yaboot and its |
|
|
86 | configuration file. This partition is <e>not</e> the same as a |
|
|
87 | <path>/boot</path> partition as found on other architectures. After the boot |
|
|
88 | partition, the usual Linux filesystems are placed, according to the scheme |
|
|
89 | below. The swap partition is a temporary storage place for when your system |
|
|
90 | runs out of physical memory. The root partition will contain the filesystem |
|
|
91 | that Gentoo is installed on. If you wish to dual boot, the OSX partition |
|
|
92 | can go anywhere after the bootstrap partition to insure that yaboot starts |
|
|
93 | first. |
|
|
94 | </p> |
|
|
95 | |
|
|
96 | <note> |
|
|
97 | There may be "Disk Driver" partitions on your disk such as |
|
|
98 | <path>Apple_Driver63</path>, <path>Apple_Driver_ATA</path>, |
|
|
99 | <path>Apple_FWDriver</path>, <path>Apple_Driver_IOKit</path>, and |
|
|
100 | <path>Apple_Patches</path>. These are used to boot MacOS, so if you have no |
|
|
101 | need for this, you can remove them by initializing the disk with mac-fdisk's |
|
|
102 | <c>i</c> option. This will completely erase the disk! If you are in doubt, |
|
|
103 | just let them be. |
|
|
104 | </note> |
|
|
105 | |
|
|
106 | <note> |
|
|
107 | If you partitioned this disk with Apple's Disk Utility, there may be |
|
|
108 | 128Mb spaces between partitions which Apple reserves for "future use". You |
|
|
109 | can safely remove these. |
|
|
110 | </note> |
| 69 | |
111 | |
| 70 | <table> |
112 | <table> |
| 71 | <tr> |
113 | <tr> |
| 72 | <th>Partition NewWorld</th> |
|
|
| 73 | <th>Partition OldWorld</th> |
|
|
| 74 | <th>Partition Pegasos</th> |
114 | <th>Partition</th> |
| 75 | <th>Partition RS/6000</th> |
115 | <th>Size</th> |
| 76 | <th>Filesystem</th> |
116 | <th>Filesystem</th> |
|
|
117 | <th>Description</th> |
|
|
118 | </tr> |
|
|
119 | <tr> |
|
|
120 | <ti><path>/dev/hda1</path></ti> |
|
|
121 | <ti>32k</ti> |
|
|
122 | <ti>None</ti> |
|
|
123 | <ti>Apple Partition Map</ti> |
|
|
124 | </tr> |
|
|
125 | <tr> |
|
|
126 | <ti><path>/dev/hda2</path></ti> |
|
|
127 | <ti>800k</ti> |
|
|
128 | <ti>HFS</ti> |
|
|
129 | <ti>Apple Bootstrap</ti> |
|
|
130 | </tr> |
|
|
131 | <tr> |
|
|
132 | <ti><path>/dev/hda3</path></ti> |
|
|
133 | <ti>512Mb</ti> |
|
|
134 | <ti>Swap</ti> |
|
|
135 | <ti>Linux Swap</ti> |
|
|
136 | </tr> |
|
|
137 | <tr> |
|
|
138 | <ti><path>/dev/hda4</path></ti> |
|
|
139 | <ti>Rest of Disk</ti> |
|
|
140 | <ti>ext3, reiserfs, xfs</ti> |
|
|
141 | <ti>Linux Root</ti> |
|
|
142 | </tr> |
|
|
143 | </table> |
|
|
144 | |
|
|
145 | </body> |
|
|
146 | </subsection> |
|
|
147 | <subsection> |
|
|
148 | <title>Apple Old World</title> |
|
|
149 | <body> |
|
|
150 | |
|
|
151 | <p> |
|
|
152 | Apple Old World machines are a bit more complicated to configure. The first |
|
|
153 | partition is always an <e>Apple Partition Map</e>. This partition keeps track |
|
|
154 | of the layout of the disk. You cannot remove this partition. If you are using |
|
|
155 | BootX, the configuration below assumes that MacOS is installed on a seperate |
|
|
156 | disk. If this is not the case, there will be additional partitions for "Apple |
|
|
157 | Disk Drivers" such as <path>Apple_Driver63, Apple_Driver_ATA, Apple_FWDriver, |
|
|
158 | Apple_Driver_IOKit, Apple_Patches</path> and the MacOS install. If you are |
|
|
159 | using Quik, you will need to create a boot partition to hold the kernel, unlike |
|
|
160 | other Apple boot methods. After the boot partition, the usual Linux filesystems |
|
|
161 | are placed, according to the scheme below. The swap partition is a temporary |
|
|
162 | storage place for when your system runs out of physical memory. The root |
|
|
163 | partition will contain the filesystem that Gentoo is installed on. |
|
|
164 | </p> |
|
|
165 | |
|
|
166 | <note> |
|
|
167 | If you are using an OldWorld machine, you will need to keep MacOS available. |
|
|
168 | The layout here assumes MacOS is installed on a separate drive. |
|
|
169 | </note> |
|
|
170 | |
|
|
171 | <table> |
|
|
172 | <tr> |
|
|
173 | <th>Partition</th> |
| 77 | <th>Size</th> |
174 | <th>Size</th> |
|
|
175 | <th>Filesystem</th> |
| 78 | <th>Description</th> |
176 | <th>Description</th> |
| 79 | </tr> |
177 | </tr> |
| 80 | <tr> |
178 | <tr> |
| 81 | <ti><path>/dev/hda1</path></ti> |
179 | <ti><path>/dev/hda1</path></ti> |
|
|
180 | <ti>32k</ti> |
|
|
181 | <ti>None</ti> |
|
|
182 | <ti>Apple Partition Map</ti> |
|
|
183 | </tr> |
|
|
184 | <tr> |
|
|
185 | <ti><path>/dev/hda2</path></ti> |
|
|
186 | <ti>32Mb</ti> |
|
|
187 | <ti>ext2</ti> |
|
|
188 | <ti>Quik Boot Partition (quik only)</ti> |
|
|
189 | </tr> |
|
|
190 | <tr> |
|
|
191 | <ti><path>/dev/hda3</path></ti> |
|
|
192 | <ti>512Mb</ti> |
|
|
193 | <ti>Swap</ti> |
|
|
194 | <ti>Linux Swap</ti> |
|
|
195 | </tr> |
|
|
196 | <tr> |
|
|
197 | <ti><path>/dev/hda4</path></ti> |
|
|
198 | <ti>Rest of Disk</ti> |
|
|
199 | <ti>ext3, reiserfs, xfs</ti> |
|
|
200 | <ti>Linux Root</ti> |
|
|
201 | </tr> |
|
|
202 | </table> |
|
|
203 | |
|
|
204 | </body> |
|
|
205 | </subsection> |
|
|
206 | <subsection> |
|
|
207 | <title>Pegasos</title> |
|
|
208 | <body> |
|
|
209 | |
|
|
210 | <p> |
|
|
211 | The Pegasos partition layout is quite simple compared to the Apple layouts. |
|
|
212 | The first partition is a Boot Partition, which contains kernels to be booted, |
|
|
213 | along with an OpenFirmware script that presents a menu on boot. After the boot |
|
|
214 | partition, the usual Linux filesystems are placed, according to the scheme |
|
|
215 | below. The swap partition is a temporary storage place for when your system |
|
|
216 | runs out of physical memory. The root partition will contain the filesystem |
|
|
217 | that Gentoo is installed on. |
|
|
218 | </p> |
|
|
219 | |
|
|
220 | <table> |
|
|
221 | <tr> |
|
|
222 | <th>Partition</th> |
|
|
223 | <th>Size</th> |
|
|
224 | <th>Filesystem</th> |
|
|
225 | <th>Description</th> |
|
|
226 | </tr> |
|
|
227 | <tr> |
| 82 | <ti><path>/dev/hda1</path></ti> |
228 | <ti><path>/dev/hda1</path></ti> |
| 83 | <ti>(Not applicable)</ti> |
|
|
| 84 | <ti>(Not applicable)</ti> |
|
|
| 85 | <ti>(Partition Map)</ti> |
|
|
| 86 | <ti>32k</ti> |
229 | <ti>32Mb</ti> |
| 87 | <ti>Apple_partition_map</ti> |
230 | <ti>affs1 or ext2</ti> |
|
|
231 | <ti>Boot Partition</ti> |
| 88 | </tr> |
232 | </tr> |
| 89 | <tr> |
233 | <tr> |
| 90 | <ti><path>/dev/hda2</path></ti> |
234 | <ti><path>/dev/hda2</path></ti> |
| 91 | <ti>(Not applicable)</ti> |
235 | <ti>512Mb</ti> |
| 92 | <ti>(Not applicable)</ti> |
236 | <ti>Swap</ti> |
| 93 | <ti>(Not applicable)</ti> |
237 | <ti>Linux Swap</ti> |
| 94 | <ti>(bootstrap)</ti> |
238 | </tr> |
|
|
239 | <tr> |
|
|
240 | <ti><path>/dev/hda3</path></ti> |
|
|
241 | <ti>Rest of Disk</ti> |
|
|
242 | <ti>ext3, reiserfs, xfs</ti> |
|
|
243 | <ti>Linux Root</ti> |
|
|
244 | </tr> |
|
|
245 | </table> |
|
|
246 | |
|
|
247 | </body> |
|
|
248 | </subsection> |
|
|
249 | <subsection> |
|
|
250 | <title>IBM PReP (RS/6000)</title> |
|
|
251 | <body> |
|
|
252 | |
|
|
253 | <p> |
|
|
254 | The IBM PowerPC Reference Platform (PReP) requires a small PReP boot partition |
|
|
255 | on the disk's first partition, followed by the swap and root partitions. |
|
|
256 | </p> |
|
|
257 | |
|
|
258 | <table> |
|
|
259 | <tr> |
|
|
260 | <th>Partition</th> |
|
|
261 | <th>Size</th> |
|
|
262 | <th>Filesystem</th> |
|
|
263 | <th>Description</th> |
|
|
264 | </tr> |
|
|
265 | <tr> |
|
|
266 | <ti><path>/dev/hda1</path></ti> |
| 95 | <ti>800k</ti> |
267 | <ti>800k</ti> |
| 96 | <ti>Apple_Bootstrap</ti> |
268 | <ti>None</ti> |
| 97 | </tr> |
269 | <ti>PReP Boot Partition (Type 0x41)</ti> |
| 98 | <tr> |
270 | </tr> |
| 99 | <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> |
271 | <tr> |
| 107 | <tr> |
|
|
| 108 | <ti>(Not applicable)</ti> |
|
|
| 109 | <ti><path>/dev/hda2</path> (If using quik)</ti> |
|
|
| 110 | <ti><path>/dev/hda1</path></ti> |
272 | <ti><path>/dev/hda2</path></ti> |
| 111 | <ti>(Not applicable)</ti> |
|
|
| 112 | <ti>ext2</ti> |
|
|
| 113 | <ti>32MB</ti> |
273 | <ti>512Mb</ti> |
| 114 | <ti>Boot partition</ti> |
274 | <ti>Swap</ti> |
|
|
275 | <ti>Linux Swap (Type 0x82)</ti> |
| 115 | </tr> |
276 | </tr> |
| 116 | <tr> |
277 | <tr> |
| 117 | <ti><path>/dev/hda3</path></ti> |
278 | <ti><path>/dev/hda3</path></ti> |
| 118 | <ti><path>/dev/hda2</path>(<path>/dev/hda3</path> if using quik)</ti> |
|
|
| 119 | <ti><path>/dev/hda2</path></ti> |
|
|
| 120 | <ti><path>/dev/sda2</path></ti> |
|
|
| 121 | <ti>(swap)</ti> |
|
|
| 122 | <ti>512M</ti> |
|
|
| 123 | <ti>Swap partition, Type 0x82</ti> |
|
|
| 124 | </tr> |
|
|
| 125 | <tr> |
|
|
| 126 | <ti><path>/dev/hda4</path></ti> |
|
|
| 127 | <ti><path>/dev/hda3</path> (<path>/dev/hda4</path> if using quik)</ti> |
|
|
| 128 | <ti><path>/dev/hda3</path></ti> |
|
|
| 129 | <ti><path>/dev/sda3</path></ti> |
|
|
| 130 | <ti>ext3, xfs</ti> |
|
|
| 131 | <ti>Rest of the disk</ti> |
279 | <ti>Rest of Disk</ti> |
| 132 | <ti>Root partition, Type 0x83</ti> |
280 | <ti>ext3, reiserfs, xfs</ti> |
|
|
281 | <ti>Linux Root (Type 0x83)</ti> |
| 133 | </tr> |
282 | </tr> |
| 134 | </table> |
283 | </table> |
| 135 | |
284 | |
| 136 | <note> |
|
|
| 137 | 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 | initializing the partition map. |
|
|
| 142 | </note> |
|
|
| 143 | |
|
|
| 144 | <warn> |
285 | <warn> |
| 145 | <c>parted</c> is able to resize partitions including HFS+. Unfortunately it is |
286 | <c>parted</c> is able to resize partitions including HFS+. Unfortunately there |
| 146 | not possible to resize HFS+ journaled filesystems, so switch off journaling in |
287 | may be issues with resizing HFS+ journaled filesystems, so, for the best |
| 147 | Mac OS X before resizing. Remeber that any resizing operation is dangerous, |
288 | results, switch off journaling in Mac OS X before resizing. Remember that any |
| 148 | so attempt at your own risk! Be sure to always have a backup of your data |
289 | resizing operation is dangerous, so attempt at your own risk! Be sure to always |
| 149 | before resizing! |
290 | have a backup of your data before resizing! |
| 150 | </warn> |
291 | </warn> |
| 151 | |
292 | |
| 152 | <p> |
293 | <p> |
| 153 | If you are interested in knowing how big a partition should be, or even how many |
294 | If you are interested in knowing how big a partition should be, or even how many |
| 154 | partitions you need, read on. Otherwise continue now with |
295 | partitions you need, read on. Otherwise continue now with |
| 155 | <uri link="#mac-fdisk"> Default: Using mac-fdisk (Apple) to Partition your Disk |
296 | <uri link="#mac-fdisk"> Default: Using mac-fdisk (Apple) to Partition your Disk |
| 156 | </uri> or <uri link="#parted">Alternative: Using parted (IBM/Pegasos) to |
297 | </uri> or <uri link="#parted">Alternative: Using parted (IBM/Pegasos) to |
| … | |
… | |
| 166 | <p> |
307 | <p> |
| 167 | The number of partitions is highly dependent on your environment. For instance, |
308 | The number of partitions is highly dependent on your environment. For instance, |
| 168 | if you have lots of users, you will most likely want to have your |
309 | if you have lots of users, you will most likely want to have your |
| 169 | <path>/home</path> separate as it increases security and makes backups easier. |
310 | <path>/home</path> separate as it increases security and makes backups easier. |
| 170 | If you are installing Gentoo to perform as a mailserver, your <path>/var</path> |
311 | If you are installing Gentoo to perform as a mailserver, your <path>/var</path> |
| 171 | should be separate as all mails are stored inside <path>/var</path>. A good |
312 | should be separate as all received mail is stored in <path>/var</path>. A good |
| 172 | choice of filesystem will then maximize your performance. Gameservers will have |
313 | choice of filesystem will then maximise your performance. Game servers should |
| 173 | a separate <path>/opt</path> as most gaming servers are installed there. The |
314 | have a separate <path>/opt</path> as most game servers are installed there. The |
| 174 | reason is similar for <path>/home</path>: security and backups. You will |
315 | reason is similar for <path>/home</path>: security and backups. Whatever layout |
| 175 | definitely want to keep <path>/usr</path> big: not only will it contain the |
316 | you chose, you will definitely want to keep <path>/usr</path> large: not only |
| 176 | majority of applications, the Portage tree alone takes around 500 MB |
317 | will it contain the majority of applications, the Portage tree alone takes |
| 177 | excluding the various sources that are stored in it. |
318 | more than 500Mb excluding the various sources that are stored in it. |
| 178 | </p> |
319 | </p> |
| 179 | |
320 | |
| 180 | <p> |
321 | <p> |
| 181 | As you can see, it very much depends on what you want to achieve. Separate |
322 | As you can see, it very much depends on what you want to achieve. Separate |
| 182 | partitions or volumes have the following advantages: |
323 | partitions or volumes have the following advantages: |
| … | |
… | |
| 222 | <pre caption="Starting mac-fdisk"> |
363 | <pre caption="Starting mac-fdisk"> |
| 223 | # <i>mac-fdisk /dev/hda</i> |
364 | # <i>mac-fdisk /dev/hda</i> |
| 224 | </pre> |
365 | </pre> |
| 225 | |
366 | |
| 226 | <p> |
367 | <p> |
| 227 | First delete the partitions you have cleared previously to make room for your |
368 | If you used Apple's Disk Utility to leave space for Linux, first delete the |
| 228 | Linux partitions. Use <c>d</c> in <c>mac-fdisk</c> to delete those partition(s). |
369 | partitions you have created previously to make room for your new install. Use |
| 229 | It will ask for the partition number to delete. The first partition on Apple |
370 | <c>d</c> in <c>mac-fdisk</c> to delete those partition(s). It will ask for the |
| 230 | machines (Apple_partition_map) can not be deleted. |
371 | partition number to delete. Usually the first partition on NewWorld machines |
| 231 | </p> |
372 | (Apple_partition_map) could not be deleted. If you would like to start with a |
| 232 | |
373 | clean disk, you can simply initialize the disk by pressing <c>i</c>. This |
|
|
374 | will completely erase the disk, so use this with caution. |
| 233 | <p> |
375 | </p> |
|
|
376 | |
|
|
377 | <p> |
| 234 | On NewWorld Macs, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. |
378 | Second, create an <e>Apple_Bootstrap</e> partition by using <c>b</c>. It will |
| 235 | It will ask for what block you want to start. Enter the number of your first |
379 | ask for what block you want to start. Enter the number of your first free |
| 236 | free partition, followed by a <c>p</c>. For instance this is <c>2p</c>. |
380 | partition, followed by a <c>p</c>. For instance this is <c>2p</c>. |
| 237 | </p> |
381 | </p> |
| 238 | |
382 | |
| 239 | <note> |
383 | <note> |
| 240 | This partition is <e>not</e> a <path>/boot</path> partition. It is not used by |
384 | This partition is <e>not</e> a <path>/boot</path> partition. It is not used by |
| 241 | Linux at all; you don't have to place any filesystem on it and you should never |
385 | Linux at all; you don't have to place any filesystem on it and you should never |
| … | |
… | |
| 245 | <p> |
389 | <p> |
| 246 | Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will |
390 | Now create a swap partition by pressing <c>c</c>. Again <c>mac-fdisk</c> will |
| 247 | ask for what block you want to start this partition from. As we used <c>2</c> |
391 | ask for what block you want to start this partition from. As we used <c>2</c> |
| 248 | before to create the Apple_Bootstrap partition, you now have to enter |
392 | before to create the Apple_Bootstrap partition, you now have to enter |
| 249 | <c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size |
393 | <c>3p</c>. When you're asked for the size, enter <c>512M</c> (or whatever size |
| 250 | you want -- 512MB is recommended though). When asked for a name, enter |
394 | you want -- a minimum of 512MB is recommended, but 2 times your physical memory |
| 251 | <c>swap</c> (mandatory). |
395 | is the generally accepted size). When asked for a name, enter <c>swap</c>. |
| 252 | </p> |
396 | </p> |
| 253 | |
397 | |
| 254 | <p> |
398 | <p> |
| 255 | To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select |
399 | To create the root partition, enter <c>c</c>, followed by <c>4p</c> to select |
| 256 | from what block the root partition should start. When asked for the size, enter |
400 | from what block the root partition should start. When asked for the size, enter |
| 257 | <c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available |
401 | <c>4p</c> again. <c>mac-fdisk</c> will interpret this as "Use all available |
| 258 | space". When asked for the name, enter <c>root</c> (mandatory). |
402 | space". When asked for the name, enter <c>root</c>. |
| 259 | </p> |
403 | </p> |
| 260 | |
404 | |
| 261 | <p> |
405 | <p> |
| 262 | To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to |
406 | To finish up, write the partition to the disk using <c>w</c> and <c>q</c> to |
| 263 | quit <c>mac-fdisk</c>. |
407 | quit <c>mac-fdisk</c>. |
| 264 | </p> |
408 | </p> |
| 265 | |
409 | |
| 266 | <note> |
410 | <note> |
| 267 | To make sure everything is ok, you should run mac-fdisk once more and check |
411 | To make sure everything is ok, you should run <c>mac-fdisk -l</c> and check |
| 268 | whether all the partitions are there. If you don't see any of the partitions |
412 | whether all the partitions are there. If you don't see any of the partitions |
| 269 | you created, or the changes you made, you should reinitialize your partitions |
413 | you created, or the changes you made, you should reinitialize your partitions |
| 270 | by pressing "i" in mac-fdisk. Note that this will recreate the partition map |
414 | by pressing "i" in mac-fdisk. Note that this will recreate the partition map |
| 271 | and thus remove all your partitions. |
415 | and thus remove all your partitions. |
| 272 | </note> |
416 | </note> |
| 273 | |
417 | |
| 274 | <p> |
418 | <p> |
| 275 | Now that your partitions are created, you can continue with <uri |
419 | Now that your partitions are created, you can continue with |
| 276 | link="#filesystems">Creating Filesystems</uri>. |
420 | <uri link="#filesystems">Creating Filesystems</uri>. |
| 277 | </p> |
421 | </p> |
| 278 | |
422 | |
| 279 | </body> |
423 | </body> |
| 280 | </section> |
424 | </section> |
| 281 | <section id="parted"> |
425 | <section id="parted"> |
| 282 | <title>Using parted (Mostly Pegasos) to Partition your Disk</title> |
426 | <title>Using parted to Partition your Disk (Pegasos and RS/6000)</title> |
| 283 | <body> |
427 | <body> |
| 284 | |
428 | |
| 285 | <p> |
429 | <p> |
| 286 | <c>parted</c>, the Partition Editor, can now handle HFS+ partitions used by |
430 | <c>parted</c>, the Partition Editor, can now handle HFS+ partitions used by |
| 287 | Mac OS and Mac OS X. With this tool you can resize your Mac-partitions and |
431 | Mac OS and Mac OS X. With this tool you can resize your Mac-partitions and |
| … | |
… | |
| 296 | <pre caption="Starting parted"> |
440 | <pre caption="Starting parted"> |
| 297 | # <i>parted /dev/hda</i> |
441 | # <i>parted /dev/hda</i> |
| 298 | </pre> |
442 | </pre> |
| 299 | |
443 | |
| 300 | <p> |
444 | <p> |
| 301 | If the drive isn't partitioned, run <c>mklabel amiga</c> to create a new |
445 | If the drive is unpartitioned, run <c>mklabel amiga</c> to create a new |
| 302 | disklabel for the drive. |
446 | disklabel for the drive. |
| 303 | </p> |
447 | </p> |
| 304 | |
448 | |
| 305 | <p> |
449 | <p> |
| 306 | You can type <c>print</c> at any time in parted to display the current partition |
450 | You can type <c>print</c> at any time in parted to display the current partition |
| … | |
… | |
| 308 | <c>Ctrl-c</c> to abort parted. |
452 | <c>Ctrl-c</c> to abort parted. |
| 309 | </p> |
453 | </p> |
| 310 | |
454 | |
| 311 | <p> |
455 | <p> |
| 312 | If you intend to also install MorphOS on your Pegasos create an affs1 filesystem |
456 | If you intend to also install MorphOS on your Pegasos create an affs1 filesystem |
| 313 | named "BI0" (BI zero) at the start of the drive. 32MB should be more than enough |
457 | at the start of the drive. 32MB should be more than enough to store the MorphOS |
| 314 | to store the MorphOS kernel. If you have a Pegasos I or intend to use reiserfs |
458 | kernel. If you have a Pegasos I or intend to use any filesystem besides ext2 or |
| 315 | or xfs, you will also have to store your Linux kernel on this partition (the |
459 | ext3, you will also have to store your Linux kernel on this partition (the |
| 316 | Pegasos II can only boot from ext2/ext3 or affs1 partitions). To create the partition run |
460 | Pegasos II can only boot from ext2/ext3 or affs1 partitions). To create the |
| 317 | <c>mkpart primary affs1 START END</c> where <c>START</c> and <c>END</c> should |
461 | partition run <c>mkpart primary affs1 START END</c> where <c>START</c> and |
| 318 | be replaced with the megabyte range (e.g. <c>0 32</c> creates a 32 MB partition |
462 | <c>END</c> should be replaced with the megabyte range (e.g. <c>0 32</c>) which |
| 319 | starting at 0MB and ending at 32MB. |
463 | creates a 32 MB partition starting at 0MB and ending at 32MB. If you chose to |
| 320 | </p> |
464 | create an ext2 or ext3 partition instead, substitute ext2 or ext3 for affs1 in |
| 321 | |
465 | the mkpart command. |
| 322 | <p> |
466 | </p> |
| 323 | You need to create two partitions for Linux, one root filesystem for all your |
467 | |
| 324 | program files etc, and one swap partition. To create the root filesystem you |
|
|
| 325 | must first decide which filesystem to use. Possible options are ext2, ext3, |
|
|
| 326 | reiserfs and xfs. Unless you know what you are doing, use ext3. Run |
|
|
| 327 | <c>mkpart primary ext3 START END</c> to create an ext3 partition. Again, replace |
|
|
| 328 | <c>START</c> and <c>END</c> with the megabyte start and stop marks for the |
|
|
| 329 | partition. |
|
|
| 330 | </p> |
468 | <p> |
| 331 | |
469 | You will need to create two partitions for Linux, one root filesystem and one |
|
|
470 | swap partition. Run <c>mkpart primary START END</c> to create each partition, |
|
|
471 | replacing <c>START</c> and <c>END</c> with the desired megabyte boundries. |
| 332 | <p> |
472 | </p> |
|
|
473 | |
|
|
474 | <p> |
| 333 | It is generally recommended that you create a swap partition the same size as |
475 | It is generally recommended that you create a swap partition that is two times |
| 334 | the amount of RAM in your computer times two. You will probably get away with a |
476 | bigger than the amount of RAM in your computer, but at least 512Mb is |
| 335 | smaller swap partition unless you intend to run a lot of applications at the |
477 | recommended. To create the swap partition, run |
| 336 | same time (although at least 512MB is recommended). To create the swap |
478 | <c>mkpart primary linux-swap START END</c> with START and END again denoting |
| 337 | partition, run <c>mkpart primary linux-swap START END</c>. |
479 | the partition boundries. |
| 338 | </p> |
|
|
| 339 | |
|
|
| 340 | <p> |
480 | </p> |
| 341 | Write down the partition minor numbers as they are required during the |
481 | |
| 342 | installation process. To display the minor numbers run <c>print</c>. Your drives |
|
|
| 343 | are accessed as <path>/dev/hdaX</path> where X is replaced with the minor number |
|
|
| 344 | of the partition. |
|
|
| 345 | </p> |
482 | <p> |
| 346 | |
|
|
| 347 | <p> |
|
|
| 348 | When you are done in parted simply run <c>quit</c>. |
483 | When you are done in parted simply type <c>quit</c>. |
| 349 | </p> |
484 | </p> |
| 350 | |
485 | |
| 351 | </body> |
486 | </body> |
| 352 | </section> |
487 | </section> |
| 353 | <section id="filesystems"> |
488 | <section id="filesystems"> |
| … | |
… | |
| 356 | <title>Introduction</title> |
491 | <title>Introduction</title> |
| 357 | <body> |
492 | <body> |
| 358 | |
493 | |
| 359 | <p> |
494 | <p> |
| 360 | Now that your partitions are created, it is time to place a filesystem on them. |
495 | Now that your partitions are created, it is time to place a filesystem on them. |
| 361 | If you don't care about what filesystem to choose and are happy with what we use |
496 | If you're not sure which filesystems to choose and are happy with our defaults, |
| 362 | as default in this handbook, continue with <uri |
497 | continue with |
| 363 | link="#filesystems-apply">Applying a Filesystem to a Partition</uri>. |
498 | <uri link="#filesystems-apply">Applying a Filesystem to a Partition</uri>. |
| 364 | Otherwise read on to learn about the available filesystems... |
499 | Otherwise, read on to learn about the available filesystems. |
| 365 | </p> |
500 | </p> |
| 366 | |
501 | |
| 367 | </body> |
502 | </body> |
| 368 | </subsection> |
503 | </subsection> |
| 369 | <subsection> |
504 | <subsection> |
| 370 | <title>Filesystems?</title> |
505 | <title>Filesystems?</title> |
| 371 | <body> |
506 | <body> |
| 372 | |
507 | |
| 373 | <p> |
508 | <p> |
| 374 | Several filesystems are available. ext2, ext3, ReiserFS and XFS have been found |
509 | Several filesystems are available for use on the PowerPC architecture including |
| 375 | stable on the PPC architecture. |
510 | ext2, ext3, ReiserFS and XFS, each with their strengths and faults. |
| 376 | </p> |
511 | </p> |
| 377 | |
512 | |
| 378 | <p> |
513 | <p> |
| 379 | <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata |
514 | <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata |
| 380 | journaling, which means that routine ext2 filesystem checks at startup time can |
515 | journaling, which means that routine ext2 filesystem checks at startup time can |
| 381 | be quite time-consuming. There is now quite a selection of newer-generation |
516 | be quite time-consuming. There is now quite a selection of journaled |
| 382 | journaled filesystems that can be checked for consistency very quickly and are |
517 | filesystems that can be checked for consistency very quickly and are thus |
| 383 | thus generally preferred over their non-journaled counterparts. Journaled |
518 | generally preferred over their non-journaled counterparts. |
| 384 | filesystems prevent long delays when you boot your system and your filesystem |
|
|
| 385 | happens to be in an inconsistent state. |
|
|
| 386 | </p> |
519 | </p> |
| 387 | |
520 | |
| 388 | <p> |
521 | <p> |
| 389 | <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata |
522 | <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata |
| 390 | journaling for fast recovery in addition to other enhanced journaling modes like |
523 | journaling for fast recovery in addition to other enhanced journaling modes |
| 391 | full data and ordered data journaling. ext3 is a very good and reliable |
524 | like full data and ordered data journaling. It uses a hashed B*-tree index that |
| 392 | filesystem. It has an additional hashed b-tree indexing option that enables |
525 | enables high performance in almost all situations. In short, ext3 is a very |
| 393 | high performance in almost all situations. You can enable this indexing by |
526 | good and reliable filesystem and is highly recommended for most installs. |
| 394 | adding <c>-O dir_index</c> to the <c>mke2fs</c> command. In short, ext3 is an |
|
|
| 395 | excellent filesystem. |
|
|
| 396 | </p> |
|
|
| 397 | |
|
|
| 398 | <p> |
527 | </p> |
|
|
528 | |
|
|
529 | <p> |
| 399 | <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall |
530 | <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall |
| 400 | performance and greatly outperforms both ext2 and ext3 when dealing with small |
531 | performance and greatly outperforms both ext2 and ext3 when dealing with small |
| 401 | files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales |
532 | files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales |
| 402 | extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is |
533 | extremely well and has metadata journaling. ReiserFS is solid and usable as |
| 403 | solid and usable as both general-purpose filesystem and for extreme cases such |
534 | both general-purpose filesystem and for extreme cases such as the creation of |
| 404 | as the creation of large filesystems, the use of many small files, very large |
535 | large filesystems, very large files and directories containing tens of |
| 405 | files and directories containing tens of thousands of files. |
536 | thousands of small files. |
| 406 | </p> |
537 | </p> |
| 407 | |
538 | |
| 408 | <p> |
539 | <p> |
| 409 | <b>XFS</b> is a filesystem with metadata journaling which comes with a robust |
540 | <b>XFS</b> is a filesystem with metadata journaling which comes with a robust |
| 410 | feature-set and is optimized for scalability. We only recommend using this |
541 | feature-set and is optimized for scalability. We only recommend using this |
| … | |
… | |
| 415 | deal of data if the system goes down unexpectedly. |
546 | deal of data if the system goes down unexpectedly. |
| 416 | </p> |
547 | </p> |
| 417 | |
548 | |
| 418 | </body> |
549 | </body> |
| 419 | </subsection> |
550 | </subsection> |
| 420 | <subsection id="filesystems-apply"> |
|
|
| 421 | <title>Applying a Filesystem to a Partition</title> |
|
|
| 422 | <body> |
|
|
| 423 | |
|
|
| 424 | <p> |
|
|
| 425 | To create a filesystem on a partition or volume, there are tools available for |
|
|
| 426 | each possible filesystem: |
|
|
| 427 | </p> |
|
|
| 428 | |
|
|
| 429 | <table> |
|
|
| 430 | <tr> |
|
|
| 431 | <th>Filesystem</th> |
|
|
| 432 | <th>Creation Command</th> |
|
|
| 433 | </tr> |
|
|
| 434 | <tr> |
|
|
| 435 | <ti>ext2</ti> |
|
|
| 436 | <ti><c>mkfs.ext2</c></ti> |
|
|
| 437 | </tr> |
|
|
| 438 | <tr> |
|
|
| 439 | <ti>ext3</ti> |
|
|
| 440 | <ti><c>mkfs.ext3</c></ti> |
|
|
| 441 | </tr> |
|
|
| 442 | <tr> |
|
|
| 443 | <ti>reiserfs</ti> |
|
|
| 444 | <ti><c>mkfs.reiserfs</c></ti> |
|
|
| 445 | </tr> |
|
|
| 446 | <tr> |
|
|
| 447 | <ti>xfs</ti> |
|
|
| 448 | <ti><c>mkfs.xfs</c></ti> |
|
|
| 449 | </tr> |
|
|
| 450 | </table> |
|
|
| 451 | |
|
|
| 452 | <p> |
|
|
| 453 | For instance, to have the root partition (<path>/dev/hda4</path> in our example) |
|
|
| 454 | in ext3 (as in our example), you would use: |
|
|
| 455 | </p> |
|
|
| 456 | |
|
|
| 457 | <pre caption="Applying a filesystem on a partition"> |
|
|
| 458 | # <i>mkfs.ext3 /dev/hda4</i> |
|
|
| 459 | </pre> |
|
|
| 460 | |
|
|
| 461 | <p> |
|
|
| 462 | Now create the filesystems on your newly created partitions (or logical |
|
|
| 463 | volumes). |
|
|
| 464 | </p> |
|
|
| 465 | |
|
|
| 466 | <note> |
|
|
| 467 | On the PegasosII your partition which holds the kernel must be ext2 or ext3. |
|
|
| 468 | NewWorld machines can boot from any of ext2, ext3, XFS, ReiserFS or even |
|
|
| 469 | HFS/HFS+ filesystems. On OldWorld machines booting with BootX, the kernel must |
|
|
| 470 | be placed on an HFS partition, but this will be completed when you configure |
|
|
| 471 | your bootloader. |
|
|
| 472 | </note> |
|
|
| 473 | |
|
|
| 474 | </body> |
|
|
| 475 | </subsection> |
|
|
| 476 | <subsection> |
551 | <subsection> |
| 477 | <title>Activating the Swap Partition</title> |
552 | <title>Activating the Swap Partition</title> |
| 478 | <body> |
553 | <body> |
| 479 | |
554 | |
| 480 | <p> |
555 | <p> |
| 481 | <c>mkswap</c> is the command that is used to initialize swap partitions: |
556 | <c>mkswap</c> is the command that is used to initialize swap partitions: |
| 482 | </p> |
557 | </p> |
| 483 | |
558 | |
| 484 | <pre caption="Creating a Swap signature"> |
559 | <pre caption="Creating a swap signature"> |
| 485 | # <i>mkswap /dev/hda3</i> |
560 | # <i>mkswap /dev/hda3</i> |
| 486 | </pre> |
561 | </pre> |
| 487 | |
562 | |
| 488 | <p> |
563 | <p> |
| 489 | To activate the swap partition, use <c>swapon</c>: |
564 | To activate the swap partition, use <c>swapon</c>: |
| … | |
… | |
| 492 | <pre caption="Activating the swap partition"> |
567 | <pre caption="Activating the swap partition"> |
| 493 | # <i>swapon /dev/hda3</i> |
568 | # <i>swapon /dev/hda3</i> |
| 494 | </pre> |
569 | </pre> |
| 495 | |
570 | |
| 496 | <p> |
571 | <p> |
| 497 | Create and activate the swap now. |
572 | Create and activate the swap now before creating other filesystems. |
|
|
573 | </p> |
|
|
574 | |
|
|
575 | </body> |
|
|
576 | </subsection> |
|
|
577 | <subsection id="filesystems-apply"> |
|
|
578 | <title>Applying a Filesystem to a Partition</title> |
|
|
579 | <body> |
|
|
580 | |
| 498 | </p> |
581 | <p> |
|
|
582 | To create a filesystem on a partition or volume, there are tools available for |
|
|
583 | each possible filesystem: |
|
|
584 | </p> |
|
|
585 | |
|
|
586 | <table> |
|
|
587 | <tr> |
|
|
588 | <th>Filesystem</th> |
|
|
589 | <th>Creation Command</th> |
|
|
590 | </tr> |
|
|
591 | <tr> |
|
|
592 | <ti>ext2</ti> |
|
|
593 | <ti><c>mke2fs</c></ti> |
|
|
594 | </tr> |
|
|
595 | <tr> |
|
|
596 | <ti>ext3</ti> |
|
|
597 | <ti><c>mke2fs -j</c></ti> |
|
|
598 | </tr> |
|
|
599 | <tr> |
|
|
600 | <ti>reiserfs</ti> |
|
|
601 | <ti><c>mkreiserfs</c></ti> |
|
|
602 | </tr> |
|
|
603 | <tr> |
|
|
604 | <ti>xfs</ti> |
|
|
605 | <ti><c>mkfs.xfs</c></ti> |
|
|
606 | </tr> |
|
|
607 | </table> |
|
|
608 | |
|
|
609 | <p> |
|
|
610 | For instance, to make an ext3 filesystem on the root partition |
|
|
611 | (<path>/dev/hda4</path> in our example), you would use: |
|
|
612 | </p> |
|
|
613 | |
|
|
614 | <pre caption="Applying a filesystem on a partition"> |
|
|
615 | # <i>mke2fs -j /dev/hda4</i> |
|
|
616 | </pre> |
|
|
617 | |
|
|
618 | <p> |
|
|
619 | Now create the filesystems on your newly created partitions (or logical |
|
|
620 | volumes). |
|
|
621 | </p> |
|
|
622 | |
|
|
623 | <note> |
|
|
624 | On the PegasosII your partition which holds the kernel must be ext2, ext3 or |
|
|
625 | affs1. NewWorld machines can boot from any of ext2, ext3, XFS, ReiserFS or |
|
|
626 | even HFS/HFS+ filesystems. On OldWorld machines booting with BootX, the kernel |
|
|
627 | must be placed on an HFS partition, but this will be completed when you |
|
|
628 | configure your bootloader. |
|
|
629 | </note> |
| 499 | |
630 | |
| 500 | </body> |
631 | </body> |
| 501 | </subsection> |
632 | </subsection> |
| 502 | </section> |
633 | </section> |
| 503 | <section> |
634 | <section> |
| 504 | <title>Mounting</title> |
635 | <title>Mounting</title> |
| 505 | <body> |
636 | <body> |
| 506 | |
637 | |
| 507 | <p> |
638 | <p> |
| 508 | Now that your partitions are initialized and are housing a filesystem, it is |
639 | Now that your partitions are initialized and are housing a filesystem, it is |
| 509 | time to mount those partitions. Use the <c>mount</c> command. Don't forget to |
640 | time to mount those partitions. Use the <c>mount</c> command. As an example we |
| 510 | create the necessary mount directories for every partition you created. As an |
641 | mount the root partition: |
| 511 | example we create a mount-point and mount the root partition: |
|
|
| 512 | </p> |
642 | </p> |
| 513 | |
643 | |
| 514 | <pre caption="Mounting partitions"> |
644 | <pre caption="Mounting partitions"> |
| 515 | # <i>mkdir /mnt/gentoo</i> |
|
|
| 516 | # <i>mount /dev/hda4 /mnt/gentoo</i> |
645 | # <i>mount /dev/hda4 /mnt/gentoo</i> |
| 517 | </pre> |
646 | </pre> |
| 518 | |
647 | |
| 519 | <note> |
648 | <note> |
| 520 | If you want your <path>/tmp</path> to reside on a separate partition, be sure to |
649 | If you want your <path>/tmp</path> to reside on a separate partition, be sure to |
| 521 | change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This |
650 | change its permissions after mounting and unpacking with |
| 522 | also holds for <path>/var/tmp</path>. |
651 | <c>chmod 1777 /mnt/gentoo/tmp</c>. This is also true for <path>/var/tmp</path>. |
| 523 | </note> |
652 | </note> |
| 524 | |
|
|
| 525 | <p> |
|
|
| 526 | We will have to mount the proc filesystem (a virtual interface with the |
|
|
| 527 | kernel) on <path>/proc</path>. But first we will need to place our files on the |
|
|
| 528 | partitions. |
|
|
| 529 | </p> |
|
|
| 530 | |
653 | |
| 531 | <p> |
654 | <p> |
| 532 | Continue with <uri link="?part=1&chap=5">Installing the Gentoo |
655 | Continue with <uri link="?part=1&chap=5">Installing the Gentoo |
| 533 | Installation Files</uri>. |
656 | Installation Files</uri>. |
| 534 | </p> |
657 | </p> |