/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-install-ppc-disk.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.53

  ViewVC Help
Powered by ViewVC 1.1.20