/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-alpha-disk.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-install-alpha-disk.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.30
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.6 2004/08/02 15:54:00 swift 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>
17We'll take a good look at disk-oriented aspects of Gentoo Linux
18and Linux in general, including Linux filesystems, partitions and block devices.
19Then, once you're familiar with the ins and outs of disks and filesystems,
20you'll be guided through the process of setting up partitions and filesystems
21for your Gentoo Linux installation.
22</p>
23
24<p>
25To begin, we'll introduce <e>block devices</e>. The most famous block device is
26probably the one that represents the first SCSI HD in a Linux system, namely
27<path>/dev/sda</path>.
28</p>
29
30<p>
31The block devices above represent an abstract interface to the disk. User
32programs can use these block devices to interact with your disk without worrying
33about whether your drives are IDE, SCSI or something else. The program can
34simply address the storage on the disk as a bunch of contiguous,
35randomly-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>
82 63
83 64
84<p> 65<p>
85If you are interested in knowing how big a partition should be, or even how 66If you are interested in knowing how big a partition should be, or even how
86many partitions (or volumes) you need, read on. Otherwise continue now with 67many 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>
69or <uri link="#fdisk_ARC">Using fdisk to Partition your Disk (ARC/AlphaBIOS
70only)</uri>.
88</p> 71</p>
89 72
90</body> 73</body>
91</subsection> 74</subsection>
92<subsection> 75<subsection>
100If you are installing Gentoo to perform as a mailserver, your 83If 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
103performance. Gameservers will have a separate <path>/opt</path> as most gaming 86performance. Gameservers will have a separate <path>/opt</path> as most gaming
104servers are installed there. The reason is similar for <path>/home</path>: 87servers are installed there. The reason is similar for <path>/home</path>:
105security and backups. 88security and backups. You will definitely want to keep <path>/usr</path> big:
89not only will it contain the majority of applications, the Portage tree alone
90takes around 500 Mbyte excluding the various sources that are stored in it.
106</p> 91</p>
107 92
108<p> 93<p>
109As you can see, it very much depends on what you want to achieve. Separate 94As you can see, it very much depends on what you want to achieve. Separate
110partitions or volumes have the following advantages: 95partitions 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>
147The following parts explain how to create the example slice layout described 132The following parts explain how to create the example slice layout described
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>
171Change your slice layout according to your own will. 156Change 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>
182To figure out what disks you have running, use the following commands: 167To 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>
191From this output you should be able to see what disks were detected and their 176From this output you should be able to see what disks were detected and their
192respective <path>/dev</path> entry. In the following parts we assume that the 177respective <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>
196If your hard drive is completely blank, then you'll have to first create
197a BSD disklabel.
198</p>
199
200<pre caption="Creating a BSD disklabel">
201Command (m for help): <i>b</i>
202/dev/sda contains no disklabel.
203Do you want to create a disklabel? (y/n) <i>y</i>
204<comment>A bunch of drive-specific info will show here</comment>
2053 partitions:
206# start end size fstype [fsize bsize cpg]
207 c: 1 5290* 5289* unused 0 0
208</pre>
209
210<p>
211We start with deleting all slices <e>except</e> the 'c'-slice. The following 211We start with deleting all slices <e>except</e> the 'c'-slice (a requirement
212shows how to delete a slice (in the example we use 'a'). Repeat the process to 212for using BSD disklabels). The following shows how to delete a slice (in
213delete all other slices (again, except the 'c'-slice). 213the 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>
217Use <c>p</c> to view all existing slices. <c>d</c> is used to delete a slice. 218Use <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>
258On Alpha based systems you don't need a separate boot partition. However, the 259On Alpha based systems you don't need a separate boot slice. However, the
259first cylinder cannot be used as the <c>aboot</c> image will be placed there. 260first cylinder cannot be used as the <c>aboot</c> image will be placed there.
260</p> 261</p>
261 262
262<p> 263<p>
263We will create a swap slice starting at the third cylinder, with a total 264We will create a swap slice starting at the third cylinder, with a total
264size of 1 Gbyte. Use <c>n</c> to create a new slice. After creating the slice, 265size of 1 GB. Use <c>n</c> to create a new slice. After creating the slice,
265we will change its type to <c>1</c>, meaning <e>swap</e>. 266we 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">
269BSD disklabel command (m for help): <i>n</i> 270BSD disklabel command (m for help): <i>n</i>
270Partition (a-p): <i>a</i> 271Partition (a-p): <i>a</i>
296<body> 297<body>
297 298
298<p> 299<p>
299We will now create the root slice, starting from the first cylinder <e>after</e> 300We will now create the root slice, starting from the first cylinder <e>after</e>
300the swap slice. Use the <c>p</c> command to view where the swap slice ends. In 301the swap slice. Use the <c>p</c> command to view where the swap slice ends. In
301our example, this is at 1003, making the root partition start at 1004. 302our example, this is at 1003, making the root slice start at 1004.
302</p> 303</p>
303 304
304<p> 305<p>
305Another problem is that there is currently a bug in <c>fdisk</c> making it think 306Another problem is that there is currently a bug in <c>fdisk</c> making it think
306the number of available cylinders is one above the real number of cylinders. In 307the number of available cylinders is one above the real number of cylinders. In
307other words, when you are asked for the last cylinder, decrease the cylinder 308other words, when you are asked for the last cylinder, decrease the cylinder
308number (in this example: 5290) with one. 309number (in this example: 5290) with one.
309</p> 310</p>
310 311
311<p> 312<p>
312When the partition is created, we change the type to <c>8</c>, for <e>ext2</e>. 313When 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">
316D disklabel command (m for help): <i>n</i> 317D disklabel command (m for help): <i>n</i>
317Partition (a-p): <i>b</i> 318Partition (a-p): <i>b</i>
350<pre caption="Save and exit fdisk"> 351<pre caption="Save and exit fdisk">
351Command (m for help): <i>w</i> 352Command (m for help): <i>w</i>
352</pre> 353</pre>
353 354
354<p> 355<p>
355Now that your slices are created, you can now continue with <uri 356Now that your slices are created, you can continue with <uri
357link="#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>
369The following parts explain how to partition the disk with a layout
370similar 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>
393Change 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>
403To 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>
412From this output you should be able to see what disks were detected and their
413respective <path>/dev</path> entry. In the following parts we assume that the
414disk is a SCSI disk on <path>/dev/sda</path>.
415</p>
416
417<p>
418Now 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>
432If your hard drive is completely blank, then you'll have to first create
433a DOS disklabel.
434</p>
435
436<pre caption="Creating a DOS disklabel">
437Command (m for help): <i>o</i>
438Building a new DOS disklabel.
439</pre>
440
441<p>
442We start with deleting all partitions. The following shows how to delete
443a partition (in the example we use '1'). Repeat the process to delete all
444other partitions.
445</p>
446
447<p>
448Use <c>p</c> to view all existing partitions. <c>d</c> is used to delete a
449partition.
450</p>
451
452<pre caption="Deleting a partition">
453command (m for help): <i>p</i>
454
455Disk /dev/sda: 9150 MB, 9150996480 bytes
45664 heads, 32 sectors/track, 8727 cylinders
457Units = 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
465command (m for help): <i>d</i>
466Partition 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>
477On Alpha systems which use MILO to boot, we have to create a small vfat
478boot partition.
479</p>
480
481<pre caption="Creating the boot partition">
482Command (m for help): <i>n</i>
483Command action
484 e extended
485 p primary partition (1-4)
486<i>p</i>
487Partition number (1-4): <i>1</i>
488First cylinder (1-8727, default 1): <i>1</i>
489Last cylinder or +size or +sizeM or +sizeK (1-8727, default 8727): <i>+16M</i>
490
491Command (m for help): <i>t</i>
492Selected partition 1
493Hex code (type L to list codes): <i>6</i>
494Changed 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>
504We will create a swap partition with a total size of 1 GB. Use <c>n</c> to
505create a new partition.
506</p>
507
508<pre caption="Creating the swap partition">
509Command (m for help): <i>n</i>
510Command action
511 e extended
512 p primary partition (1-4)
513<i>p</i>
514Partition number (1-4): <i>2</i>
515First cylinder (17-8727, default 17): <i>17</i>
516Last cylinder or +size or +sizeM or +sizeK (17-8727, default 8727): <i>+1000M</i>
517
518Command (m for help): <i>t</i>
519Partition number (1-4): <i>2</i>
520Hex code (type L to list codes): <i>82</i>
521Changed system type of partition 2 to 82 (Linux swap)
522</pre>
523
524<p>
525After these steps you should see a layout similar to the following:
526</p>
527
528<pre caption="Partition listing after creating a swap partition">
529Command (m for help): <i>p</i>
530
531Disk /dev/sda: 9150 MB, 9150996480 bytes
53264 heads, 32 sectors/track, 8727 cylinders
533Units = 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>
547We will now create the root partition. Again, just use the <c>n</c> command.
548</p>
549
550<pre caption="Creating the root partition">
551Command (m for help): <i>n</i>
552Command action
553 e extended
554 p primary partition (1-4)
555<i>p</i>
556Partition number (1-4): <i>3</i>
557First cylinder (972-8727, default 972): <i>972</i>
558Last cylinder or +size or +sizeM or +sizeK (972-8727, default 8727): <i>8727</i>
559</pre>
560
561<p>
562After these steps you should see a layout similar to the following:
563</p>
564
565<pre caption="Partition listing after creating the root partition">
566Command (m for help): <i>p</i>
567
568Disk /dev/sda: 9150 MB, 9150996480 bytes
56964 heads, 32 sectors/track, 8727 cylinders
570Units = 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>
585Save <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">
589Command (m for help): <i>w</i>
590</pre>
591
592<p>
593Now that your partitions are created, you can continue with <uri
356link="#filesystems">Creating Filesystems</uri>. 594link="#filesystems">Creating Filesystems</uri>.
357</p> 595</p>
358 596
359</body> 597</body>
360</subsection> 598</subsection>
373Otherwise read on to learn about the available filesystems... 611Otherwise 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>
383Several filesystems are available. Most of them are found stable on the
384Alpha architecture.
385</p>
386
387<p>
388<b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
389journaling, which means that routine ext2 filesystem checks at startup time can
390be quite time-consuming. There is now quite a selection of newer-generation
391journaled filesystems that can be checked for consistency very quickly and are
392thus generally preferred over their non-journaled counterparts. Journaled
393filesystems prevent long delays when you boot your system and your filesystem
394happens 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
399journaling for fast recovery in addition to other enhanced journaling modes like
400full data and ordered data journaling. ext3 is a very good and reliable
401filesystem. It has an additional hashed b-tree indexing option that enables
402high performance in almost all situations. In short, ext3 is an excellent
403filesystem.
404</p>
405
406<p>
407<b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
408performance and greatly outperforms both ext2 and ext3 when dealing with small
409files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
410extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
411solid and usable as both general-purpose filesystem and for extreme cases such
412as the creation of large filesystems, the use of many small files, very large
413files and directories containing tens of thousands of files.
414</p>
415
416<p>
417<b>XFS</b> is a filesystem with metadata journaling which comes with a robust
418feature-set and is optimized for scalability. We only recommend using this
419filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
420an uninterruptible power supply. Because XFS aggressively caches in-transit data
421in RAM, improperly designed programs (those that don't take proper precautions
422when writing files to disk and there are quite a few of them) can lose a good
423deal of data if the system goes down unexpectedly.
424</p>
425
426<p>
427<b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
428become production-ready and there hasn't been a sufficient track record to
429comment positively nor negatively on its general stability at this point.
430</p>
431
432</body>
433</subsection> 617<subsection>
618<include href="hb-install-filesystems.xml"/>
619</subsection>
620
434<subsection id="filesystems-apply"> 621<subsection id="filesystems-apply">
435<title>Applying a Filesystem to a Partition</title> 622<title>Applying a Filesystem to a Partition</title>
436<body> 623<body>
437 624
438<p> 625<p>
502<pre caption="Activating the swap partition"> 689<pre caption="Activating the swap partition">
503# <i>swapon /dev/sda1</i> 690# <i>swapon /dev/sda1</i>
504</pre> 691</pre>
505 692
506<p> 693<p>
507Create and activate the swap now. 694Create and activate the swap with the commands mentioned above.
508</p> 695</p>
509 696
510</body> 697</body>
511</subsection> 698</subsection>
512</section> 699</section>
516 703
517<p> 704<p>
518Now that your partitions are initialized and are housing a filesystem, it is 705Now that your partitions are initialized and are housing a filesystem, it is
519time to mount those partitions. Use the <c>mount</c> command. Don't forget to 706time to mount those partitions. Use the <c>mount</c> command. Don't forget to
520create the necessary mount directories for every partition you created. As an 707create the necessary mount directories for every partition you created. As an
521example we mount the root and boot partition: 708example we mount the root partition:
522</p> 709</p>
523 710
524<pre caption="Mounting partitions"> 711<pre caption="Mounting partitions">
525# <i>mount /dev/sda2 /mnt/gentoo</i> 712# <i>mount /dev/sda2 /mnt/gentoo</i>
526</pre> 713</pre>

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20