/[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.4 - (show annotations) (download) (as text)
Mon May 7 18:11:41 2007 UTC (7 years, 5 months ago) by nightmorph
Branch: MAIN
Changes since 1.3: +4 -27 lines
File MIME type: application/xml
2007.0 release is here; final changes and new docs

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

  ViewVC Help
Powered by ViewVC 1.1.20