| 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.3 2004/07/16 09:37:11 neysx Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-alpha-disk.xml,v 1.30 2009/02/15 06:48:11 rane Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
|
|
10 | |
|
|
11 | <version>9.1</version> |
|
|
12 | <date>2009-02-15</date> |
|
|
13 | |
| 10 | <section> |
14 | <section> |
| 11 | <title>Introduction to Block Devices</title> |
15 | <title>Introduction to Block Devices</title> |
| 12 | <subsection> |
|
|
| 13 | <title>Block Devices</title> |
|
|
| 14 | <body> |
|
|
| 15 | |
16 | |
| 16 | <p> |
|
|
| 17 | We'll take a good look at disk-oriented aspects of Gentoo Linux |
|
|
| 18 | and Linux in general, including Linux filesystems, partitions and block devices. |
|
|
| 19 | Then, once you're familiar with the ins and outs of disks and filesystems, |
|
|
| 20 | you'll be guided through the process of setting up partitions and filesystems |
|
|
| 21 | for your Gentoo Linux installation. |
|
|
| 22 | </p> |
|
|
| 23 | |
|
|
| 24 | <p> |
|
|
| 25 | To begin, we'll introduce <e>block devices</e>. The most famous block device is |
|
|
| 26 | probably the one that represents the first SCSI HD in a Linux system, namely |
|
|
| 27 | <path>/dev/sda</path>. |
|
|
| 28 | </p> |
|
|
| 29 | |
|
|
| 30 | <p> |
|
|
| 31 | The block devices above represent an abstract interface to the disk. User |
|
|
| 32 | programs can use these block devices to interact with your disk without worrying |
|
|
| 33 | about whether your drives are IDE, SCSI or something else. The program can |
|
|
| 34 | simply address the storage on the disk as a bunch of contiguous, |
|
|
| 35 | randomly-accessible 512-byte blocks. |
|
|
| 36 | </p> |
|
|
| 37 | |
|
|
| 38 | </body> |
|
|
| 39 | </subsection> |
17 | <subsection> |
|
|
18 | <include href="hb-install-blockdevices.xml"/> |
|
|
19 | </subsection> |
|
|
20 | |
| 40 | <subsection> |
21 | <subsection> |
| 41 | <title>Slices</title> |
22 | <title>Slices</title> |
| 42 | <body> |
23 | <body> |
| 43 | |
24 | |
| 44 | <p> |
25 | <p> |
| … | |
… | |
| 65 | <tr> |
46 | <tr> |
| 66 | <th>Slice</th> |
47 | <th>Slice</th> |
| 67 | <th>Description</th> |
48 | <th>Description</th> |
| 68 | </tr> |
49 | </tr> |
| 69 | <tr> |
50 | <tr> |
| 70 | <ti><path>/dev/sdaa</path></ti> |
51 | <ti><path>/dev/sda1</path></ti> |
| 71 | <ti>Swap slice</ti> |
52 | <ti>Swap slice</ti> |
| 72 | </tr> |
53 | </tr> |
| 73 | <tr> |
54 | <tr> |
| 74 | <ti><path>/dev/sdab</path></ti> |
55 | <ti><path>/dev/sda2</path></ti> |
| 75 | <ti>Root slice</ti> |
56 | <ti>Root slice</ti> |
| 76 | </tr> |
57 | </tr> |
| 77 | <tr> |
58 | <tr> |
| 78 | <ti><path>/dev/sdac</path></ti> |
59 | <ti><path>/dev/sda3</path></ti> |
| 79 | <ti>Full disk (required)</ti> |
60 | <ti>Full disk (required)</ti> |
| 80 | </tr> |
61 | </tr> |
| 81 | </table> |
62 | </table> |
| 82 | |
63 | |
| 83 | |
64 | |
| 84 | <p> |
65 | <p> |
| 85 | 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 |
| 86 | 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 |
| 87 | <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>. |
| 88 | </p> |
71 | </p> |
| 89 | |
72 | |
| 90 | </body> |
73 | </body> |
| 91 | </subsection> |
74 | </subsection> |
| 92 | <subsection> |
75 | <subsection> |
| … | |
… | |
| 100 | If you are installing Gentoo to perform as a mailserver, your |
83 | If you are installing Gentoo to perform as a mailserver, your |
| 101 | <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 |
| 102 | <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 |
| 103 | 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 |
| 104 | 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>: |
| 105 | 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. |
| 106 | </p> |
91 | </p> |
| 107 | |
92 | |
| 108 | <p> |
93 | <p> |
| 109 | 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 |
| 110 | partitions or volumes have the following advantages: |
95 | partitions or volumes have the following advantages: |
| … | |
… | |
| 136 | </p> |
121 | </p> |
| 137 | |
122 | |
| 138 | </body> |
123 | </body> |
| 139 | </subsection> |
124 | </subsection> |
| 140 | </section> |
125 | </section> |
| 141 | <section id="fdisk"> |
126 | <section id="fdisk_SRM"> |
| 142 | <title>Using fdisk on Alpha to Partition your Disk</title> |
127 | <title>Using fdisk to Partition your Disk (SRM only)</title> |
| 143 | <subsection> |
128 | <subsection> |
| 144 | <body> |
129 | <body> |
| 145 | |
130 | |
| 146 | <p> |
131 | <p> |
| 147 | The following parts explain how to create the example slice layout described |
132 | The following parts explain how to create the example slice layout described |
| … | |
… | |
| 152 | <tr> |
137 | <tr> |
| 153 | <th>Slice</th> |
138 | <th>Slice</th> |
| 154 | <th>Description</th> |
139 | <th>Description</th> |
| 155 | </tr> |
140 | </tr> |
| 156 | <tr> |
141 | <tr> |
| 157 | <ti><path>/dev/sdaa</path></ti> |
142 | <ti><path>/dev/sda1</path></ti> |
| 158 | <ti>Swap slice</ti> |
143 | <ti>Swap slice</ti> |
| 159 | </tr> |
144 | </tr> |
| 160 | <tr> |
145 | <tr> |
| 161 | <ti><path>/dev/sdab</path></ti> |
146 | <ti><path>/dev/sda2</path></ti> |
| 162 | <ti>Root slice</ti> |
147 | <ti>Root slice</ti> |
| 163 | </tr> |
148 | </tr> |
| 164 | <tr> |
149 | <tr> |
| 165 | <ti><path>/dev/sdac</path></ti> |
150 | <ti><path>/dev/sda3</path></ti> |
| 166 | <ti>Full disk (required)</ti> |
151 | <ti>Full disk (required)</ti> |
| 167 | </tr> |
152 | </tr> |
| 168 | </table> |
153 | </table> |
| 169 | |
154 | |
| 170 | <p> |
155 | <p> |
| 171 | Change your slice layout according to your own will. |
156 | Change your slice layout according to your own preference. |
| 172 | </p> |
157 | </p> |
| 173 | |
158 | |
| 174 | |
159 | |
| 175 | </body> |
160 | </body> |
| 176 | </subsection> |
161 | </subsection> |
| … | |
… | |
| 181 | <p> |
166 | <p> |
| 182 | To figure out what disks you have running, use the following commands: |
167 | To figure out what disks you have running, use the following commands: |
| 183 | </p> |
168 | </p> |
| 184 | |
169 | |
| 185 | <pre caption="Identifying available disks"> |
170 | <pre caption="Identifying available disks"> |
| 186 | <comment>(For IDE disks)</comment> # <i>dmesg | grep 'drive$'</i> |
171 | # <i>dmesg | grep 'drive$'</i> <comment>(For IDE disks)</comment> |
| 187 | <comment>(For SCSI disks)</comment> # <i>dmesg | grep 'scsi'</i> |
172 | # <i>dmesg | grep 'scsi'</i> <comment>(For SCSI disks)</comment> |
| 188 | </pre> |
173 | </pre> |
| 189 | |
174 | |
| 190 | <p> |
175 | <p> |
| 191 | From this output you should be able to see what disks were detected and their |
176 | From this output you should be able to see what disks were detected and their |
| 192 | respective <path>/dev</path> entry. In the following parts we assume that the |
177 | respective <path>/dev</path> entry. In the following parts we assume that the |
| … | |
… | |
| 206 | <subsection> |
191 | <subsection> |
| 207 | <title>Deleting All Slices</title> |
192 | <title>Deleting All Slices</title> |
| 208 | <body> |
193 | <body> |
| 209 | |
194 | |
| 210 | <p> |
195 | <p> |
|
|
196 | If your hard drive is completely blank, then you'll have to first create |
|
|
197 | a BSD disklabel. |
|
|
198 | </p> |
|
|
199 | |
|
|
200 | <pre caption="Creating a BSD disklabel"> |
|
|
201 | Command (m for help): <i>b</i> |
|
|
202 | /dev/sda contains no disklabel. |
|
|
203 | Do you want to create a disklabel? (y/n) <i>y</i> |
|
|
204 | <comment>A bunch of drive-specific info will show here</comment> |
|
|
205 | 3 partitions: |
|
|
206 | # start end size fstype [fsize bsize cpg] |
|
|
207 | c: 1 5290* 5289* unused 0 0 |
|
|
208 | </pre> |
|
|
209 | |
|
|
210 | <p> |
| 211 | We start with deleting all slices <e>except</e> the 'c'-slice. The following |
211 | We start with deleting all slices <e>except</e> the 'c'-slice (a requirement |
| 212 | shows how to delete a slice (in the example we use 'a'). Repeat the process to |
212 | for using BSD disklabels). The following shows how to delete a slice (in |
| 213 | delete all other slices (again, except the 'c'-slice). |
213 | the example we use 'a'). Repeat the process to delete all other slices |
|
|
214 | (again, except the 'c'-slice). |
| 214 | </p> |
215 | </p> |
| 215 | |
216 | |
| 216 | <p> |
217 | <p> |
| 217 | Use <c>p</c> to view all existing slices. <c>d</c> is used to delete a slice. |
218 | Use <c>p</c> to view all existing slices. <c>d</c> is used to delete a slice. |
| 218 | </p> |
219 | </p> |
| … | |
… | |
| 253 | <subsection> |
254 | <subsection> |
| 254 | <title>Creating the Swap Slice</title> |
255 | <title>Creating the Swap Slice</title> |
| 255 | <body> |
256 | <body> |
| 256 | |
257 | |
| 257 | <p> |
258 | <p> |
| 258 | On Alpha based systems you don't need a separate boot partition. However, the |
259 | On Alpha based systems you don't need a separate boot slice. However, the |
| 259 | first cylinder cannot be used as the <c>aboot</c> image will be placed there. |
260 | first cylinder cannot be used as the <c>aboot</c> image will be placed there. |
| 260 | </p> |
261 | </p> |
| 261 | |
262 | |
| 262 | <p> |
263 | <p> |
| 263 | We will create a swap slice starting at the third cylinder, with a total |
264 | We will create a swap slice starting at the third cylinder, with a total |
| 264 | size of 1 Gbyte. Use <c>n</c> to create a new slice. After creating the slice, |
265 | size of 1 GB. Use <c>n</c> to create a new slice. After creating the slice, |
| 265 | we will change its type to <c>1</c>, meaning <e>swap</e>. |
266 | we will change its type to <c>1</c> (one), meaning <e>swap</e>. |
| 266 | </p> |
267 | </p> |
| 267 | |
268 | |
| 268 | <pre caption="Creating the swap slice"> |
269 | <pre caption="Creating the swap slice"> |
| 269 | BSD disklabel command (m for help): <i>n</i> |
270 | BSD disklabel command (m for help): <i>n</i> |
| 270 | Partition (a-p): <i>a</i> |
271 | Partition (a-p): <i>a</i> |
| … | |
… | |
| 296 | <body> |
297 | <body> |
| 297 | |
298 | |
| 298 | <p> |
299 | <p> |
| 299 | We will now create the root slice, starting from the first cylinder <e>after</e> |
300 | We will now create the root slice, starting from the first cylinder <e>after</e> |
| 300 | the swap slice. Use the <c>p</c> command to view where the swap slice ends. In |
301 | the swap slice. Use the <c>p</c> command to view where the swap slice ends. In |
| 301 | our example, this is at 1003, making the root partition start at 1004. |
302 | our example, this is at 1003, making the root slice start at 1004. |
| 302 | </p> |
303 | </p> |
| 303 | |
304 | |
| 304 | <p> |
305 | <p> |
| 305 | Another problem is that there is currently a bug in <c>fdisk</c> making it think |
306 | Another problem is that there is currently a bug in <c>fdisk</c> making it think |
| 306 | the number of available cylinders is one above the real number of cylinders. In |
307 | the number of available cylinders is one above the real number of cylinders. In |
| 307 | other words, when you are asked for the last cylinder, decrease the cylinder |
308 | other words, when you are asked for the last cylinder, decrease the cylinder |
| 308 | number (in this example: 5290) with one. |
309 | number (in this example: 5290) with one. |
| 309 | </p> |
310 | </p> |
| 310 | |
311 | |
| 311 | <p> |
312 | <p> |
| 312 | When the partition is created, we change the type to <c>8</c>, for <e>ext2</e>. |
313 | When the slice is created, we change the type to <c>8</c>, for <e>ext2</e>. |
| 313 | </p> |
314 | </p> |
| 314 | |
315 | |
| 315 | <pre caption="Creating the root slice"> |
316 | <pre caption="Creating the root slice"> |
| 316 | D disklabel command (m for help): <i>n</i> |
317 | D disklabel command (m for help): <i>n</i> |
| 317 | Partition (a-p): <i>b</i> |
318 | Partition (a-p): <i>b</i> |
| … | |
… | |
| 350 | <pre caption="Save and exit fdisk"> |
351 | <pre caption="Save and exit fdisk"> |
| 351 | Command (m for help): <i>w</i> |
352 | Command (m for help): <i>w</i> |
| 352 | </pre> |
353 | </pre> |
| 353 | |
354 | |
| 354 | <p> |
355 | <p> |
| 355 | Now that your slices are created, you can now continue with <uri |
356 | Now that your slices are created, you can continue with <uri |
|
|
357 | link="#filesystems">Creating Filesystems</uri>. |
|
|
358 | </p> |
|
|
359 | |
|
|
360 | </body> |
|
|
361 | </subsection> |
|
|
362 | </section> |
|
|
363 | <section id="fdisk_ARC"> |
|
|
364 | <title>Using fdisk to Partition your Disk (ARC/AlphaBIOS only)</title> |
|
|
365 | <subsection> |
|
|
366 | <body> |
|
|
367 | |
|
|
368 | <p> |
|
|
369 | The following parts explain how to partition the disk with a layout |
|
|
370 | similar to the one described previously, namely: |
|
|
371 | </p> |
|
|
372 | |
|
|
373 | <table> |
|
|
374 | <tr> |
|
|
375 | <th>Partition</th> |
|
|
376 | <th>Description</th> |
|
|
377 | </tr> |
|
|
378 | <tr> |
|
|
379 | <ti><path>/dev/sda1</path></ti> |
|
|
380 | <ti>Boot partition</ti> |
|
|
381 | </tr> |
|
|
382 | <tr> |
|
|
383 | <ti><path>/dev/sda2</path></ti> |
|
|
384 | <ti>Swap partition</ti> |
|
|
385 | </tr> |
|
|
386 | <tr> |
|
|
387 | <ti><path>/dev/sda3</path></ti> |
|
|
388 | <ti>Root partition</ti> |
|
|
389 | </tr> |
|
|
390 | </table> |
|
|
391 | |
|
|
392 | <p> |
|
|
393 | Change your partition layout according to your own preference. |
|
|
394 | </p> |
|
|
395 | |
|
|
396 | </body> |
|
|
397 | </subsection> |
|
|
398 | <subsection> |
|
|
399 | <title>Identifying Available Disks</title> |
|
|
400 | <body> |
|
|
401 | |
|
|
402 | <p> |
|
|
403 | To figure out what disks you have running, use the following commands: |
|
|
404 | </p> |
|
|
405 | |
|
|
406 | <pre caption="Identifying available disks"> |
|
|
407 | # <i>dmesg | grep 'drive$'</i> <comment>(For IDE disks)</comment> |
|
|
408 | # <i>dmesg | grep 'scsi'</i> <comment>(For SCSI disks)</comment> |
|
|
409 | </pre> |
|
|
410 | |
|
|
411 | <p> |
|
|
412 | From this output you should be able to see what disks were detected and their |
|
|
413 | respective <path>/dev</path> entry. In the following parts we assume that the |
|
|
414 | disk is a SCSI disk on <path>/dev/sda</path>. |
|
|
415 | </p> |
|
|
416 | |
|
|
417 | <p> |
|
|
418 | Now fire up <c>fdisk</c>: |
|
|
419 | </p> |
|
|
420 | |
|
|
421 | <pre caption="Starting fdisk"> |
|
|
422 | # <i>fdisk /dev/sda</i> |
|
|
423 | </pre> |
|
|
424 | |
|
|
425 | </body> |
|
|
426 | </subsection> |
|
|
427 | <subsection> |
|
|
428 | <title>Deleting All Partitions</title> |
|
|
429 | <body> |
|
|
430 | |
|
|
431 | <p> |
|
|
432 | If your hard drive is completely blank, then you'll have to first create |
|
|
433 | a DOS disklabel. |
|
|
434 | </p> |
|
|
435 | |
|
|
436 | <pre caption="Creating a DOS disklabel"> |
|
|
437 | Command (m for help): <i>o</i> |
|
|
438 | Building a new DOS disklabel. |
|
|
439 | </pre> |
|
|
440 | |
|
|
441 | <p> |
|
|
442 | We start with deleting all partitions. The following shows how to delete |
|
|
443 | a partition (in the example we use '1'). Repeat the process to delete all |
|
|
444 | other partitions. |
|
|
445 | </p> |
|
|
446 | |
|
|
447 | <p> |
|
|
448 | Use <c>p</c> to view all existing partitions. <c>d</c> is used to delete a |
|
|
449 | partition. |
|
|
450 | </p> |
|
|
451 | |
|
|
452 | <pre caption="Deleting a partition"> |
|
|
453 | command (m for help): <i>p</i> |
|
|
454 | |
|
|
455 | Disk /dev/sda: 9150 MB, 9150996480 bytes |
|
|
456 | 64 heads, 32 sectors/track, 8727 cylinders |
|
|
457 | Units = cylinders of 2048 * 512 = 1048576 bytes |
|
|
458 | |
|
|
459 | Device Boot Start End Blocks Id System |
|
|
460 | /dev/sda1 1 478 489456 83 Linux |
|
|
461 | /dev/sda2 479 8727 8446976 5 Extended |
|
|
462 | /dev/sda5 479 1433 977904 83 Linux Swap |
|
|
463 | /dev/sda6 1434 8727 7469040 83 Linux |
|
|
464 | |
|
|
465 | command (m for help): <i>d</i> |
|
|
466 | Partition number (1-6): <i>1</i> |
|
|
467 | </pre> |
|
|
468 | |
|
|
469 | |
|
|
470 | </body> |
|
|
471 | </subsection> |
|
|
472 | <subsection> |
|
|
473 | <title>Creating the Boot Partition</title> |
|
|
474 | <body> |
|
|
475 | |
|
|
476 | <p> |
|
|
477 | On Alpha systems which use MILO to boot, we have to create a small vfat |
|
|
478 | boot partition. |
|
|
479 | </p> |
|
|
480 | |
|
|
481 | <pre caption="Creating the boot partition"> |
|
|
482 | Command (m for help): <i>n</i> |
|
|
483 | Command action |
|
|
484 | e extended |
|
|
485 | p primary partition (1-4) |
|
|
486 | <i>p</i> |
|
|
487 | Partition number (1-4): <i>1</i> |
|
|
488 | First cylinder (1-8727, default 1): <i>1</i> |
|
|
489 | Last cylinder or +size or +sizeM or +sizeK (1-8727, default 8727): <i>+16M</i> |
|
|
490 | |
|
|
491 | Command (m for help): <i>t</i> |
|
|
492 | Selected partition 1 |
|
|
493 | Hex code (type L to list codes): <i>6</i> |
|
|
494 | Changed system type of partition 1 to 6 (FAT16) |
|
|
495 | </pre> |
|
|
496 | |
|
|
497 | </body> |
|
|
498 | </subsection> |
|
|
499 | <subsection> |
|
|
500 | <title>Creating the Swap Partition</title> |
|
|
501 | <body> |
|
|
502 | |
|
|
503 | <p> |
|
|
504 | We will create a swap partition with a total size of 1 GB. Use <c>n</c> to |
|
|
505 | create a new partition. |
|
|
506 | </p> |
|
|
507 | |
|
|
508 | <pre caption="Creating the swap partition"> |
|
|
509 | Command (m for help): <i>n</i> |
|
|
510 | Command action |
|
|
511 | e extended |
|
|
512 | p primary partition (1-4) |
|
|
513 | <i>p</i> |
|
|
514 | Partition number (1-4): <i>2</i> |
|
|
515 | First cylinder (17-8727, default 17): <i>17</i> |
|
|
516 | Last cylinder or +size or +sizeM or +sizeK (17-8727, default 8727): <i>+1000M</i> |
|
|
517 | |
|
|
518 | Command (m for help): <i>t</i> |
|
|
519 | Partition number (1-4): <i>2</i> |
|
|
520 | Hex code (type L to list codes): <i>82</i> |
|
|
521 | Changed system type of partition 2 to 82 (Linux swap) |
|
|
522 | </pre> |
|
|
523 | |
|
|
524 | <p> |
|
|
525 | After these steps you should see a layout similar to the following: |
|
|
526 | </p> |
|
|
527 | |
|
|
528 | <pre caption="Partition listing after creating a swap partition"> |
|
|
529 | Command (m for help): <i>p</i> |
|
|
530 | |
|
|
531 | Disk /dev/sda: 9150 MB, 9150996480 bytes |
|
|
532 | 64 heads, 32 sectors/track, 8727 cylinders |
|
|
533 | Units = cylinders of 2048 * 512 = 1048576 bytes |
|
|
534 | |
|
|
535 | Device Boot Start End Blocks Id System |
|
|
536 | /dev/sda1 1 16 16368 6 FAT16 |
|
|
537 | /dev/sda2 17 971 977920 82 Linux swap |
|
|
538 | </pre> |
|
|
539 | |
|
|
540 | </body> |
|
|
541 | </subsection> |
|
|
542 | <subsection> |
|
|
543 | <title>Creating the Root Partition</title> |
|
|
544 | <body> |
|
|
545 | |
|
|
546 | <p> |
|
|
547 | We will now create the root partition. Again, just use the <c>n</c> command. |
|
|
548 | </p> |
|
|
549 | |
|
|
550 | <pre caption="Creating the root partition"> |
|
|
551 | Command (m for help): <i>n</i> |
|
|
552 | Command action |
|
|
553 | e extended |
|
|
554 | p primary partition (1-4) |
|
|
555 | <i>p</i> |
|
|
556 | Partition number (1-4): <i>3</i> |
|
|
557 | First cylinder (972-8727, default 972): <i>972</i> |
|
|
558 | Last cylinder or +size or +sizeM or +sizeK (972-8727, default 8727): <i>8727</i> |
|
|
559 | </pre> |
|
|
560 | |
|
|
561 | <p> |
|
|
562 | After these steps you should see a layout similar to the following: |
|
|
563 | </p> |
|
|
564 | |
|
|
565 | <pre caption="Partition listing after creating the root partition"> |
|
|
566 | Command (m for help): <i>p</i> |
|
|
567 | |
|
|
568 | Disk /dev/sda: 9150 MB, 9150996480 bytes |
|
|
569 | 64 heads, 32 sectors/track, 8727 cylinders |
|
|
570 | Units = cylinders of 2048 * 512 = 1048576 bytes |
|
|
571 | |
|
|
572 | Device Boot Start End Blocks Id System |
|
|
573 | /dev/sda1 1 16 16368 6 FAT16 |
|
|
574 | /dev/sda2 17 971 977920 82 Linux swap |
|
|
575 | /dev/sda3 972 8727 7942144 83 Linux |
|
|
576 | </pre> |
|
|
577 | |
|
|
578 | </body> |
|
|
579 | </subsection> |
|
|
580 | <subsection> |
|
|
581 | <title>Save the Partition Layout and Exit</title> |
|
|
582 | <body> |
|
|
583 | |
|
|
584 | <p> |
|
|
585 | Save <c>fdisk</c> by typing <c>w</c>. This will also save your partition layout. |
|
|
586 | </p> |
|
|
587 | |
|
|
588 | <pre caption="Save and exit fdisk"> |
|
|
589 | Command (m for help): <i>w</i> |
|
|
590 | </pre> |
|
|
591 | |
|
|
592 | <p> |
|
|
593 | Now that your partitions are created, you can continue with <uri |
| 356 | link="#filesystems">Creating Filesystems</uri>. |
594 | link="#filesystems">Creating Filesystems</uri>. |
| 357 | </p> |
595 | </p> |
| 358 | |
596 | |
| 359 | </body> |
597 | </body> |
| 360 | </subsection> |
598 | </subsection> |
| … | |
… | |
| 373 | Otherwise read on to learn about the available filesystems... |
611 | Otherwise read on to learn about the available filesystems... |
| 374 | </p> |
612 | </p> |
| 375 | |
613 | |
| 376 | </body> |
614 | </body> |
| 377 | </subsection> |
615 | </subsection> |
| 378 | <subsection> |
|
|
| 379 | <title>Filesystems?</title> |
|
|
| 380 | <body> |
|
|
| 381 | |
616 | |
| 382 | <p> |
|
|
| 383 | Several filesystems are available. Most of them are found stable on the |
|
|
| 384 | Alpha architecture. |
|
|
| 385 | </p> |
|
|
| 386 | |
|
|
| 387 | <p> |
|
|
| 388 | <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata |
|
|
| 389 | journaling, which means that routine ext2 filesystem checks at startup time can |
|
|
| 390 | be quite time-consuming. There is now quite a selection of newer-generation |
|
|
| 391 | journaled filesystems that can be checked for consistency very quickly and are |
|
|
| 392 | thus generally preferred over their non-journaled counterparts. Journaled |
|
|
| 393 | filesystems prevent long delays when you boot your system and your filesystem |
|
|
| 394 | happens to be in an inconsistent state. |
|
|
| 395 | </p> |
|
|
| 396 | |
|
|
| 397 | <p> |
|
|
| 398 | <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata |
|
|
| 399 | journaling for fast recovery in addition to other enhanced journaling modes like |
|
|
| 400 | full data and ordered data journaling. ext3 is a very good and reliable |
|
|
| 401 | filesystem. It has an additional hashed b-tree indexing option that enables |
|
|
| 402 | high performance in almost all situations. In short, ext3 is an excellent |
|
|
| 403 | filesystem. |
|
|
| 404 | </p> |
|
|
| 405 | |
|
|
| 406 | <p> |
|
|
| 407 | <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall |
|
|
| 408 | performance and greatly outperforms both ext2 and ext3 when dealing with small |
|
|
| 409 | files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales |
|
|
| 410 | extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is |
|
|
| 411 | solid and usable as both general-purpose filesystem and for extreme cases such |
|
|
| 412 | as the creation of large filesystems, the use of many small files, very large |
|
|
| 413 | files and directories containing tens of thousands of files. |
|
|
| 414 | </p> |
|
|
| 415 | |
|
|
| 416 | <p> |
|
|
| 417 | <b>XFS</b> is a filesystem with metadata journaling that is fully supported |
|
|
| 418 | under Gentoo Linux's xfs-sources kernel. It comes with a robust feature-set and |
|
|
| 419 | is optimized for scalability. We only recommend using this filesystem on Linux |
|
|
| 420 | systems with high-end SCSI and/or fibre channel storage and a uninterruptible |
|
|
| 421 | power supply. Because XFS aggressively caches in-transit data in RAM, improperly |
|
|
| 422 | designed programs (those that don't take proper precautions when writing files |
|
|
| 423 | to disk and there are quite a few of them) can lose a good deal of data if the |
|
|
| 424 | system goes down unexpectedly. |
|
|
| 425 | </p> |
|
|
| 426 | |
|
|
| 427 | <p> |
|
|
| 428 | <b>JFS</b> is IBM's high-performance journaling filesystem. It has recently |
|
|
| 429 | become production-ready and there hasn't been a sufficient track record to |
|
|
| 430 | comment positively nor negatively on its general stability at this point. |
|
|
| 431 | </p> |
|
|
| 432 | |
|
|
| 433 | </body> |
|
|
| 434 | </subsection> |
617 | <subsection> |
|
|
618 | <include href="hb-install-filesystems.xml"/> |
|
|
619 | </subsection> |
|
|
620 | |
| 435 | <subsection id="filesystems-apply"> |
621 | <subsection id="filesystems-apply"> |
| 436 | <title>Applying a Filesystem to a Partition</title> |
622 | <title>Applying a Filesystem to a Partition</title> |
| 437 | <body> |
623 | <body> |
| 438 | |
624 | |
| 439 | <p> |
625 | <p> |
| … | |
… | |
| 467 | <ti><c>mkfs.jfs</c></ti> |
653 | <ti><c>mkfs.jfs</c></ti> |
| 468 | </tr> |
654 | </tr> |
| 469 | </table> |
655 | </table> |
| 470 | |
656 | |
| 471 | <p> |
657 | <p> |
| 472 | For instance, to have the root partition (<path>/dev/sdab</path> in our example) |
658 | For instance, to have the root partition (<path>/dev/sda2</path> in our example) |
| 473 | in ext3, you would use: |
659 | in ext3, you would use: |
| 474 | </p> |
660 | </p> |
| 475 | |
661 | |
| 476 | <pre caption="Applying a filesystem on a partition"> |
662 | <pre caption="Applying a filesystem on a partition"> |
| 477 | # <i>mke2fs -j /dev/sdab</i> |
663 | # <i>mke2fs -j /dev/sda2</i> |
| 478 | </pre> |
664 | </pre> |
| 479 | |
665 | |
| 480 | <p> |
666 | <p> |
| 481 | Now create the filesystems on your newly created partitions (or logical |
667 | Now create the filesystems on your newly created partitions (or logical |
| 482 | volumes). |
668 | volumes). |
| … | |
… | |
| 491 | <p> |
677 | <p> |
| 492 | <c>mkswap</c> is the command that is used to initialize swap partitions: |
678 | <c>mkswap</c> is the command that is used to initialize swap partitions: |
| 493 | </p> |
679 | </p> |
| 494 | |
680 | |
| 495 | <pre caption="Creating a Swap signature"> |
681 | <pre caption="Creating a Swap signature"> |
| 496 | # <i>mkswap /dev/sdaa</i> |
682 | # <i>mkswap /dev/sda1</i> |
| 497 | </pre> |
683 | </pre> |
| 498 | |
684 | |
| 499 | <p> |
685 | <p> |
| 500 | To activate the swap partition, use <c>swapon</c>: |
686 | To activate the swap partition, use <c>swapon</c>: |
| 501 | </p> |
687 | </p> |
| 502 | |
688 | |
| 503 | <pre caption="Activating the swap partition"> |
689 | <pre caption="Activating the swap partition"> |
| 504 | # <i>swapon /dev/sdaa</i> |
690 | # <i>swapon /dev/sda1</i> |
| 505 | </pre> |
691 | </pre> |
| 506 | |
692 | |
| 507 | <p> |
693 | <p> |
| 508 | Create and activate the swap now. |
694 | Create and activate the swap with the commands mentioned above. |
| 509 | </p> |
695 | </p> |
| 510 | |
696 | |
| 511 | </body> |
697 | </body> |
| 512 | </subsection> |
698 | </subsection> |
| 513 | </section> |
699 | </section> |
| … | |
… | |
| 517 | |
703 | |
| 518 | <p> |
704 | <p> |
| 519 | Now that your partitions are initialized and are housing a filesystem, it is |
705 | Now that your partitions are initialized and are housing a filesystem, it is |
| 520 | time to mount those partitions. Use the <c>mount</c> command. Don't forget to |
706 | time to mount those partitions. Use the <c>mount</c> command. Don't forget to |
| 521 | create the necessary mount directories for every partition you created. As an |
707 | create the necessary mount directories for every partition you created. As an |
| 522 | example we mount the root and boot partition: |
708 | example we mount the root partition: |
| 523 | </p> |
709 | </p> |
| 524 | |
710 | |
| 525 | <pre caption="Mounting partitions"> |
711 | <pre caption="Mounting partitions"> |
| 526 | # <i>mount /dev/sdab /mnt/gentoo</i> |
712 | # <i>mount /dev/sda2 /mnt/gentoo</i> |
| 527 | </pre> |
713 | </pre> |
| 528 | |
714 | |
| 529 | <note> |
715 | <note> |
| 530 | If you want your <path>/tmp</path> to reside on a separate partition, be sure to |
716 | If you want your <path>/tmp</path> to reside on a separate partition, be sure to |
| 531 | change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This |
717 | change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This |
| 532 | also holds for <path>/var/tmp</path>. |
718 | also holds for <path>/var/tmp</path>. |
| 533 | </note> |
719 | </note> |
| 534 | |
720 | |
| 535 | <p> |
721 | <p> |
| 536 | We also need to mount the proc filesystem (a virtual interface with the kernel) |
722 | We will also have to mount the proc filesystem (a virtual interface with the |
| 537 | on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path> |
723 | kernel) on <path>/proc</path>. But first we will need to place our files on the partitions. |
| 538 | mountpoint and then mount the filesystem: |
|
|
| 539 | </p> |
|
|
| 540 | |
|
|
| 541 | <pre caption="Creating the /mnt/gentoo/proc mountpoint"> |
|
|
| 542 | # <i>mkdir /mnt/gentoo/proc</i> |
|
|
| 543 | # <i>mount -t proc none /mnt/gentoo/proc</i> |
|
|
| 544 | </pre> |
|
|
| 545 | |
|
|
| 546 | <p> |
724 | </p> |
|
|
725 | |
|
|
726 | <p> |
| 547 | Now continue with <uri link="?part=1&chap=5">Installing the Gentoo |
727 | Continue with <uri link="?part=1&chap=5">Installing the Gentoo |
| 548 | Installation Files</uri>. |
728 | Installation Files</uri>. |
| 549 | </p> |
729 | </p> |
| 550 | |
730 | |
| 551 | </body> |
731 | </body> |
| 552 | </section> |
732 | </section> |