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

Contents of /xml/htdocs/doc/en/handbook/hb-install-ia64-disk.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download) (as text)
Mon Jan 26 08:04:26 2009 UTC (5 years, 7 months ago) by nightmorph
Branch: MAIN
Changes since 1.7: +2 -2 lines
File MIME type: application/xml
Engrish fixes, bug 253374

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ia64-disk.xml,v 1.7 2008/04/01 08:53:46 nightmorph Exp $ -->
8
9 <sections>
10
11 <version>4.0</version>
12 <date>2008-04-01</date>
13
14 <section>
15 <title>Introduction to Block Devices</title>
16
17 <subsection>
18 <include href="hb-install-blockdevices.xml"/>
19 </subsection>
20
21 <subsection>
22 <title>Partitions</title>
23 <body>
24
25 <p>
26 Although it is theoretically possible to use a full disk to house your Linux
27 system, this is almost never done in practice. Instead, full disk block devices
28 are split up in smaller, more manageable block devices. On <keyval id="arch"/>
29 systems, these are called <e>partitions</e>.
30 </p>
31
32 <p>
33 Itanium systems use EFI, the Extensible Firmware Interface, for booting. The
34 partition table format that EFI understands is called GPT, or GUID Partition
35 Table. The partitioning program that understands GPT is called "parted", so
36 that is the tool we will use below. Additionally, EFI can only read FAT
37 filesystems, so that is the format to use for the EFI boot partition, where the
38 kernel will be installed by "elilo".
39 </p>
40
41 </body>
42 </subsection>
43 <subsection>
44 <title>Advanced Storage</title>
45 <body>
46
47 <p>
48 The <keyval id="arch"/> Installation CDs provide support for EVMS and LVM2.
49 EVMS and LVM2 increase the flexibility offered by your partitioning setup.
50 During the installation instructions, we will focus on "regular" partitions,
51 but it is still good to know EVMS and LVM2 are supported as well.
52 </p>
53
54 </body>
55 </subsection>
56 </section>
57 <section>
58 <title>Designing a Partitioning Scheme</title>
59 <subsection>
60 <title>Default Partitioning Scheme</title>
61 <body>
62
63 <p>
64 If you are not interested in drawing up a partitioning scheme for your system,
65 you can use the partitioning scheme we use throughout this book:
66 </p>
67
68 <table>
69 <tr>
70 <th>Partition</th>
71 <th>Filesystem</th>
72 <th>Size</th>
73 <th>Description</th>
74 </tr>
75 <tr>
76 <ti><path>/dev/sda1</path></ti>
77 <ti>vfat</ti>
78 <ti>32M</ti>
79 <ti>EFI Boot partition</ti>
80 </tr>
81 <tr>
82 <ti><path>/dev/sda2</path></ti>
83 <ti>(swap)</ti>
84 <ti>512M</ti>
85 <ti>Swap partition</ti>
86 </tr>
87 <tr>
88 <ti><path>/dev/sda3</path></ti>
89 <ti>ext3</ti>
90 <ti>Rest of the disk</ti>
91 <ti>Root partition</ti>
92 </tr>
93 </table>
94
95 <p>
96 If you are interested in knowing how big a partition should be, or even how
97 many partitions you need, read on. Otherwise continue now with partitioning
98 your disk by reading <uri link="#parted">Using parted to Partition your
99 Disk</uri>.
100 </p>
101
102 </body>
103 </subsection>
104 <subsection>
105 <title>How Many and How Big?</title>
106 <body>
107
108 <p>
109 The number of partitions is highly dependent on your environment. For instance,
110 if you have lots of users, you will most likely want to have your
111 <path>/home</path> separate as it increases security and makes backups easier.
112 If you are installing Gentoo to perform as a mailserver, your
113 <path>/var</path> should be separate as all mails are stored inside
114 <path>/var</path>. A good choice of filesystem will then maximise your
115 performance. Gameservers will have a separate <path>/opt</path> as most gaming
116 servers are installed there. The reason is similar for <path>/home</path>:
117 security and backups. You will definitely want to keep <path>/usr</path> big:
118 not only will it contain the majority of applications, the Portage tree alone
119 takes around 500 Mbyte excluding the various sources that are stored in it.
120 </p>
121
122 <p>
123 As you can see, it very much depends on what you want to achieve. Separate
124 partitions or volumes have the following advantages:
125 </p>
126
127 <ul>
128 <li>
129 You can choose the best performing filesystem for each partition or volume
130 </li>
131 <li>
132 Your entire system cannot run out of free space if one defunct tool is
133 continuously writing files to a partition or volume
134 </li>
135 <li>
136 If necessary, file system checks are reduced in time, as multiple checks can
137 be done in parallel (although this advantage is more with multiple disks than
138 it is with multiple partitions)
139 </li>
140 <li>
141 Security can be enhanced by mounting some partitions or volumes read-only,
142 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
143 </li>
144 </ul>
145
146 <p>
147 However, multiple partitions have one big disadvantage: if not configured
148 properly, you might result in having a system with lots of free space on one
149 partition and none on another. There is also a 15-partition limit for SCSI and
150 SATA.
151 </p>
152
153 <p>
154 As an example partitioning, we show you one for a 20GB disk, used as a
155 demonstration laptop (containing webserver, mailserver, gnome, ...):
156 </p>
157
158 <pre caption="Filesystem usage example">
159 $ <i>df -h</i>
160 Filesystem Type Size Used Avail Use% Mounted on
161 /dev/sda5 ext3 509M 132M 351M 28% /
162 /dev/sda2 ext3 5.0G 3.0G 1.8G 63% /home
163 /dev/sda7 ext3 7.9G 6.2G 1.3G 83% /usr
164 /dev/sda8 ext3 1011M 483M 477M 51% /opt
165 /dev/sda9 ext3 2.0G 607M 1.3G 32% /var
166 /dev/sda1 ext2 51M 17M 31M 36% /boot
167 /dev/sda6 swap 516M 12M 504M 2% &lt;not mounted&gt;
168 <comment>(Unpartitioned space for future usage: 2 GB)</comment>
169 </pre>
170
171 <p>
172 <path>/usr</path> is rather full (83% used) here, but once
173 all software is installed, <path>/usr</path> doesn't tend to grow that much.
174 Although allocating a few gigabytes of disk space for <path>/var</path> may
175 seem excessive, remember that Portage uses this partition by default for
176 compiling packages. If you want to keep <path>/var</path> at a more reasonable
177 size, such as 1GB, you will need to alter your <c>PORTAGE_TMPDIR</c> variable
178 in <path>/etc/make.conf</path> to point to the partition with enough free space
179 for compiling extremely large packages such as OpenOffice.
180 </p>
181
182 </body>
183 </subsection>
184 </section>
185 <section id="parted">
186 <title>Using parted to Partition your Disk</title>
187 <subsection>
188 <body>
189
190 <p>
191 The following parts explain how to create the example partition layout
192 described previously, namely:
193 </p>
194
195 <table>
196 <tr>
197 <th>Partition</th>
198 <th>Description</th>
199 </tr>
200 <tr>
201 <ti><path>/dev/sda1</path></ti>
202 <ti>EFI Boot partition</ti>
203 </tr>
204 <tr>
205 <ti><path>/dev/sda2</path></ti>
206 <ti>Swap partition</ti>
207 </tr>
208 <tr>
209 <ti><path>/dev/sda3</path></ti>
210 <ti>Root partition</ti>
211 </tr>
212 </table>
213
214 <p>
215 Change your partition layout according to your own preference.
216 </p>
217
218 </body>
219 </subsection>
220 <subsection>
221 <title>Viewing the Current Partition Layout</title>
222 <body>
223
224 <p>
225 <c>parted</c> is the GNU partition editor.
226 Fire up <c>parted</c> on your disk (in our example, we use
227 <path>/dev/sda</path>):
228 </p>
229
230 <pre caption="Starting parted">
231 # <i>parted /dev/sda</i>
232 </pre>
233
234 <p>
235 Once in <c>parted</c>, you'll be greeted with a prompt that looks like this:
236 </p>
237
238 <pre caption="parted prompt">
239 GNU Parted 1.6.22
240 Copyright (C) 1998 - 2005 Free Software Foundation, Inc.
241 This program is free software, covered by the GNU General Public License.
242
243 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
244 even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
245 General Public License for more details.
246
247 Using /dev/sda
248 (parted)
249 </pre>
250
251 <p>
252 At this point one of the available commands is <c>help</c>, which you should use
253 if you want to see the other available commands. Another command is
254 <c>print</c> which you should type next to display your disk's current partition
255 configuration:
256 </p>
257
258 <pre caption="An example partition configuration">
259 (parted) <i>print</i>
260 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
261 Disk label type: gpt
262 Minor Start End Filesystem Name Flags
263 1 0.017 203.938 fat32 boot
264 2 203.938 4243.468 linux-swap
265 3 4243.469 34724.281 ext3
266 </pre>
267
268 <p>
269 This particular configuration is very similar to the one that we recommend
270 above. Note on the second line that the partition table is type is GPT. If it
271 is different, then the ia64 system will not be able to boot from this disk.
272 For the sake of this guide we'll remove the partitions and create them anew.
273 </p>
274
275 </body>
276 </subsection>
277 <subsection>
278 <title>Removing all Partitions</title>
279 <body>
280
281 <note>
282 Unlike fdisk and some other partitioning programs which postpone committing
283 changes until you give the write instruction, parted commands take effect
284 immediately. So once you start adding and removing partitions, you can't
285 simply quit without writing them... they've already been written.
286 </note>
287
288 <p>
289 The easy way to remove all partitions and start fresh, which guarantees that we
290 are using the correct partition type, is to make a new partition table using the
291 <c>mklabel</c> command. After you do this, you will have an empty GPT partition
292 table.
293 </p>
294
295 <pre caption="Creating a new partition table">
296 (parted) <i>mklabel gpt</i>
297 (parted) <i>print</i>
298 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
299 Disk label type: gpt
300 Minor Start End Filesystem Name Flags
301 </pre>
302
303 <p>
304 Now that the partition table is empty, we're ready to create the
305 partitions. We will use a default partitioning scheme as discussed previously.
306 Of course, don't follow these instructions to the letter if you don't want the
307 same partitioning scheme!
308 </p>
309
310 </body>
311 </subsection>
312 <subsection>
313 <title>Creating the EFI Boot Partition</title>
314 <body>
315
316 <p>
317 We first create a small EFI boot partition. This is required to be a FAT
318 filesystem in order for the ia64 firmware to read it. Our example makes this
319 32 megabytes, which is appropriate for storing kernels and elilo configuration.
320 You can expect each ia64 kernel to be around 5 megabytes, so this configuration
321 leaves you some room to grow and experiment.
322 </p>
323
324 <pre caption="Creating the boot partition">
325 (parted) <i>mkpart primary fat32 0 32</i>
326 (parted) <i>print</i>
327 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
328 Disk label type: gpt
329 Minor Start End Filesystem Name Flags
330 1 0.017 32.000 fat32
331 </pre>
332
333 </body>
334 </subsection>
335 <subsection>
336 <title>Creating the Swap Partition</title>
337 <body>
338
339 <p>
340 Let's now create the swap partition. The classic size to make the swap
341 partition was twice the amount of RAM in the system. In modern systems with
342 lots of RAM, this is no longer necessary. For most desktop systems, a 512
343 megabyte swap partition is sufficient. For a server, you should consider
344 something larger to reflect the anticipated needs of the server.
345 </p>
346
347 <pre caption="Creating the swap partition">
348 (parted) <i>mkpart primary linux-swap 32 544</i>
349 (parted) <i>print</i>
350 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
351 Disk label type: gpt
352 Minor Start End Filesystem Name Flags
353 1 0.017 32.000 fat32
354 2 32.000 544.000
355 </pre>
356
357 </body>
358 </subsection>
359 <subsection>
360 <title>Creating the Root Partition</title>
361 <body>
362
363 <p>
364 Finally, let's create the root partition. Our configuration will make the root
365 partition to occupy the rest of the disk. We default to ext3, but you can use
366 ext2, jfs, reiserfs or xfs if you prefer. The actual filesystem is not created
367 in this step, but the partition table contains an indication of what kind of
368 filesystem is stored on each partition, and it's a good idea to make the table
369 match your intentions.
370 </p>
371
372 <pre caption="Creating the root partition">
373 (parted) <i>mkpart primary ext3 544 34732.890</i>
374 (parted) <i>print</i>
375 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
376 Disk label type: gpt
377 Minor Start End Filesystem Name Flags
378 1 0.017 32.000 fat32
379 2 32.000 544.000
380 3 544.000 34732.874
381 </pre>
382
383 </body>
384 </subsection>
385 <subsection>
386 <title>Exiting parted</title>
387 <body>
388
389 <p>
390 To quit from parted, type <c>quit</c>. There's no need to take a separate step
391 to save your partition layout since parted has been saving it all along. As you
392 leave, parted gives you reminder to update your <c>/etc/fstab</c>, which we'll
393 do later in this guide.
394 </p>
395
396 <pre caption="Quit from parted">
397 (parted) <i>quit</i>
398 Information: Don't forget to update /etc/fstab, if necessary.
399 </pre>
400
401 <p>
402 Now that your partitions are created, you can continue with <uri
403 link="#filesystems">Creating Filesystems</uri>.
404 </p>
405
406 </body>
407 </subsection>
408 </section>
409 <section id="filesystems">
410 <title>Creating Filesystems</title>
411 <subsection>
412 <title>Introduction</title>
413 <body>
414
415 <p>
416 Now that your partitions are created, it is time to place a filesystem on them.
417 If you don't care about what filesystem to choose and are happy with what we use
418 as default in this handbook, continue with <uri
419 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
420 Otherwise read on to learn about the available filesystems...
421 </p>
422
423 </body>
424 </subsection>
425
426 <subsection>
427 <include href="hb-install-filesystems.xml"/>
428 </subsection>
429
430 <subsection id="filesystems-apply">
431 <title>Applying a Filesystem to a Partition</title>
432 <body>
433
434 <p>
435 To create a filesystem on a partition or volume, there are tools available for
436 each possible filesystem:
437 </p>
438
439 <table>
440 <tr>
441 <th>Filesystem</th>
442 <th>Creation Command</th>
443 </tr>
444 <tr>
445 <ti>vfat</ti>
446 <ti><c>mkdosfs</c></ti>
447 </tr>
448 <tr>
449 <ti>ext2</ti>
450 <ti><c>mke2fs</c></ti>
451 </tr>
452 <tr>
453 <ti>ext3</ti>
454 <ti><c>mke2fs -j</c></ti>
455 </tr>
456 <tr>
457 <ti>reiserfs</ti>
458 <ti><c>mkreiserfs</c></ti>
459 </tr>
460 <tr>
461 <ti>xfs</ti>
462 <ti><c>mkfs.xfs</c></ti>
463 </tr>
464 <tr>
465 <ti>jfs</ti>
466 <ti><c>mkfs.jfs</c></ti>
467 </tr>
468 </table>
469
470 <p>
471 For instance, to have the boot partition (<path>/dev/sda1</path> in our
472 example) as vfat and the root partition (<path>/dev/sda3</path> in our example)
473 as ext3, you would run the following commands:
474 </p>
475
476 <pre caption="Applying a filesystem on a partition">
477 # <i>mkdosfs /dev/sda1</i>
478 # <i>mke2fs -j /dev/sda3</i>
479 </pre>
480
481 </body>
482 </subsection>
483 <subsection>
484 <title>Activating the Swap Partition</title>
485 <body>
486
487 <p>
488 <c>mkswap</c> is the command that is used to initialize swap partitions:
489 </p>
490
491 <pre caption="Creating a Swap signature">
492 # <i>mkswap /dev/sda2</i>
493 </pre>
494
495 <p>
496 To activate the swap partition, use <c>swapon</c>:
497 </p>
498
499 <pre caption="Activating the swap partition">
500 # <i>swapon /dev/sda2</i>
501 </pre>
502
503 <p>
504 Create and activate the swap with the commands mentioned above.
505 </p>
506
507 </body>
508 </subsection>
509 </section>
510 <section>
511 <title>Mounting</title>
512 <body>
513
514 <p>
515 Now that your partitions are initialized and are housing a filesystem, it is
516 time to mount those partitions. Use the <c>mount</c> command. Don't forget to
517 create the necessary mount directories for every partition you created. As an
518 example we mount the root and boot partition:
519 </p>
520
521 <pre caption="Mounting the root partition">
522 # <i>mount /dev/sda3 /mnt/gentoo</i>
523 </pre>
524
525 <note>
526 Unlike some of the other architectures supported by Gentoo, <path>/boot</path>
527 is not mounted on ia64. The reason for this is that the EFI boot partition will
528 be automatically mounted and written by the elilo command each time that you run
529 it. Because of this, /boot resides on the root filesystem and is the storage
530 place for the kernels referenced by your elilo configuration.
531 </note>
532
533 <note>
534 If you want your <path>/tmp</path> to reside on a separate partition, be sure to
535 change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
536 also holds for <path>/var/tmp</path>.
537 </note>
538
539 <p>
540 We will also have to mount the proc filesystem (a virtual interface with the
541 kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
542 </p>
543
544 <p>
545 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
546 Installation Files</uri>.
547 </p>
548
549 </body>
550 </section>
551 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20