/[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.13 - (show annotations) (download) (as text)
Tue Jul 24 12:12:52 2012 UTC (2 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.12: +5 -5 lines
File MIME type: application/xml
Fix bug #427860 - Use /etc/portage for make.conf and make.profile. Old location (/etc) is still supported, this is a heads up (new default)

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.12 2011/10/17 19:51:45 swift Exp $ -->
8
9 <sections>
10
11 <version>8</version>
12 <date>2012-07-24</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 LVM2.
49 LVM2 increases 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 LVM2 is 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 disadvantages as well. If not configured
148 properly, you will have a system with lots of free space on one partition and
149 none on another. Another nuisance is that separate partitions - especially
150 for important mountpoints like <path>/usr</path> or <path>/var</path> - often
151 require the administrator to boot with an initramfs to mount the partition
152 before other boot scripts start. This isn't always the case though, so YMMV.
153 </p>
154
155 <p>
156 There is also a 15-partition limit for SCSI and SATA, unless you use GPT
157 labels.
158 </p>
159
160 <p>
161 As an example partitioning, we show you one for a 20GB disk, used as a
162 demonstration laptop (containing webserver, mailserver, gnome, ...):
163 </p>
164
165 <pre caption="Filesystem usage example">
166 $ <i>df -h</i>
167 Filesystem Type Size Used Avail Use% Mounted on
168 /dev/sda5 ext3 509M 132M 351M 28% /
169 /dev/sda2 ext3 5.0G 3.0G 1.8G 63% /home
170 /dev/sda7 ext3 7.9G 6.2G 1.3G 83% /usr
171 /dev/sda8 ext3 1011M 483M 477M 51% /opt
172 /dev/sda9 ext3 2.0G 607M 1.3G 32% /var
173 /dev/sda1 ext2 51M 17M 31M 36% /boot
174 /dev/sda6 swap 516M 12M 504M 2% &lt;not mounted&gt;
175 <comment>(Unpartitioned space for future usage: 2 GB)</comment>
176 </pre>
177
178 <p>
179 <path>/usr</path> is rather full (83% used) here, but once
180 all software is installed, <path>/usr</path> doesn't tend to grow that much.
181 Although allocating a few gigabytes of disk space for <path>/var</path> may
182 seem excessive, remember that Portage uses this partition by default for
183 compiling packages. If you want to keep <path>/var</path> at a more reasonable
184 size, such as 1GB, you will need to alter your <c>PORTAGE_TMPDIR</c> variable
185 in <path>/etc/portage/make.conf</path> to point to the partition with enough
186 free space for compiling extremely large packages such as OpenOffice.
187 </p>
188
189 </body>
190 </subsection>
191 </section>
192 <section id="parted">
193 <title>Using parted to Partition your Disk</title>
194 <subsection>
195 <body>
196
197 <p>
198 The following parts explain how to create the example partition layout
199 described previously, namely:
200 </p>
201
202 <table>
203 <tr>
204 <th>Partition</th>
205 <th>Description</th>
206 </tr>
207 <tr>
208 <ti><path>/dev/sda1</path></ti>
209 <ti>EFI Boot partition</ti>
210 </tr>
211 <tr>
212 <ti><path>/dev/sda2</path></ti>
213 <ti>Swap partition</ti>
214 </tr>
215 <tr>
216 <ti><path>/dev/sda3</path></ti>
217 <ti>Root partition</ti>
218 </tr>
219 </table>
220
221 <p>
222 Change your partition layout according to your own preference.
223 </p>
224
225 </body>
226 </subsection>
227 <subsection>
228 <title>Viewing the Current Partition Layout</title>
229 <body>
230
231 <p>
232 <c>parted</c> is the GNU partition editor.
233 Fire up <c>parted</c> on your disk (in our example, we use
234 <path>/dev/sda</path>):
235 </p>
236
237 <pre caption="Starting parted">
238 # <i>parted /dev/sda</i>
239 </pre>
240
241 <p>
242 Once in <c>parted</c>, you'll be greeted with a prompt that looks like this:
243 </p>
244
245 <pre caption="parted prompt">
246 GNU Parted 1.6.22
247 Copyright (C) 1998 - 2005 Free Software Foundation, Inc.
248 This program is free software, covered by the GNU General Public License.
249
250 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
251 even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
252 General Public License for more details.
253
254 Using /dev/sda
255 (parted)
256 </pre>
257
258 <p>
259 At this point one of the available commands is <c>help</c>, which you should use
260 if you want to see the other available commands. Another command is
261 <c>print</c> which you should type next to display your disk's current partition
262 configuration:
263 </p>
264
265 <pre caption="An example partition configuration">
266 (parted) <i>print</i>
267 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
268 Disk label type: gpt
269 Minor Start End Filesystem Name Flags
270 1 0.017 203.938 fat32 boot
271 2 203.938 4243.468 linux-swap
272 3 4243.469 34724.281 ext3
273 </pre>
274
275 <p>
276 This particular configuration is very similar to the one that we recommend
277 above. Note on the second line that the partition table is type is GPT. If it
278 is different, then the ia64 system will not be able to boot from this disk.
279 For the sake of this guide we'll remove the partitions and create them anew.
280 </p>
281
282 </body>
283 </subsection>
284 <subsection>
285 <title>Removing all Partitions</title>
286 <body>
287
288 <note>
289 Unlike fdisk and some other partitioning programs which postpone committing
290 changes until you give the write instruction, parted commands take effect
291 immediately. So once you start adding and removing partitions, you can't
292 simply quit without writing them... they've already been written.
293 </note>
294
295 <p>
296 The easy way to remove all partitions and start fresh, which guarantees that we
297 are using the correct partition type, is to make a new partition table using the
298 <c>mklabel</c> command. After you do this, you will have an empty GPT partition
299 table.
300 </p>
301
302 <pre caption="Creating a new partition table">
303 (parted) <i>mklabel gpt</i>
304 (parted) <i>print</i>
305 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
306 Disk label type: gpt
307 Minor Start End Filesystem Name Flags
308 </pre>
309
310 <p>
311 Now that the partition table is empty, we're ready to create the
312 partitions. We will use a default partitioning scheme as discussed previously.
313 Of course, don't follow these instructions to the letter if you don't want the
314 same partitioning scheme!
315 </p>
316
317 </body>
318 </subsection>
319 <subsection>
320 <title>Creating the EFI Boot Partition</title>
321 <body>
322
323 <p>
324 We first create a small EFI boot partition. This is required to be a FAT
325 filesystem in order for the <keyval id="arch"/> firmware to read it. Our
326 example makes this 32 MB, which is appropriate for storing kernels and
327 <c>elilo</c> configuration. You can expect each <keyval id="arch"/> kernel to
328 be around 5 MB, so this configuration leaves you some room to grow and
329 experiment.
330 </p>
331
332 <pre caption="Creating the boot partition">
333 (parted) <i>mkpart primary fat32 0 32</i>
334 (parted) <i>print</i>
335 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
336 Disk label type: gpt
337 Minor Start End Filesystem Name Flags
338 1 0.017 32.000 fat32
339 </pre>
340
341 </body>
342 </subsection>
343 <subsection>
344 <title>Creating the Swap Partition</title>
345 <body>
346
347 <p>
348 Let's now create the swap partition. The classic size to make the swap
349 partition was twice the amount of RAM in the system. In modern systems with
350 lots of RAM, this is no longer necessary. For most desktop systems, a 512
351 megabyte swap partition is sufficient. For a server, you should consider
352 something larger to reflect the anticipated needs of the server.
353 </p>
354
355 <pre caption="Creating the swap partition">
356 (parted) <i>mkpart primary linux-swap 32 544</i>
357 (parted) <i>print</i>
358 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
359 Disk label type: gpt
360 Minor Start End Filesystem Name Flags
361 1 0.017 32.000 fat32
362 2 32.000 544.000
363 </pre>
364
365 </body>
366 </subsection>
367 <subsection>
368 <title>Creating the Root Partition</title>
369 <body>
370
371 <p>
372 Finally, let's create the root partition. Our configuration will make the root
373 partition to occupy the rest of the disk. We default to ext3, but you can use
374 ext2, jfs, reiserfs or xfs if you prefer. The actual filesystem is not created
375 in this step, but the partition table contains an indication of what kind of
376 filesystem is stored on each partition, and it's a good idea to make the table
377 match your intentions.
378 </p>
379
380 <pre caption="Creating the root partition">
381 (parted) <i>mkpart primary ext3 544 34732.890</i>
382 (parted) <i>print</i>
383 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
384 Disk label type: gpt
385 Minor Start End Filesystem Name Flags
386 1 0.017 32.000 fat32
387 2 32.000 544.000
388 3 544.000 34732.874
389 </pre>
390
391 </body>
392 </subsection>
393 <subsection>
394 <title>Exiting parted</title>
395 <body>
396
397 <p>
398 To quit from parted, type <c>quit</c>. There's no need to take a separate step
399 to save your partition layout since parted has been saving it all along. As you
400 leave, parted gives you reminder to update your <c>/etc/fstab</c>, which we'll
401 do later in this guide.
402 </p>
403
404 <pre caption="Quit from parted">
405 (parted) <i>quit</i>
406 Information: Don't forget to update /etc/fstab, if necessary.
407 </pre>
408
409 <p>
410 Now that your partitions are created, you can continue with <uri
411 link="#filesystems">Creating Filesystems</uri>.
412 </p>
413
414 </body>
415 </subsection>
416 </section>
417 <section id="filesystems">
418 <title>Creating Filesystems</title>
419 <subsection>
420 <title>Introduction</title>
421 <body>
422
423 <p>
424 Now that your partitions are created, it is time to place a filesystem on them.
425 If you don't care about what filesystem to choose and are happy with what we use
426 as default in this handbook, continue with <uri
427 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
428 Otherwise read on to learn about the available filesystems...
429 </p>
430
431 </body>
432 </subsection>
433
434 <subsection>
435 <include href="hb-install-filesystems.xml"/>
436 </subsection>
437
438 <subsection id="filesystems-apply">
439 <title>Applying a Filesystem to a Partition</title>
440 <body>
441
442 <p>
443 To create a filesystem on a partition or volume, there are tools available for
444 each possible filesystem:
445 </p>
446
447 <table>
448 <tr>
449 <th>Filesystem</th>
450 <th>Creation Command</th>
451 </tr>
452 <tr>
453 <ti>vfat</ti>
454 <ti><c>mkdosfs</c></ti>
455 </tr>
456 <tr>
457 <ti>ext2</ti>
458 <ti><c>mkfs.ext2</c></ti>
459 </tr>
460 <tr>
461 <ti>ext3</ti>
462 <ti><c>mkfs.ext3</c></ti>
463 </tr>
464 <tr>
465 <ti>ext4</ti>
466 <ti><c>mkfs.ext4</c></ti>
467 </tr>
468 <tr>
469 <ti>reiserfs</ti>
470 <ti><c>mkreiserfs</c></ti>
471 </tr>
472 <tr>
473 <ti>xfs</ti>
474 <ti><c>mkfs.xfs</c></ti>
475 </tr>
476 <tr>
477 <ti>jfs</ti>
478 <ti><c>mkfs.jfs</c></ti>
479 </tr>
480 </table>
481
482 <p>
483 For instance, to have the boot partition (<path>/dev/sda1</path> in our
484 example) as vfat and the root partition (<path>/dev/sda3</path> in our example)
485 as ext3, you would run the following commands:
486 </p>
487
488 <pre caption="Applying a filesystem on a partition">
489 # <i>mkdosfs /dev/sda1</i>
490 # <i>mkfs.ext3 /dev/sda3</i>
491 </pre>
492
493 </body>
494 </subsection>
495 <subsection>
496 <title>Activating the Swap Partition</title>
497 <body>
498
499 <p>
500 <c>mkswap</c> is the command that is used to initialize swap partitions:
501 </p>
502
503 <pre caption="Creating a Swap signature">
504 # <i>mkswap /dev/sda2</i>
505 </pre>
506
507 <p>
508 To activate the swap partition, use <c>swapon</c>:
509 </p>
510
511 <pre caption="Activating the swap partition">
512 # <i>swapon /dev/sda2</i>
513 </pre>
514
515 <p>
516 Create and activate the swap with the commands mentioned above.
517 </p>
518
519 </body>
520 </subsection>
521 </section>
522 <section>
523 <title>Mounting</title>
524 <body>
525
526 <p>
527 Now that your partitions are initialized and are housing a filesystem, it is
528 time to mount those partitions. Use the <c>mount</c> command. Don't forget to
529 create the necessary mount directories for every partition you created. As an
530 example we mount the root and boot partition:
531 </p>
532
533 <pre caption="Mounting the root partition">
534 # <i>mount /dev/sda3 /mnt/gentoo</i>
535 </pre>
536
537 <note>
538 Unlike some of the other architectures supported by Gentoo, <path>/boot</path>
539 is not mounted on ia64. The reason for this is that the EFI boot partition will
540 be automatically mounted and written by the <c>elilo</c> command each time that
541 you run it. Because of this, <path>/boot</path> resides on the root filesystem
542 and is the storage place for the kernels referenced by your <c>elilo</c>
543 configuration.
544 </note>
545
546 <note>
547 If you want your <path>/tmp</path> to reside on a separate partition, be sure to
548 change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
549 also holds for <path>/var/tmp</path>.
550 </note>
551
552 <p>
553 We will also have to mount the proc filesystem (a virtual interface with the
554 kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
555 </p>
556
557 <p>
558 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
559 Installation Files</uri>.
560 </p>
561
562 </body>
563 </section>
564 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20