/[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.28 Revision 1.39
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.28 2007/02/16 13:45:39 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-disk.xml,v 1.39 2013/04/06 11:28:54 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>3.2</version> 11<version>10</version>
12<date>2007-02-16</date> 12<date>2013-04-06</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. Note that this is only an
93IDE-based systems, substitute <c>hda</c> for <c>sda</c> in the following. 61example, so feel free to use different partitioning schemes yourself.
94</p> 62</p>
95 63
96<p> 64<p>
97Note that a separate <path>/boot</path> partition is generally <e>not</e> 65Note that a separate <path>/boot</path> partition is generally <e>not</e>
98recommended on SPARC, as it complicates the bootloader configuration. 66recommended on SPARC, as it complicates the bootloader configuration.
105 <th>Size</th> 73 <th>Size</th>
106 <th>Mount Point</th> 74 <th>Mount Point</th>
107 <th>Description</th> 75 <th>Description</th>
108</tr> 76</tr>
109<tr> 77<tr>
78 <ti>/dev/sda1</ti>
79 <ti>ext4</ti>
80 <ti>&lt;2 GB</ti>
81 <ti>/</ti>
82 <ti>
83 Root partition. For SPARC64 systems with OBP versions 3 or less, this
84 <e>must</e> be less than 2 GB in size, and the first partition on the
85 disk. More recent OBP versions can deal with larger root partitions and,
86 as such, can support having <path>/usr</path>, <path>/var</path> and other
87 locations on the same partition.
88 </ti>
89</tr>
90<tr>
91 <ti>/dev/sda2</ti>
92 <ti>swap</ti>
93 <ti>512 MB</ti>
94 <ti>none</ti>
95 <ti>
96 Swap partition. For bootstrap and certain larger compiles, at least 512
97 MB of RAM (including swap) is required.
98 </ti>
99</tr>
100<tr>
101 <ti>/dev/sda3</ti>
102 <ti>none</ti>
103 <ti>Whole disk</ti>
104 <ti>none</ti>
105 <ti>Whole disk partition. This is required on SPARC systems.</ti>
106</tr>
107<tr>
108 <ti>/dev/sda4</ti>
109 <ti>ext4</ti>
110 <ti>at least 2 GB</ti>
111 <ti>/usr</ti>
112 <ti>
113 /usr partition. Applications are installed here. By default this partition
114 is also used for Portage data (which takes around 500 MB excluding
115 source code).
116 </ti>
117</tr>
118<tr>
119 <ti>/dev/sda5</ti>
120 <ti>ext4</ti>
121 <ti>at least 1 GB</ti>
122 <ti>/var</ti>
123 <ti>
124 /var partition. Used for program-generated data. By default Portage uses
125 this partition for temporary space whilst compiling. Certain larger
126 applications such as Mozilla and OpenOffice.org can require over 1 GB
127 of temporary space here when building.
128 </ti>
129</tr>
130<tr>
131 <ti>/dev/sda6</ti>
132 <ti>ext4</ti>
133 <ti>remaining space</ti>
134 <ti>/home</ti>
135 <ti>/home partition. Used for users' home directories.</ti>
136</tr>
137</table>
138
139</body>
140</subsection>
141</section>
142
143<section id="fdisk">
144<title>Using fdisk to Partition your Disk</title>
145<subsection>
146<body>
147
148<p>
149The following parts explain how to create the example partition layout described
150previously, namely:
151</p>
152
153<table>
154<tr>
155 <th>Partition</th>
156 <th>Description</th>
157</tr>
158<tr>
110 <ti>/dev/sda1</ti> 159 <ti>/dev/sda1</ti>
111 <ti>ext3</ti>
112 <ti>&lt;2 GByte</ti>
113 <ti>/</ti> 160 <ti>/</ti>
114 <ti>
115 Root partition. For sun4c, sun4d and sun4m systems, some PROMs require
116 this partition to be less than 1 GBytes in size and the first
117 partition on the disk.
118 </ti>
119</tr> 161</tr>
120<tr> 162<tr>
121 <ti>/dev/sda2</ti> 163 <ti>/dev/sda2</ti>
122 <ti>swap</ti> 164 <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> 165</tr>
196<tr> 166<tr>
197 <ti>/dev/sda3</ti> 167 <ti>/dev/sda3</ti>
198 <ti>whole disk slice</ti> 168 <ti>whole disk slice</ti>
199</tr> 169</tr>
211</tr> 181</tr>
212</table> 182</table>
213 183
214<p> 184<p>
215Change the partition layout as required. Remember to keep the root partition 185Change 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 186entirely within the first 2 GB of the disk for older systems. There is also
217a 15-partition limit for SCSI and SATA. 187a 15-partition limit for SCSI and SATA.
218</p> 188</p>
219 189
220</body> 190</body>
221</subsection> 191</subsection>
259</pre> 229</pre>
260 230
261<p> 231<p>
262Note the <c>Sun disk label</c> in the output. If this is missing, the disk is 232Note 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> 233using the DOS-partitioning, not the Sun partitioning. In this case, use <c>s</c>
264to ensure that the disk has a sun partition table: 234to ensure that the disk has a Sun partition table:
265</p> 235</p>
266 236
267<pre caption="Creating a Sun Disklabel"> 237<pre caption="Creating a Sun Disklabel">
268Command (m for help): s 238Command (m for help): <i>s</i>
269Building a new sun disklabel. Changes will remain in memory only, 239Building a new sun disklabel. Changes will remain in memory only,
270until you decide to write them. After that, of course, the previous 240until you decide to write them. After that, of course, the previous
271content won't be recoverable. 241content won't be recoverable.
272 242
273Drive type 243Drive type
363 333
364<p> 334<p>
365We're ready to create the root partition. To do this, type <c>n</c> to create a 335We'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 336new 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 337the 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 338<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 339entire root partition fits within the first 2 GB of the disk. You can see
370output from these steps below: 340output from these steps below:
371</p> 341</p>
372 342
373<pre caption="Creating a root partition"> 343<pre caption="Creating a root partition">
374Command (m for help): <i>n</i> 344Command (m for help): <i>n</i>
400 370
401<p> 371<p>
402Next, let's create the swap partition. To do this, type <c>n</c> to create a new 372Next, 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> 373partition, 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 374in 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 375the 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 376you'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 377<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 378steps, typing <c>p</c> should display a partition table that looks similar to
409this: 379this:
410</p> 380</p>
430<p> 400<p>
431Finally, let's create the /usr, /var and /home partitions. As before, 401Finally, 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 402type <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 403third partition, <path>/dev/sda4</path> in our case. When prompted for the
434first cylinder, hit enter. When prompted for the last cylinder, enter 404first 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 405<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 406for <path>sda5</path> and <path>sda6</path>, using the desired sizes. Once
437you're done, you should see something like this: 407you're done, you should see something like this:
438</p> 408</p>
439 409
440<pre caption="Listing complete partition table"> 410<pre caption="Listing complete partition table">
465<pre caption="Save and exit fdisk"> 435<pre caption="Save and exit fdisk">
466Command (m for help): <i>w</i> 436Command (m for help): <i>w</i>
467</pre> 437</pre>
468 438
469<p> 439<p>
470Now that your partitions are created, you can now continue with <uri 440Now that your partitions are created, you can continue with <uri
471link="#filesystems">Creating Filesystems</uri>. 441link="#filesystems">Creating Filesystems</uri>.
472</p> 442</p>
473 443
474</body> 444</body>
475</subsection> 445</subsection>
488Otherwise, read on to learn about the available filesystems... 458Otherwise, read on to learn about the available filesystems...
489</p> 459</p>
490 460
491</body> 461</body>
492</subsection> 462</subsection>
493<subsection>
494<title>Filesystems?</title>
495<body>
496 463
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, providing metadata
515journaling for fast recovery in addition to other enhanced journaling modes
516like full data and ordered data journaling. It uses a hashed B*-tree index that
517enables high performance in almost all situations. Ext3 makes an excellent and
518reliable alternative to ext2.
519</p>
520
521</body>
522</subsection> 464<subsection>
465<include href="hb-install-filesystems.xml"/>
466</subsection>
467
523<subsection id="filesystems-apply"> 468<subsection id="filesystems-apply">
524<title>Applying a Filesystem to a Partition</title> 469<title>Applying a Filesystem to a Partition</title>
525<body> 470<body>
526 471
527<p> 472<p>
534 <th>Filesystem</th> 479 <th>Filesystem</th>
535 <th>Creation Command</th> 480 <th>Creation Command</th>
536</tr> 481</tr>
537<tr> 482<tr>
538 <ti>ext2</ti> 483 <ti>ext2</ti>
539 <ti><c>mke2fs</c></ti> 484 <ti><c>mkfs.ext2</c></ti>
540</tr> 485</tr>
541<tr> 486<tr>
542 <ti>ext3</ti> 487 <ti>ext3</ti>
543 <ti><c>mke2fs -j</c></ti> 488 <ti><c>mkfs.ext3</c></ti>
489</tr>
490<tr>
491 <ti>ext4</ti>
492 <ti><c>mkfs.ext4</c></ti>
544</tr> 493</tr>
545</table> 494</table>
546 495
547<p> 496<p>
548For instance, to create the root partition (<path>/dev/sda1</path> in our 497For instance, to create the root (<path>/dev/sda1</path> in our
549example) as ext2, and the <path>/usr</path>, <path>/var</path>, and 498example), <path>/usr</path>, <path>/var</path>, and
550<path>/home</path> partitions (<path>/dev/sda4</path>, <path>5</path> 499<path>/home</path> partitions (<path>/dev/sda4</path>, <path>5</path>
551and <path>6</path> in our example, respectively) as ext3, you would use: 500and <path>6</path> in our example, respectively) as ext4, you would use:
552</p> 501</p>
553 502
554<pre caption="Applying a filesystem on a partition"> 503<pre caption="Applying a filesystem on a partition">
555# <i>mke2fs /dev/sda1</i> 504# <i>mkfs.ext4 /dev/sda1</i>
556# <i>mke2fs -j -O dir_index /dev/sda4</i> 505# <i>mkfs.ext4 /dev/sda4</i>
557# <i>mke2fs -j -O dir_index /dev/sda5</i> 506# <i>mkfs.ext4 /dev/sda5</i>
558# <i>mke2fs -j -O dir_index /dev/sda6</i> 507# <i>mkfs.ext4 /dev/sda6</i>
559</pre> 508</pre>
560 509
561</body> 510</body>
562</subsection> 511</subsection>
563<subsection> 512<subsection>

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.20