| 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-alpha-disk.xml,v 1.11 2004/11/15 12:47:47 swift Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-alpha-disk.xml,v 1.32 2011/10/17 19:51:45 swift Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | |
10 | |
| 11 | <version>1.9</version> |
11 | <version>11</version> |
| 12 | <date>August 30, 2004</date> |
12 | <date>2011-10-17</date> |
| 13 | |
13 | |
| 14 | <section> |
14 | <section> |
| 15 | <title>Introduction to Block Devices</title> |
15 | <title>Introduction to Block Devices</title> |
| 16 | <subsection> |
|
|
| 17 | <title>Block Devices</title> |
|
|
| 18 | <body> |
|
|
| 19 | |
16 | |
| 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 SCSI HD in a Linux system, namely |
|
|
| 31 | <path>/dev/sda</path>. |
|
|
| 32 | </p> |
|
|
| 33 | |
|
|
| 34 | <p> |
|
|
| 35 | The block devices above represent an abstract interface to the disk. User |
|
|
| 36 | programs can use these block devices to interact with your disk without worrying |
|
|
| 37 | about whether your drives are IDE, SCSI or something else. The program can |
|
|
| 38 | simply address the storage on the disk as a bunch of contiguous, |
|
|
| 39 | randomly-accessible 512-byte blocks. |
|
|
| 40 | </p> |
|
|
| 41 | |
|
|
| 42 | </body> |
|
|
| 43 | </subsection> |
17 | <subsection> |
|
|
18 | <include href="hb-install-blockdevices.xml"/> |
|
|
19 | </subsection> |
|
|
20 | |
| 44 | <subsection> |
21 | <subsection> |
| 45 | <title>Slices</title> |
22 | <title>Slices</title> |
| 46 | <body> |
23 | <body> |
| 47 | |
24 | |
| 48 | <p> |
25 | <p> |
| … | |
… | |
| 86 | |
63 | |
| 87 | |
64 | |
| 88 | <p> |
65 | <p> |
| 89 | If you are interested in knowing how big a partition should be, or even how |
66 | If you are interested in knowing how big a partition should be, or even how |
| 90 | many partitions (or volumes) you need, read on. Otherwise continue now with |
67 | many partitions (or volumes) you need, read on. Otherwise continue now with |
| 91 | <uri link="#fdisk">Using fdisk to Partition your Disk</uri>. |
68 | <uri link="#fdisk_SRM">Using fdisk to Partition your Disk (SRM only)</uri> |
|
|
69 | or <uri link="#fdisk_ARC">Using fdisk to Partition your Disk (ARC/AlphaBIOS |
|
|
70 | only)</uri>. |
| 92 | </p> |
71 | </p> |
| 93 | |
72 | |
| 94 | </body> |
73 | </body> |
| 95 | </subsection> |
74 | </subsection> |
| 96 | <subsection> |
75 | <subsection> |
| … | |
… | |
| 104 | If you are installing Gentoo to perform as a mailserver, your |
83 | If you are installing Gentoo to perform as a mailserver, your |
| 105 | <path>/var</path> should be separate as all mails are stored inside |
84 | <path>/var</path> should be separate as all mails are stored inside |
| 106 | <path>/var</path>. A good choice of filesystem will then maximise your |
85 | <path>/var</path>. A good choice of filesystem will then maximise your |
| 107 | performance. Gameservers will have a separate <path>/opt</path> as most gaming |
86 | performance. Gameservers will have a separate <path>/opt</path> as most gaming |
| 108 | servers are installed there. The reason is similar for <path>/home</path>: |
87 | servers are installed there. The reason is similar for <path>/home</path>: |
| 109 | security and backups. |
88 | security and backups. You will definitely want to keep <path>/usr</path> big: |
|
|
89 | not only will it contain the majority of applications, the Portage tree alone |
|
|
90 | takes around 500 Mbyte excluding the various sources that are stored in it. |
| 110 | </p> |
91 | </p> |
| 111 | |
92 | |
| 112 | <p> |
93 | <p> |
| 113 | As you can see, it very much depends on what you want to achieve. Separate |
94 | As you can see, it very much depends on what you want to achieve. Separate |
| 114 | partitions or volumes have the following advantages: |
95 | partitions or volumes have the following advantages: |
| … | |
… | |
| 132 | nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc. |
113 | nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc. |
| 133 | </li> |
114 | </li> |
| 134 | </ul> |
115 | </ul> |
| 135 | |
116 | |
| 136 | <p> |
117 | <p> |
| 137 | However, multiple partitions have one big disadvantage: if not configured |
118 | However, multiple partitions have disadvantages as well. If not configured |
| 138 | properly, you might result in having a system with lots |
119 | properly, you will have a system with lots of free space on one partition and |
| 139 | of free space on one partition and none on another. |
120 | none on another. Another nuisance is that separate partitions - especially |
|
|
121 | for important mountpoints like <path>/usr</path> or <path>/var</path> - often |
|
|
122 | require the administrator to boot with an initramfs to mount the partition |
|
|
123 | before other boot scripts start. This isn't always the case though, so YMMV. |
| 140 | </p> |
124 | </p> |
| 141 | |
125 | |
| 142 | </body> |
126 | </body> |
| 143 | </subsection> |
127 | </subsection> |
| 144 | </section> |
128 | </section> |
| 145 | <section id="fdisk"> |
129 | <section id="fdisk_SRM"> |
| 146 | <title>Using fdisk on Alpha to Partition your Disk</title> |
130 | <title>Using fdisk to Partition your Disk (SRM only)</title> |
| 147 | <subsection> |
131 | <subsection> |
| 148 | <body> |
132 | <body> |
| 149 | |
133 | |
| 150 | <p> |
134 | <p> |
| 151 | The following parts explain how to create the example slice layout described |
135 | The following parts explain how to create the example slice layout described |
| … | |
… | |
| 214 | <p> |
198 | <p> |
| 215 | If your hard drive is completely blank, then you'll have to first create |
199 | If your hard drive is completely blank, then you'll have to first create |
| 216 | a BSD disklabel. |
200 | a BSD disklabel. |
| 217 | </p> |
201 | </p> |
| 218 | |
202 | |
| 219 | <pre caption="Creating BSD disklabel"> |
203 | <pre caption="Creating a BSD disklabel"> |
| 220 | Command (m for help): <i>b</i> |
204 | Command (m for help): <i>b</i> |
| 221 | /dev/sda contains no disklabel. |
205 | /dev/sda contains no disklabel. |
| 222 | Do you want to create a disklabel? (y/n) <i>y</i> |
206 | Do you want to create a disklabel? (y/n) <i>y</i> |
| 223 | <comment>A bunch of drive-specific info will show here</comment> |
207 | <comment>A bunch of drive-specific info will show here</comment> |
| 224 | 3 partitions: |
208 | 3 partitions: |
| 225 | # start end size fstype [fsize bsize cpg] |
209 | # start end size fstype [fsize bsize cpg] |
| 226 | c: 1 5290* 5289* unused 0 0 |
210 | c: 1 5290* 5289* unused 0 0 |
| 227 | </pre> |
211 | </pre> |
| 228 | |
212 | |
| 229 | <p> |
213 | <p> |
| 230 | We start with deleting all slices <e>except</e> the 'c'-slice. The following |
214 | We start with deleting all slices <e>except</e> the 'c'-slice (a requirement |
| 231 | shows how to delete a slice (in the example we use 'a'). Repeat the process to |
215 | for using BSD disklabels). The following shows how to delete a slice (in |
| 232 | delete all other slices (again, except the 'c'-slice). |
216 | the example we use 'a'). Repeat the process to delete all other slices |
|
|
217 | (again, except the 'c'-slice). |
| 233 | </p> |
218 | </p> |
| 234 | |
219 | |
| 235 | <p> |
220 | <p> |
| 236 | Use <c>p</c> to view all existing slices. <c>d</c> is used to delete a slice. |
221 | Use <c>p</c> to view all existing slices. <c>d</c> is used to delete a slice. |
| 237 | </p> |
222 | </p> |
| … | |
… | |
| 272 | <subsection> |
257 | <subsection> |
| 273 | <title>Creating the Swap Slice</title> |
258 | <title>Creating the Swap Slice</title> |
| 274 | <body> |
259 | <body> |
| 275 | |
260 | |
| 276 | <p> |
261 | <p> |
| 277 | On Alpha based systems you don't need a separate boot partition. However, the |
262 | On Alpha based systems you don't need a separate boot slice. However, the |
| 278 | first cylinder cannot be used as the <c>aboot</c> image will be placed there. |
263 | first cylinder cannot be used as the <c>aboot</c> image will be placed there. |
| 279 | </p> |
264 | </p> |
| 280 | |
265 | |
| 281 | <p> |
266 | <p> |
| 282 | We will create a swap slice starting at the third cylinder, with a total |
267 | We will create a swap slice starting at the third cylinder, with a total |
| 283 | size of 1 Gbyte. Use <c>n</c> to create a new slice. After creating the slice, |
268 | size of 1 GB. Use <c>n</c> to create a new slice. After creating the slice, |
| 284 | we will change its type to <c>1</c> (one), meaning <e>swap</e>. |
269 | we will change its type to <c>1</c> (one), meaning <e>swap</e>. |
| 285 | </p> |
270 | </p> |
| 286 | |
271 | |
| 287 | <pre caption="Creating the swap slice"> |
272 | <pre caption="Creating the swap slice"> |
| 288 | BSD disklabel command (m for help): <i>n</i> |
273 | BSD disklabel command (m for help): <i>n</i> |
| … | |
… | |
| 315 | <body> |
300 | <body> |
| 316 | |
301 | |
| 317 | <p> |
302 | <p> |
| 318 | We will now create the root slice, starting from the first cylinder <e>after</e> |
303 | We will now create the root slice, starting from the first cylinder <e>after</e> |
| 319 | the swap slice. Use the <c>p</c> command to view where the swap slice ends. In |
304 | the swap slice. Use the <c>p</c> command to view where the swap slice ends. In |
| 320 | our example, this is at 1003, making the root partition start at 1004. |
305 | our example, this is at 1003, making the root slice start at 1004. |
| 321 | </p> |
306 | </p> |
| 322 | |
307 | |
| 323 | <p> |
308 | <p> |
| 324 | Another problem is that there is currently a bug in <c>fdisk</c> making it think |
309 | Another problem is that there is currently a bug in <c>fdisk</c> making it think |
| 325 | the number of available cylinders is one above the real number of cylinders. In |
310 | the number of available cylinders is one above the real number of cylinders. In |
| 326 | other words, when you are asked for the last cylinder, decrease the cylinder |
311 | other words, when you are asked for the last cylinder, decrease the cylinder |
| 327 | number (in this example: 5290) with one. |
312 | number (in this example: 5290) with one. |
| 328 | </p> |
313 | </p> |
| 329 | |
314 | |
| 330 | <p> |
315 | <p> |
| 331 | When the partition is created, we change the type to <c>8</c>, for <e>ext2</e>. |
316 | When the slice is created, we change the type to <c>8</c>, for <e>ext2</e>. |
| 332 | </p> |
317 | </p> |
| 333 | |
318 | |
| 334 | <pre caption="Creating the root slice"> |
319 | <pre caption="Creating the root slice"> |
| 335 | D disklabel command (m for help): <i>n</i> |
320 | D disklabel command (m for help): <i>n</i> |
| 336 | Partition (a-p): <i>b</i> |
321 | Partition (a-p): <i>b</i> |
| … | |
… | |
| 369 | <pre caption="Save and exit fdisk"> |
354 | <pre caption="Save and exit fdisk"> |
| 370 | Command (m for help): <i>w</i> |
355 | Command (m for help): <i>w</i> |
| 371 | </pre> |
356 | </pre> |
| 372 | |
357 | |
| 373 | <p> |
358 | <p> |
| 374 | Now that your slices are created, you can now continue with <uri |
359 | Now that your slices are created, you can continue with <uri |
|
|
360 | link="#filesystems">Creating Filesystems</uri>. |
|
|
361 | </p> |
|
|
362 | |
|
|
363 | </body> |
|
|
364 | </subsection> |
|
|
365 | </section> |
|
|
366 | <section id="fdisk_ARC"> |
|
|
367 | <title>Using fdisk to Partition your Disk (ARC/AlphaBIOS only)</title> |
|
|
368 | <subsection> |
|
|
369 | <body> |
|
|
370 | |
|
|
371 | <p> |
|
|
372 | The following parts explain how to partition the disk with a layout |
|
|
373 | similar to the one described previously, namely: |
|
|
374 | </p> |
|
|
375 | |
|
|
376 | <table> |
|
|
377 | <tr> |
|
|
378 | <th>Partition</th> |
|
|
379 | <th>Description</th> |
|
|
380 | </tr> |
|
|
381 | <tr> |
|
|
382 | <ti><path>/dev/sda1</path></ti> |
|
|
383 | <ti>Boot partition</ti> |
|
|
384 | </tr> |
|
|
385 | <tr> |
|
|
386 | <ti><path>/dev/sda2</path></ti> |
|
|
387 | <ti>Swap partition</ti> |
|
|
388 | </tr> |
|
|
389 | <tr> |
|
|
390 | <ti><path>/dev/sda3</path></ti> |
|
|
391 | <ti>Root partition</ti> |
|
|
392 | </tr> |
|
|
393 | </table> |
|
|
394 | |
|
|
395 | <p> |
|
|
396 | Change your partition layout according to your own preference. |
|
|
397 | </p> |
|
|
398 | |
|
|
399 | </body> |
|
|
400 | </subsection> |
|
|
401 | <subsection> |
|
|
402 | <title>Identifying Available Disks</title> |
|
|
403 | <body> |
|
|
404 | |
|
|
405 | <p> |
|
|
406 | To figure out what disks you have running, use the following commands: |
|
|
407 | </p> |
|
|
408 | |
|
|
409 | <pre caption="Identifying available disks"> |
|
|
410 | # <i>dmesg | grep 'drive$'</i> <comment>(For IDE disks)</comment> |
|
|
411 | # <i>dmesg | grep 'scsi'</i> <comment>(For SCSI disks)</comment> |
|
|
412 | </pre> |
|
|
413 | |
|
|
414 | <p> |
|
|
415 | From this output you should be able to see what disks were detected and their |
|
|
416 | respective <path>/dev</path> entry. In the following parts we assume that the |
|
|
417 | disk is a SCSI disk on <path>/dev/sda</path>. |
|
|
418 | </p> |
|
|
419 | |
|
|
420 | <p> |
|
|
421 | Now fire up <c>fdisk</c>: |
|
|
422 | </p> |
|
|
423 | |
|
|
424 | <pre caption="Starting fdisk"> |
|
|
425 | # <i>fdisk /dev/sda</i> |
|
|
426 | </pre> |
|
|
427 | |
|
|
428 | </body> |
|
|
429 | </subsection> |
|
|
430 | <subsection> |
|
|
431 | <title>Deleting All Partitions</title> |
|
|
432 | <body> |
|
|
433 | |
|
|
434 | <p> |
|
|
435 | If your hard drive is completely blank, then you'll have to first create |
|
|
436 | a DOS disklabel. |
|
|
437 | </p> |
|
|
438 | |
|
|
439 | <pre caption="Creating a DOS disklabel"> |
|
|
440 | Command (m for help): <i>o</i> |
|
|
441 | Building a new DOS disklabel. |
|
|
442 | </pre> |
|
|
443 | |
|
|
444 | <p> |
|
|
445 | We start with deleting all partitions. The following shows how to delete |
|
|
446 | a partition (in the example we use '1'). Repeat the process to delete all |
|
|
447 | other partitions. |
|
|
448 | </p> |
|
|
449 | |
|
|
450 | <p> |
|
|
451 | Use <c>p</c> to view all existing partitions. <c>d</c> is used to delete a |
|
|
452 | partition. |
|
|
453 | </p> |
|
|
454 | |
|
|
455 | <pre caption="Deleting a partition"> |
|
|
456 | command (m for help): <i>p</i> |
|
|
457 | |
|
|
458 | Disk /dev/sda: 9150 MB, 9150996480 bytes |
|
|
459 | 64 heads, 32 sectors/track, 8727 cylinders |
|
|
460 | Units = cylinders of 2048 * 512 = 1048576 bytes |
|
|
461 | |
|
|
462 | Device Boot Start End Blocks Id System |
|
|
463 | /dev/sda1 1 478 489456 83 Linux |
|
|
464 | /dev/sda2 479 8727 8446976 5 Extended |
|
|
465 | /dev/sda5 479 1433 977904 83 Linux Swap |
|
|
466 | /dev/sda6 1434 8727 7469040 83 Linux |
|
|
467 | |
|
|
468 | command (m for help): <i>d</i> |
|
|
469 | Partition number (1-6): <i>1</i> |
|
|
470 | </pre> |
|
|
471 | |
|
|
472 | |
|
|
473 | </body> |
|
|
474 | </subsection> |
|
|
475 | <subsection> |
|
|
476 | <title>Creating the Boot Partition</title> |
|
|
477 | <body> |
|
|
478 | |
|
|
479 | <p> |
|
|
480 | On Alpha systems which use MILO to boot, we have to create a small vfat |
|
|
481 | boot partition. |
|
|
482 | </p> |
|
|
483 | |
|
|
484 | <pre caption="Creating the boot partition"> |
|
|
485 | Command (m for help): <i>n</i> |
|
|
486 | Command action |
|
|
487 | e extended |
|
|
488 | p primary partition (1-4) |
|
|
489 | <i>p</i> |
|
|
490 | Partition number (1-4): <i>1</i> |
|
|
491 | First cylinder (1-8727, default 1): <i>1</i> |
|
|
492 | Last cylinder or +size or +sizeM or +sizeK (1-8727, default 8727): <i>+16M</i> |
|
|
493 | |
|
|
494 | Command (m for help): <i>t</i> |
|
|
495 | Selected partition 1 |
|
|
496 | Hex code (type L to list codes): <i>6</i> |
|
|
497 | Changed system type of partition 1 to 6 (FAT16) |
|
|
498 | </pre> |
|
|
499 | |
|
|
500 | </body> |
|
|
501 | </subsection> |
|
|
502 | <subsection> |
|
|
503 | <title>Creating the Swap Partition</title> |
|
|
504 | <body> |
|
|
505 | |
|
|
506 | <p> |
|
|
507 | We will create a swap partition with a total size of 1 GB. Use <c>n</c> to |
|
|
508 | create a new partition. |
|
|
509 | </p> |
|
|
510 | |
|
|
511 | <pre caption="Creating the swap partition"> |
|
|
512 | Command (m for help): <i>n</i> |
|
|
513 | Command action |
|
|
514 | e extended |
|
|
515 | p primary partition (1-4) |
|
|
516 | <i>p</i> |
|
|
517 | Partition number (1-4): <i>2</i> |
|
|
518 | First cylinder (17-8727, default 17): <i>17</i> |
|
|
519 | Last cylinder or +size or +sizeM or +sizeK (17-8727, default 8727): <i>+1000M</i> |
|
|
520 | |
|
|
521 | Command (m for help): <i>t</i> |
|
|
522 | Partition number (1-4): <i>2</i> |
|
|
523 | Hex code (type L to list codes): <i>82</i> |
|
|
524 | Changed system type of partition 2 to 82 (Linux swap) |
|
|
525 | </pre> |
|
|
526 | |
|
|
527 | <p> |
|
|
528 | After these steps you should see a layout similar to the following: |
|
|
529 | </p> |
|
|
530 | |
|
|
531 | <pre caption="Partition listing after creating a swap partition"> |
|
|
532 | Command (m for help): <i>p</i> |
|
|
533 | |
|
|
534 | Disk /dev/sda: 9150 MB, 9150996480 bytes |
|
|
535 | 64 heads, 32 sectors/track, 8727 cylinders |
|
|
536 | Units = cylinders of 2048 * 512 = 1048576 bytes |
|
|
537 | |
|
|
538 | Device Boot Start End Blocks Id System |
|
|
539 | /dev/sda1 1 16 16368 6 FAT16 |
|
|
540 | /dev/sda2 17 971 977920 82 Linux swap |
|
|
541 | </pre> |
|
|
542 | |
|
|
543 | </body> |
|
|
544 | </subsection> |
|
|
545 | <subsection> |
|
|
546 | <title>Creating the Root Partition</title> |
|
|
547 | <body> |
|
|
548 | |
|
|
549 | <p> |
|
|
550 | We will now create the root partition. Again, just use the <c>n</c> command. |
|
|
551 | </p> |
|
|
552 | |
|
|
553 | <pre caption="Creating the root partition"> |
|
|
554 | Command (m for help): <i>n</i> |
|
|
555 | Command action |
|
|
556 | e extended |
|
|
557 | p primary partition (1-4) |
|
|
558 | <i>p</i> |
|
|
559 | Partition number (1-4): <i>3</i> |
|
|
560 | First cylinder (972-8727, default 972): <i>972</i> |
|
|
561 | Last cylinder or +size or +sizeM or +sizeK (972-8727, default 8727): <i>8727</i> |
|
|
562 | </pre> |
|
|
563 | |
|
|
564 | <p> |
|
|
565 | After these steps you should see a layout similar to the following: |
|
|
566 | </p> |
|
|
567 | |
|
|
568 | <pre caption="Partition listing after creating the root partition"> |
|
|
569 | Command (m for help): <i>p</i> |
|
|
570 | |
|
|
571 | Disk /dev/sda: 9150 MB, 9150996480 bytes |
|
|
572 | 64 heads, 32 sectors/track, 8727 cylinders |
|
|
573 | Units = cylinders of 2048 * 512 = 1048576 bytes |
|
|
574 | |
|
|
575 | Device Boot Start End Blocks Id System |
|
|
576 | /dev/sda1 1 16 16368 6 FAT16 |
|
|
577 | /dev/sda2 17 971 977920 82 Linux swap |
|
|
578 | /dev/sda3 972 8727 7942144 83 Linux |
|
|
579 | </pre> |
|
|
580 | |
|
|
581 | </body> |
|
|
582 | </subsection> |
|
|
583 | <subsection> |
|
|
584 | <title>Save the Partition Layout and Exit</title> |
|
|
585 | <body> |
|
|
586 | |
|
|
587 | <p> |
|
|
588 | Save <c>fdisk</c> by typing <c>w</c>. This will also save your partition layout. |
|
|
589 | </p> |
|
|
590 | |
|
|
591 | <pre caption="Save and exit fdisk"> |
|
|
592 | Command (m for help): <i>w</i> |
|
|
593 | </pre> |
|
|
594 | |
|
|
595 | <p> |
|
|
596 | Now that your partitions are created, you can continue with <uri |
| 375 | link="#filesystems">Creating Filesystems</uri>. |
597 | link="#filesystems">Creating Filesystems</uri>. |
| 376 | </p> |
598 | </p> |
| 377 | |
599 | |
| 378 | </body> |
600 | </body> |
| 379 | </subsection> |
601 | </subsection> |
| … | |
… | |
| 392 | Otherwise read on to learn about the available filesystems... |
614 | Otherwise read on to learn about the available filesystems... |
| 393 | </p> |
615 | </p> |
| 394 | |
616 | |
| 395 | </body> |
617 | </body> |
| 396 | </subsection> |
618 | </subsection> |
| 397 | <subsection> |
|
|
| 398 | <title>Filesystems?</title> |
|
|
| 399 | <body> |
|
|
| 400 | |
619 | |
| 401 | <p> |
|
|
| 402 | Several filesystems are available. Most of them are found stable on the |
|
|
| 403 | Alpha architecture. |
|
|
| 404 | </p> |
|
|
| 405 | |
|
|
| 406 | <p> |
|
|
| 407 | <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata |
|
|
| 408 | journaling, which means that routine ext2 filesystem checks at startup time can |
|
|
| 409 | be quite time-consuming. There is now quite a selection of newer-generation |
|
|
| 410 | journaled filesystems that can be checked for consistency very quickly and are |
|
|
| 411 | thus generally preferred over their non-journaled counterparts. Journaled |
|
|
| 412 | filesystems prevent long delays when you boot your system and your filesystem |
|
|
| 413 | happens to be in an inconsistent state. |
|
|
| 414 | </p> |
|
|
| 415 | |
|
|
| 416 | <p> |
|
|
| 417 | <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata |
|
|
| 418 | journaling for fast recovery in addition to other enhanced journaling modes like |
|
|
| 419 | full data and ordered data journaling. ext3 is a very good and reliable |
|
|
| 420 | filesystem. It has an additional hashed b-tree indexing option that enables |
|
|
| 421 | high performance in almost all situations. In short, ext3 is an excellent |
|
|
| 422 | filesystem. |
|
|
| 423 | </p> |
|
|
| 424 | |
|
|
| 425 | <p> |
|
|
| 426 | <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall |
|
|
| 427 | performance and greatly outperforms both ext2 and ext3 when dealing with small |
|
|
| 428 | files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales |
|
|
| 429 | extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is |
|
|
| 430 | solid and usable as both general-purpose filesystem and for extreme cases such |
|
|
| 431 | as the creation of large filesystems, the use of many small files, very large |
|
|
| 432 | files and directories containing tens of thousands of files. |
|
|
| 433 | </p> |
|
|
| 434 | |
|
|
| 435 | <p> |
|
|
| 436 | <b>XFS</b> is a filesystem with metadata journaling which comes with a robust |
|
|
| 437 | feature-set and is optimized for scalability. We only recommend using this |
|
|
| 438 | filesystem on Linux systems with high-end SCSI and/or fibre channel storage and |
|
|
| 439 | an uninterruptible power supply. Because XFS aggressively caches in-transit data |
|
|
| 440 | in RAM, improperly designed programs (those that don't take proper precautions |
|
|
| 441 | when writing files to disk and there are quite a few of them) can lose a good |
|
|
| 442 | deal of data if the system goes down unexpectedly. |
|
|
| 443 | </p> |
|
|
| 444 | |
|
|
| 445 | <p> |
|
|
| 446 | <b>JFS</b> is IBM's high-performance journaling filesystem. It has recently |
|
|
| 447 | become production-ready and there hasn't been a sufficient track record to |
|
|
| 448 | comment positively nor negatively on its general stability at this point. |
|
|
| 449 | </p> |
|
|
| 450 | |
|
|
| 451 | </body> |
|
|
| 452 | </subsection> |
620 | <subsection> |
|
|
621 | <include href="hb-install-filesystems.xml"/> |
|
|
622 | </subsection> |
|
|
623 | |
| 453 | <subsection id="filesystems-apply"> |
624 | <subsection id="filesystems-apply"> |
| 454 | <title>Applying a Filesystem to a Partition</title> |
625 | <title>Applying a Filesystem to a Partition</title> |
| 455 | <body> |
626 | <body> |
| 456 | |
627 | |
| 457 | <p> |
628 | <p> |
| … | |
… | |
| 464 | <th>Filesystem</th> |
635 | <th>Filesystem</th> |
| 465 | <th>Creation Command</th> |
636 | <th>Creation Command</th> |
| 466 | </tr> |
637 | </tr> |
| 467 | <tr> |
638 | <tr> |
| 468 | <ti>ext2</ti> |
639 | <ti>ext2</ti> |
| 469 | <ti><c>mke2fs</c></ti> |
640 | <ti><c>mkfs.ext2</c></ti> |
| 470 | </tr> |
641 | </tr> |
| 471 | <tr> |
642 | <tr> |
| 472 | <ti>ext3</ti> |
643 | <ti>ext3</ti> |
| 473 | <ti><c>mke2fs -j</c></ti> |
644 | <ti><c>mkfs.ext3</c></ti> |
|
|
645 | </tr> |
|
|
646 | <tr> |
|
|
647 | <ti>ext4</ti> |
|
|
648 | <ti><c>mkfs.ext4</c></ti> |
| 474 | </tr> |
649 | </tr> |
| 475 | <tr> |
650 | <tr> |
| 476 | <ti>reiserfs</ti> |
651 | <ti>reiserfs</ti> |
| 477 | <ti><c>mkreiserfs</c></ti> |
652 | <ti><c>mkfs.reiserfs</c></ti> |
| 478 | </tr> |
653 | </tr> |
| 479 | <tr> |
654 | <tr> |
| 480 | <ti>xfs</ti> |
655 | <ti>xfs</ti> |
| 481 | <ti><c>mkfs.xfs</c></ti> |
656 | <ti><c>mkfs.xfs</c></ti> |
| 482 | </tr> |
657 | </tr> |
| … | |
… | |
| 490 | For instance, to have the root partition (<path>/dev/sda2</path> in our example) |
665 | For instance, to have the root partition (<path>/dev/sda2</path> in our example) |
| 491 | in ext3, you would use: |
666 | in ext3, you would use: |
| 492 | </p> |
667 | </p> |
| 493 | |
668 | |
| 494 | <pre caption="Applying a filesystem on a partition"> |
669 | <pre caption="Applying a filesystem on a partition"> |
| 495 | # <i>mke2fs -j /dev/sda2</i> |
670 | # <i>mkfs.ext3 /dev/sda2</i> |
| 496 | </pre> |
671 | </pre> |
| 497 | |
672 | |
| 498 | <p> |
673 | <p> |
| 499 | Now create the filesystems on your newly created partitions (or logical |
674 | Now create the filesystems on your newly created partitions (or logical |
| 500 | volumes). |
675 | volumes). |
| … | |
… | |
| 521 | <pre caption="Activating the swap partition"> |
696 | <pre caption="Activating the swap partition"> |
| 522 | # <i>swapon /dev/sda1</i> |
697 | # <i>swapon /dev/sda1</i> |
| 523 | </pre> |
698 | </pre> |
| 524 | |
699 | |
| 525 | <p> |
700 | <p> |
| 526 | Create and activate the swap now. |
701 | Create and activate the swap with the commands mentioned above. |
| 527 | </p> |
702 | </p> |
| 528 | |
703 | |
| 529 | </body> |
704 | </body> |
| 530 | </subsection> |
705 | </subsection> |
| 531 | </section> |
706 | </section> |
| … | |
… | |
| 535 | |
710 | |
| 536 | <p> |
711 | <p> |
| 537 | Now that your partitions are initialized and are housing a filesystem, it is |
712 | Now that your partitions are initialized and are housing a filesystem, it is |
| 538 | time to mount those partitions. Use the <c>mount</c> command. Don't forget to |
713 | time to mount those partitions. Use the <c>mount</c> command. Don't forget to |
| 539 | create the necessary mount directories for every partition you created. As an |
714 | create the necessary mount directories for every partition you created. As an |
| 540 | example we mount the root and boot partition: |
715 | example we mount the root partition: |
| 541 | </p> |
716 | </p> |
| 542 | |
717 | |
| 543 | <pre caption="Mounting partitions"> |
718 | <pre caption="Mounting partitions"> |
| 544 | # <i>mount /dev/sda2 /mnt/gentoo</i> |
719 | # <i>mount /dev/sda2 /mnt/gentoo</i> |
| 545 | </pre> |
720 | </pre> |