/[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.15 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.15 2005/01/02 12:06:05 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 10
11<version>1.10</version> 11<version>9.1</version>
12<date>2004-12-30</date> 12<date>2009-02-15</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>
21We'll take a good look at disk-oriented aspects of Gentoo Linux
22and Linux in general, including Linux filesystems, partitions and block devices.
23Then, once you're familiar with the ins and outs of disks and filesystems,
24you'll be guided through the process of setting up partitions and filesystems
25for your Gentoo Linux installation.
26</p>
27
28<p>
29To begin, we'll introduce <e>block devices</e>. The most famous block device is
30probably the one that represents the first SCSI HD in a Linux system, namely
31<path>/dev/sda</path>.
32</p>
33
34<p>
35The block devices above represent an abstract interface to the disk. User
36programs can use these block devices to interact with your disk without worrying
37about whether your drives are IDE, SCSI or something else. The program can
38simply address the storage on the disk as a bunch of contiguous,
39randomly-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>
89If 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
90many partitions (or volumes) you need, read on. Otherwise continue now with 67many 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>
69or <uri link="#fdisk_ARC">Using fdisk to Partition your Disk (ARC/AlphaBIOS
70only)</uri>.
92</p> 71</p>
93 72
94</body> 73</body>
95</subsection> 74</subsection>
96<subsection> 75<subsection>
104If you are installing Gentoo to perform as a mailserver, your 83If 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
107performance. Gameservers will have a separate <path>/opt</path> as most gaming 86performance. Gameservers will have a separate <path>/opt</path> as most gaming
108servers are installed there. The reason is similar for <path>/home</path>: 87servers are installed there. The reason is similar for <path>/home</path>:
109security 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.
110</p> 91</p>
111 92
112<p> 93<p>
113As 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
114partitions or volumes have the following advantages: 95partitions or volumes have the following advantages:
140</p> 121</p>
141 122
142</body> 123</body>
143</subsection> 124</subsection>
144</section> 125</section>
145<section id="fdisk"> 126<section id="fdisk_SRM">
146<title>Using fdisk to Partition your Disk (SRM only)</title> 127<title>Using fdisk to Partition your Disk (SRM only)</title>
147<subsection> 128<subsection>
148<body> 129<body>
149 130
150<p> 131<p>
273<subsection> 254<subsection>
274<title>Creating the Swap Slice</title> 255<title>Creating the Swap Slice</title>
275<body> 256<body>
276 257
277<p> 258<p>
278On 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
279first 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.
280</p> 261</p>
281 262
282<p> 263<p>
283We 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
316<body> 297<body>
317 298
318<p> 299<p>
319We 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>
320the 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
321our 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.
322</p> 303</p>
323 304
324<p> 305<p>
325Another 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
326the 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
327other 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
328number (in this example: 5290) with one. 309number (in this example: 5290) with one.
329</p> 310</p>
330 311
331<p> 312<p>
332When 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>.
333</p> 314</p>
334 315
335<pre caption="Creating the root slice"> 316<pre caption="Creating the root slice">
336D disklabel command (m for help): <i>n</i> 317D disklabel command (m for help): <i>n</i>
337Partition (a-p): <i>b</i> 318Partition (a-p): <i>b</i>
370<pre caption="Save and exit fdisk"> 351<pre caption="Save and exit fdisk">
371Command (m for help): <i>w</i> 352Command (m for help): <i>w</i>
372</pre> 353</pre>
373 354
374<p> 355<p>
375Now that your slices are created, you can now continue with <uri 356Now that your slices are created, you can continue with <uri
376link="#filesystems">Creating Filesystems</uri>. 357link="#filesystems">Creating Filesystems</uri>.
377</p> 358</p>
378 359
379</body> 360</body>
380</subsection> 361</subsection>
381</section> 362</section>
382<section id="fdisk"> 363<section id="fdisk_ARC">
383<title>Using fdisk to Partition your Disk (ARC/AlphaBIOS only)</title> 364<title>Using fdisk to Partition your Disk (ARC/AlphaBIOS only)</title>
384<subsection> 365<subsection>
385<body> 366<body>
386 367
387<p> 368<p>
518<subsection> 499<subsection>
519<title>Creating the Swap Partition</title> 500<title>Creating the Swap Partition</title>
520<body> 501<body>
521 502
522<p> 503<p>
523We will create a swap partition starting at the third cylinder, with a total 504We will create a swap partition with a total size of 1 GB. Use <c>n</c> to
524size of 1 GB. Use <c>n</c> to create a new partition. 505create a new partition.
525</p> 506</p>
526 507
527<pre caption="Creating the swap partition"> 508<pre caption="Creating the swap partition">
528Command (m for help): <i>n</i> 509Command (m for help): <i>n</i>
529Command action 510Command action
533Partition number (1-4): <i>2</i> 514Partition number (1-4): <i>2</i>
534First cylinder (17-8727, default 17): <i>17</i> 515First cylinder (17-8727, default 17): <i>17</i>
535Last cylinder or +size or +sizeM or +sizeK (17-8727, default 8727): <i>+1000M</i> 516Last cylinder or +size or +sizeM or +sizeK (17-8727, default 8727): <i>+1000M</i>
536 517
537Command (m for help): <i>t</i> 518Command (m for help): <i>t</i>
538Partition number (1-4): <i>1</i> 519Partition number (1-4): <i>2</i>
539Hex code (type L to list codes): <i>82</i> 520Hex code (type L to list codes): <i>82</i>
540Changed system type of partition 2 to 82 (Linux swap) 521Changed system type of partition 2 to 82 (Linux swap)
541</pre> 522</pre>
542 523
543<p> 524<p>
607<pre caption="Save and exit fdisk"> 588<pre caption="Save and exit fdisk">
608Command (m for help): <i>w</i> 589Command (m for help): <i>w</i>
609</pre> 590</pre>
610 591
611<p> 592<p>
612Now that your partitions are created, you can now continue with <uri 593Now that your partitions are created, you can continue with <uri
613link="#filesystems">Creating Filesystems</uri>. 594link="#filesystems">Creating Filesystems</uri>.
614</p> 595</p>
615 596
616</body> 597</body>
617</subsection> 598</subsection>
630Otherwise read on to learn about the available filesystems... 611Otherwise read on to learn about the available filesystems...
631</p> 612</p>
632 613
633</body> 614</body>
634</subsection> 615</subsection>
635<subsection>
636<title>Filesystems?</title>
637<body>
638 616
639<p>
640Several filesystems are available. Most of them are found stable on the
641Alpha architecture.
642</p>
643
644<p>
645<b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
646journaling, which means that routine ext2 filesystem checks at startup time can
647be quite time-consuming. There is now quite a selection of newer-generation
648journaled filesystems that can be checked for consistency very quickly and are
649thus generally preferred over their non-journaled counterparts. Journaled
650filesystems prevent long delays when you boot your system and your filesystem
651happens to be in an inconsistent state.
652</p>
653
654<p>
655<b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
656journaling for fast recovery in addition to other enhanced journaling modes like
657full data and ordered data journaling. ext3 is a very good and reliable
658filesystem. It has an additional hashed b-tree indexing option that enables
659high performance in almost all situations. In short, ext3 is an excellent
660filesystem.
661</p>
662
663<p>
664<b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
665performance and greatly outperforms both ext2 and ext3 when dealing with small
666files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
667extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
668solid and usable as both general-purpose filesystem and for extreme cases such
669as the creation of large filesystems, the use of many small files, very large
670files and directories containing tens of thousands of files.
671</p>
672
673<p>
674<b>XFS</b> is a filesystem with metadata journaling which comes with a robust
675feature-set and is optimized for scalability. We only recommend using this
676filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
677an uninterruptible power supply. Because XFS aggressively caches in-transit data
678in RAM, improperly designed programs (those that don't take proper precautions
679when writing files to disk and there are quite a few of them) can lose a good
680deal of data if the system goes down unexpectedly.
681</p>
682
683<p>
684<b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
685become production-ready and there hasn't been a sufficient track record to
686comment positively nor negatively on its general stability at this point.
687</p>
688
689</body>
690</subsection> 617<subsection>
618<include href="hb-install-filesystems.xml"/>
619</subsection>
620
691<subsection id="filesystems-apply"> 621<subsection id="filesystems-apply">
692<title>Applying a Filesystem to a Partition</title> 622<title>Applying a Filesystem to a Partition</title>
693<body> 623<body>
694 624
695<p> 625<p>
759<pre caption="Activating the swap partition"> 689<pre caption="Activating the swap partition">
760# <i>swapon /dev/sda1</i> 690# <i>swapon /dev/sda1</i>
761</pre> 691</pre>
762 692
763<p> 693<p>
764Create and activate the swap now. 694Create and activate the swap with the commands mentioned above.
765</p> 695</p>
766 696
767</body> 697</body>
768</subsection> 698</subsection>
769</section> 699</section>
773 703
774<p> 704<p>
775Now 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
776time 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
777create the necessary mount directories for every partition you created. As an 707create the necessary mount directories for every partition you created. As an
778example we mount the root and boot partition: 708example we mount the root partition:
779</p> 709</p>
780 710
781<pre caption="Mounting partitions"> 711<pre caption="Mounting partitions">
782# <i>mount /dev/sda2 /mnt/gentoo</i> 712# <i>mount /dev/sda2 /mnt/gentoo</i>
783</pre> 713</pre>

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

  ViewVC Help
Powered by ViewVC 1.1.20