/[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.10 - (show annotations) (download) (as text)
Sun Sep 4 14:34:01 2011 UTC (2 years, 10 months ago) by swift
Branch: MAIN
Changes since 1.9: +10 -6 lines
File MIME type: application/xml
Bug #334167 - Update filesystem information for ext4 for the arm, ia64 and sparc architectures

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.9 2010/07/20 05:14:55 nightmorph Exp $ -->
8
9 <sections>
10
11 <version>6</version>
12 <date>2011-09-04</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 <keyval id="arch"/> firmware to read it. Our
319 example makes this 32 MB, which is appropriate for storing kernels and
320 <c>elilo</c> configuration. You can expect each <keyval id="arch"/> kernel to
321 be around 5 MB, so this configuration leaves you some room to grow and
322 experiment.
323 </p>
324
325 <pre caption="Creating the boot partition">
326 (parted) <i>mkpart primary fat32 0 32</i>
327 (parted) <i>print</i>
328 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
329 Disk label type: gpt
330 Minor Start End Filesystem Name Flags
331 1 0.017 32.000 fat32
332 </pre>
333
334 </body>
335 </subsection>
336 <subsection>
337 <title>Creating the Swap Partition</title>
338 <body>
339
340 <p>
341 Let's now create the swap partition. The classic size to make the swap
342 partition was twice the amount of RAM in the system. In modern systems with
343 lots of RAM, this is no longer necessary. For most desktop systems, a 512
344 megabyte swap partition is sufficient. For a server, you should consider
345 something larger to reflect the anticipated needs of the server.
346 </p>
347
348 <pre caption="Creating the swap partition">
349 (parted) <i>mkpart primary linux-swap 32 544</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 2 32.000 544.000
356 </pre>
357
358 </body>
359 </subsection>
360 <subsection>
361 <title>Creating the Root Partition</title>
362 <body>
363
364 <p>
365 Finally, let's create the root partition. Our configuration will make the root
366 partition to occupy the rest of the disk. We default to ext3, but you can use
367 ext2, jfs, reiserfs or xfs if you prefer. The actual filesystem is not created
368 in this step, but the partition table contains an indication of what kind of
369 filesystem is stored on each partition, and it's a good idea to make the table
370 match your intentions.
371 </p>
372
373 <pre caption="Creating the root partition">
374 (parted) <i>mkpart primary ext3 544 34732.890</i>
375 (parted) <i>print</i>
376 Disk geometry for /dev/sda: 0.000-34732.890 megabytes
377 Disk label type: gpt
378 Minor Start End Filesystem Name Flags
379 1 0.017 32.000 fat32
380 2 32.000 544.000
381 3 544.000 34732.874
382 </pre>
383
384 </body>
385 </subsection>
386 <subsection>
387 <title>Exiting parted</title>
388 <body>
389
390 <p>
391 To quit from parted, type <c>quit</c>. There's no need to take a separate step
392 to save your partition layout since parted has been saving it all along. As you
393 leave, parted gives you reminder to update your <c>/etc/fstab</c>, which we'll
394 do later in this guide.
395 </p>
396
397 <pre caption="Quit from parted">
398 (parted) <i>quit</i>
399 Information: Don't forget to update /etc/fstab, if necessary.
400 </pre>
401
402 <p>
403 Now that your partitions are created, you can continue with <uri
404 link="#filesystems">Creating Filesystems</uri>.
405 </p>
406
407 </body>
408 </subsection>
409 </section>
410 <section id="filesystems">
411 <title>Creating Filesystems</title>
412 <subsection>
413 <title>Introduction</title>
414 <body>
415
416 <p>
417 Now that your partitions are created, it is time to place a filesystem on them.
418 If you don't care about what filesystem to choose and are happy with what we use
419 as default in this handbook, continue with <uri
420 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
421 Otherwise read on to learn about the available filesystems...
422 </p>
423
424 </body>
425 </subsection>
426
427 <subsection>
428 <include href="hb-install-filesystems.xml"/>
429 </subsection>
430
431 <subsection id="filesystems-apply">
432 <title>Applying a Filesystem to a Partition</title>
433 <body>
434
435 <p>
436 To create a filesystem on a partition or volume, there are tools available for
437 each possible filesystem:
438 </p>
439
440 <table>
441 <tr>
442 <th>Filesystem</th>
443 <th>Creation Command</th>
444 </tr>
445 <tr>
446 <ti>vfat</ti>
447 <ti><c>mkdosfs</c></ti>
448 </tr>
449 <tr>
450 <ti>ext2</ti>
451 <ti><c>mkfs.ext2</c></ti>
452 </tr>
453 <tr>
454 <ti>ext3</ti>
455 <ti><c>mkfs.ext3</c></ti>
456 </tr>
457 <tr>
458 <ti>ext4</ti>
459 <ti><c>mkfs.ext4</c></ti>
460 </tr>
461 <tr>
462 <ti>reiserfs</ti>
463 <ti><c>mkreiserfs</c></ti>
464 </tr>
465 <tr>
466 <ti>xfs</ti>
467 <ti><c>mkfs.xfs</c></ti>
468 </tr>
469 <tr>
470 <ti>jfs</ti>
471 <ti><c>mkfs.jfs</c></ti>
472 </tr>
473 </table>
474
475 <p>
476 For instance, to have the boot partition (<path>/dev/sda1</path> in our
477 example) as vfat and the root partition (<path>/dev/sda3</path> in our example)
478 as ext3, you would run the following commands:
479 </p>
480
481 <pre caption="Applying a filesystem on a partition">
482 # <i>mkdosfs /dev/sda1</i>
483 # <i>mkfs.ext3 /dev/sda3</i>
484 </pre>
485
486 </body>
487 </subsection>
488 <subsection>
489 <title>Activating the Swap Partition</title>
490 <body>
491
492 <p>
493 <c>mkswap</c> is the command that is used to initialize swap partitions:
494 </p>
495
496 <pre caption="Creating a Swap signature">
497 # <i>mkswap /dev/sda2</i>
498 </pre>
499
500 <p>
501 To activate the swap partition, use <c>swapon</c>:
502 </p>
503
504 <pre caption="Activating the swap partition">
505 # <i>swapon /dev/sda2</i>
506 </pre>
507
508 <p>
509 Create and activate the swap with the commands mentioned above.
510 </p>
511
512 </body>
513 </subsection>
514 </section>
515 <section>
516 <title>Mounting</title>
517 <body>
518
519 <p>
520 Now that your partitions are initialized and are housing a filesystem, it is
521 time to mount those partitions. Use the <c>mount</c> command. Don't forget to
522 create the necessary mount directories for every partition you created. As an
523 example we mount the root and boot partition:
524 </p>
525
526 <pre caption="Mounting the root partition">
527 # <i>mount /dev/sda3 /mnt/gentoo</i>
528 </pre>
529
530 <note>
531 Unlike some of the other architectures supported by Gentoo, <path>/boot</path>
532 is not mounted on ia64. The reason for this is that the EFI boot partition will
533 be automatically mounted and written by the <c>elilo</c> command each time that
534 you run it. Because of this, <path>/boot</path> resides on the root filesystem
535 and is the storage place for the kernels referenced by your <c>elilo</c>
536 configuration.
537 </note>
538
539 <note>
540 If you want your <path>/tmp</path> to reside on a separate partition, be sure to
541 change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
542 also holds for <path>/var/tmp</path>.
543 </note>
544
545 <p>
546 We will also have to mount the proc filesystem (a virtual interface with the
547 kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
548 </p>
549
550 <p>
551 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
552 Installation Files</uri>.
553 </p>
554
555 </body>
556 </section>
557 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20