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

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

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

Revision 1.23 Revision 1.35
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/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-disk.xml,v 1.23 2005/09/25 16:19:37 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-disk.xml,v 1.35 2010/07/20 08:29:37 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>2.4</version> 11<version>6.0</version>
12<date>2005-08-25</date> 12<date>2010-07-20</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 some of the disk-oriented aspects of Gentoo Linux
22and Linux in general, including Linux filesystems, partitions, and block
23devices. Then, once you're familiar with the ins and outs of disks and
24filesystems, you'll be guided through the process of setting up partitions
25and filesystems for your Gentoo Linux installation.
26</p>
27
28<p>
29To begin, we introduce <e>block devices</e>. The most typical block device is
30probably the one that represents the first SCSI hard disk in a Linux system,
31namely <path>/dev/sda</path>.
32</p>
33
34<p>
35Block devices represent an abstract interface to the disk. User programs can
36use these block devices to interact with your disk without worrying about
37whether your drives are IDE, SCSI, or something else. The program can simply
38address the storage on the disk as a bunch of contiguous, randomly-accessible
39512-byte blocks.
40</p>
41
42<p>
43Block devices show up as entries in <path>/dev/</path>. Typically, the first
44SCSI drive is named <path>/dev/sda</path>, the second <path>/dev/sdb</path>,
45and so on. IDE drives are named similarly, however, they are prefixed by hd-
46instead of sd-. If you are using IDE drives, the first one will be named
47<path>/dev/hda</path>, the second <path>/dev/hdb</path>, and so on.
48</p>
49
50</body>
51</subsection> 17<subsection>
18<include href="hb-install-blockdevices.xml"/>
19</subsection>
20
52<subsection> 21<subsection>
53<title>Partitions</title> 22<title>Partitions</title>
54<body> 23<body>
55 24
56<p> 25<p>
60<e>partitions</e> or <e>slices</e>. 29<e>partitions</e> or <e>slices</e>.
61</p> 30</p>
62 31
63<p> 32<p>
64The first partition on the first SCSI disk is <path>/dev/sda1</path>, the second 33The first partition on the first SCSI disk is <path>/dev/sda1</path>, the second
65<path>/dev/sda2</path> and so on. Similarly, the first two partitions on the 34<path>/dev/sda2</path> and so on.
66first IDE disk are <path>/dev/hda1</path> and <path>/dev/hda2</path>.
67</p> 35</p>
68 36
69<p> 37<p>
70The third partition on Sun systems is set aside as a special "whole disk" 38The third partition on Sun systems is set aside as a special "whole disk"
71slice. This partition must not contain a file system. 39slice. This partition must not contain a file system.
86<subsection> 54<subsection>
87<title>Default Partitioning Scheme</title> 55<title>Default Partitioning Scheme</title>
88<body> 56<body>
89 57
90<p> 58<p>
91If you are not interested in drawing up a partitioning scheme, 59If you are not interested in drawing up a partitioning scheme, the table below
92the table below suggests a suitable starting point for most systems. For 60suggests a suitable starting point for most systems.
93IDE-based systems, substitute <c>hda</c> for <c>sda</c> in the following.
94</p> 61</p>
95 62
96<p> 63<p>
97Note that a separate <path>/boot</path> partition is generally <e>not</e> 64Note that a separate <path>/boot</path> partition is generally <e>not</e>
98recommended on SPARC, as it complicates the bootloader configuration. 65recommended on SPARC, as it complicates the bootloader configuration.
105 <th>Size</th> 72 <th>Size</th>
106 <th>Mount Point</th> 73 <th>Mount Point</th>
107 <th>Description</th> 74 <th>Description</th>
108</tr> 75</tr>
109<tr> 76<tr>
77 <ti>/dev/sda1</ti>
78 <ti>ext3</ti>
79 <ti>&lt;2 GB</ti>
80 <ti>/</ti>
81 <ti>
82 Root partition. For SPARC64 systems with older OBP versions, this
83 <e>must</e> be less than 2 GB in size, and the first partition on the
84 disk.
85 </ti>
86</tr>
87<tr>
88 <ti>/dev/sda2</ti>
89 <ti>swap</ti>
90 <ti>512 MB</ti>
91 <ti>none</ti>
92 <ti>
93 Swap partition. For bootstrap and certain larger compiles, at least 512
94 MB of RAM (including swap) is required.
95 </ti>
96</tr>
97<tr>
98 <ti>/dev/sda3</ti>
99 <ti>none</ti>
100 <ti>Whole disk</ti>
101 <ti>none</ti>
102 <ti>Whole disk partition. This is required on SPARC systems.</ti>
103</tr>
104<tr>
105 <ti>/dev/sda4</ti>
106 <ti>ext3</ti>
107 <ti>at least 2 GB</ti>
108 <ti>/usr</ti>
109 <ti>
110 /usr partition. Applications are installed here. By default this partition
111 is also used for Portage data (which takes around 500 MB excluding
112 source code).
113 </ti>
114</tr>
115<tr>
116 <ti>/dev/sda5</ti>
117 <ti>ext3</ti>
118 <ti>at least 1 GB</ti>
119 <ti>/var</ti>
120 <ti>
121 /var partition. Used for program-generated data. By default Portage uses
122 this partition for temporary space whilst compiling. Certain larger
123 applications such as Mozilla and OpenOffice.org can require over 1 GB
124 of temporary space here when building.
125 </ti>
126</tr>
127<tr>
128 <ti>/dev/sda6</ti>
129 <ti>ext3</ti>
130 <ti>remaining space</ti>
131 <ti>/home</ti>
132 <ti>/home partition. Used for users' home directories.</ti>
133</tr>
134</table>
135
136</body>
137</subsection>
138</section>
139
140<section id="fdisk">
141<title>Using fdisk to Partition your Disk</title>
142<subsection>
143<body>
144
145<p>
146The following parts explain how to create the example partition layout described
147previously, namely:
148</p>
149
150<table>
151<tr>
152 <th>Partition</th>
153 <th>Description</th>
154</tr>
155<tr>
110 <ti>/dev/sda1</ti> 156 <ti>/dev/sda1</ti>
111 <ti>ext3</ti>
112 <ti>&lt;2 GByte</ti>
113 <ti>/</ti> 157 <ti>/</ti>
114 <ti>
115 Root partition. For all sparc32 systems, and sparc64 systems with older
116 OBP versions, this <e>must</e> be less than 2 GBytes in size, and the first
117 partition on the disk.
118 </ti>
119</tr> 158</tr>
120<tr> 159<tr>
121 <ti>/dev/sda2</ti> 160 <ti>/dev/sda2</ti>
122 <ti>swap</ti> 161 <ti>swap</ti>
123 <ti>512 MBytes</ti>
124 <ti>none</ti>
125 <ti>
126 Swap partition. For bootstrap and certain larger compiles, at least 512
127 MBytes of RAM (including swap) is required.
128 </ti>
129</tr>
130<tr>
131 <ti>/dev/sda3</ti>
132 <ti>none</ti>
133 <ti>Whole disk</ti>
134 <ti>none</ti>
135 <ti>Whole disk partition. This is required on SPARC systems.</ti>
136</tr>
137<tr>
138 <ti>/dev/sda4</ti>
139 <ti>ext3</ti>
140 <ti>at least 2 GBytes</ti>
141 <ti>/usr</ti>
142 <ti>
143 /usr partition. Applications are installed here. By default this partition
144 is also used for Portage data (which takes around 500 Mbyte excluding
145 source code).
146 </ti>
147</tr>
148<tr>
149 <ti>/dev/sda5</ti>
150 <ti>ext3</ti>
151 <ti>at least 1GByte</ti>
152 <ti>/var</ti>
153 <ti>
154 /var partition. Used for program-generated data. By default Portage uses
155 this partition for temporary space whilst compiling. Certain larger
156 applications such as Mozilla and OpenOffice.org can require over 1 GByte
157 of temporary space here when building.
158 </ti>
159</tr>
160<tr>
161 <ti>/dev/sda6</ti>
162 <ti>ext3</ti>
163 <ti>remaining space</ti>
164 <ti>/home</ti>
165 <ti>/home partition. Used for users' home directories.</ti>
166</tr>
167</table>
168
169</body>
170</subsection>
171</section>
172
173<section id="fdisk">
174<title>Using fdisk to Partition your Disk</title>
175<subsection>
176<body>
177
178<p>
179The following parts explain how to create the example partition layout described
180previously, namely:
181</p>
182
183<table>
184<tr>
185 <th>Partition</th>
186 <th>Description</th>
187</tr>
188<tr>
189 <ti>/dev/sda1</ti>
190 <ti>/</ti>
191</tr>
192<tr>
193 <ti>/dev/sda2</ti>
194 <ti>swap</ti>
195</tr> 162</tr>
196<tr> 163<tr>
197 <ti>/dev/sda3</ti> 164 <ti>/dev/sda3</ti>
198 <ti>whole disk slice</ti> 165 <ti>whole disk slice</ti>
199</tr> 166</tr>
211</tr> 178</tr>
212</table> 179</table>
213 180
214<p> 181<p>
215Change the partition layout as required. Remember to keep the root partition 182Change the partition layout as required. Remember to keep the root partition
216entirely within the first 2 GBytes of the disk for older systems. There is also 183entirely within the first 2 GB of the disk for older systems. There is also
217a 15-partition limit for SCSI and SATA. 184a 15-partition limit for SCSI and SATA.
218</p> 185</p>
219 186
220</body> 187</body>
221</subsection> 188</subsection>
259</pre> 226</pre>
260 227
261<p> 228<p>
262Note the <c>Sun disk label</c> in the output. If this is missing, the disk is 229Note the <c>Sun disk label</c> in the output. If this is missing, the disk is
263using the DOS-partitioning, not the Sun partitioning. In this case, use <c>s</c> 230using the DOS-partitioning, not the Sun partitioning. In this case, use <c>s</c>
264to ensure that the disk has a sun partition table: 231to ensure that the disk has a Sun partition table:
265</p> 232</p>
266 233
267<pre caption="Creating a Sun Disklabel"> 234<pre caption="Creating a Sun Disklabel">
268Command (m for help): s 235Command (m for help): <i>s</i>
269Building a new sun disklabel. Changes will remain in memory only, 236Building a new sun disklabel. Changes will remain in memory only,
270until you decide to write them. After that, of course, the previous 237until you decide to write them. After that, of course, the previous
271content won't be recoverable. 238content won't be recoverable.
272 239
273Drive type 240Drive type
363 330
364<p> 331<p>
365We're ready to create the root partition. To do this, type <c>n</c> to create a 332We're ready to create the root partition. To do this, type <c>n</c> to create a
366new partition, then type <c>1</c> to create the partition. When prompted for 333new partition, then type <c>1</c> to create the partition. When prompted for
367the first cylinder, hit enter. When prompted for the last cylinder, type 334the first cylinder, hit enter. When prompted for the last cylinder, type
368<c>+512M</c> to create a partition <c>512MBytes</c> in size. Make sure that the 335<c>+512M</c> to create a partition <c>512 MB</c> in size. Make sure that the
369entire root partition fits within the first 2GBytes of the disk. You can see 336entire root partition fits within the first 2 GB of the disk. You can see
370output from these steps below: 337output from these steps below:
371</p> 338</p>
372 339
373<pre caption="Creating a root partition"> 340<pre caption="Creating a root partition">
374Command (m for help): <i>n</i> 341Command (m for help): <i>n</i>
400 367
401<p> 368<p>
402Next, let's create the swap partition. To do this, type <c>n</c> to create a new 369Next, let's create the swap partition. To do this, type <c>n</c> to create a new
403partition, then <c>2</c> to create the second partition, <path>/dev/sda2</path> 370partition, then <c>2</c> to create the second partition, <path>/dev/sda2</path>
404in our case. When prompted for the first cylinder, hit enter. When prompted for 371in our case. When prompted for the first cylinder, hit enter. When prompted for
405the last cylinder, type <c>+512M</c> to create a partition 512MB in size. After 372the last cylinder, type <c>+512M</c> to create a partition 512 MB in size. After
406you've done this, type <c>t</c> to set the partition type, and then type in 373you've done this, type <c>t</c> to set the partition type, and then type in
407<c>82</c> to set the partition type to "Linux Swap". After completing these 374<c>82</c> to set the partition type to "Linux Swap". After completing these
408steps, typing <c>p</c> should display a partition table that looks similar to 375steps, typing <c>p</c> should display a partition table that looks similar to
409this: 376this:
410</p> 377</p>
430<p> 397<p>
431Finally, let's create the /usr, /var and /home partitions. As before, 398Finally, let's create the /usr, /var and /home partitions. As before,
432type <c>n</c> to create a new partition, then type <c>4</c> to create the 399type <c>n</c> to create a new partition, then type <c>4</c> to create the
433third partition, <path>/dev/sda4</path> in our case. When prompted for the 400third partition, <path>/dev/sda4</path> in our case. When prompted for the
434first cylinder, hit enter. When prompted for the last cylinder, enter 401first cylinder, hit enter. When prompted for the last cylinder, enter
435<c>+2048M</c> to create a partition 2 GBytes in size. Repeat this process 402<c>+2048M</c> to create a partition 2 GB in size. Repeat this process
436for <path>sda5</path> and <path>sda6</path>, using the desired sizes. Once 403for <path>sda5</path> and <path>sda6</path>, using the desired sizes. Once
437you're done, you should see something like this: 404you're done, you should see something like this:
438</p> 405</p>
439 406
440<pre caption="Listing complete partition table"> 407<pre caption="Listing complete partition table">
465<pre caption="Save and exit fdisk"> 432<pre caption="Save and exit fdisk">
466Command (m for help): <i>w</i> 433Command (m for help): <i>w</i>
467</pre> 434</pre>
468 435
469<p> 436<p>
470Now that your partitions are created, you can now continue with <uri 437Now that your partitions are created, you can continue with <uri
471link="#filesystems">Creating Filesystems</uri>. 438link="#filesystems">Creating Filesystems</uri>.
472</p> 439</p>
473 440
474</body> 441</body>
475</subsection> 442</subsection>
488Otherwise, read on to learn about the available filesystems... 455Otherwise, read on to learn about the available filesystems...
489</p> 456</p>
490 457
491</body> 458</body>
492</subsection> 459</subsection>
493<subsection>
494<title>Filesystems?</title>
495<body>
496 460
497<p>
498Several filesystems are available, some are known to be stable on the
499SPARC architecture. Ext2 and ext3, for example, are known to work well.
500Alternate filesystems may not function correctly.
501</p>
502
503<p>
504<b>ext2</b> is the tried-and-true Linux filesystem. It does not support
505journaling, which means that periodic checks of ext2 filesystems at startup
506can be quite time-consuming. There is quite a selection of newer-generation
507journaled filesystems that can be checked for consistency very quickly at
508startup, and are therefore generally preferred over their non-journaled
509counterparts. In general, journaled filesystems prevent long delays when a
510system is booted and the filesystem is in an inconsistent state.
511</p>
512
513<p>
514<b>ext3</b> is the journaled version of the ext2 filesystem. It provides
515metadata journaling for fast recovery as well as other enhanced journaling
516modes like full-data and ordered-data journaling. Ext3 has an additional hashed
517b-tree indexing option that enables high performance in almost all situations.
518You can enable this indexing by adding <c>-O dir_index</c> to the <c>mke2fs</c>
519command. Ext3 makes an excellent and reliable alternative to ext2.
520</p>
521
522</body>
523</subsection> 461<subsection>
462<include href="hb-install-filesystems.xml"/>
463</subsection>
464
524<subsection id="filesystems-apply"> 465<subsection id="filesystems-apply">
525<title>Applying a Filesystem to a Partition</title> 466<title>Applying a Filesystem to a Partition</title>
526<body> 467<body>
527 468
528<p> 469<p>
540 <ti><c>mke2fs</c></ti> 481 <ti><c>mke2fs</c></ti>
541</tr> 482</tr>
542<tr> 483<tr>
543 <ti>ext3</ti> 484 <ti>ext3</ti>
544 <ti><c>mke2fs -j</c></ti> 485 <ti><c>mke2fs -j</c></ti>
545</tr>
546<tr>
547 <ti>ext3 with hashed b-tree indexing (2.6 kernels only)</ti>
548 <ti><c>mke2fs -j -O dir_index</c></ti>
549</tr> 486</tr>
550</table> 487</table>
551 488
552<p> 489<p>
553For instance, to create the root partition (<path>/dev/sda1</path> in our 490For instance, to create the root partition (<path>/dev/sda1</path> in our

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.20