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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Mon Apr 5 13:59:53 2004 UTC (10 years, 3 months ago) by neysx
Branch: MAIN
Changes since 1.1: +6 -5 lines
File MIME type: application/xml
Fixed mismatch root/boot & partition numbers

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6
7 <!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-disk.xml,v 1.1 2004/04/05 09:11:03 swift Exp $ -->
8
9 <sections>
10 <section>
11 <title>Introduction to Block Devices</title>
12 <subsection>
13 <title>Block Devices</title>
14 <body>
15
16 <p>
17 We'll take a good look at some of the disk-oriented aspects of Gentoo Linux
18 and Linux in general, including Linux filesystems, partitions, and block
19 devices. Then, once you're familiar with the ins and outs of disks and
20 filesystems, you'll be guided through the process of setting up partitions
21 and filesystems for your Gentoo Linux installation.
22 </p>
23
24 <p>
25 To begin, we introduce <e>block devices</e>. The most typical block device is
26 probably the one that represents the first SCSI hard disk in a Linux system,
27 namely <path>/dev/sda</path>.
28 </p>
29
30 <p>
31 Block devices represent an abstract interface to the disk. User programs can
32 use these block devices to interact with your disk without worrying about
33 whether your drives are IDE, SCSI, or something else. The program can simply
34 address the storage on the disk as a bunch of contiguous, randomly-accessible
35 512-byte blocks.
36 </p>
37
38 <p>
39 Block devices show up as entries in <path>/dev/</path>. Typically, the first
40 SCSI drive is named <path>/dev/sda</path>, the second <path>/dev/sdb</path>,
41 and so on. IDE drives are named similarly, however, they are prefixed by hd-
42 instead of sd-. If you are using IDE drives, the first one will be named
43 <path>/dev/hda</path>, the second <path>/dev/hdb</path>, and so on.
44 </p>
45
46 </body>
47 </subsection>
48 <subsection>
49 <title>Partitions</title>
50 <body>
51
52 <p>
53 Although it is theoretically possible to use the entire disk to house your Linux
54 system, this is almost never done in practice. Instead, full disk block devices
55 are split up in smaller, more manageable block devices. These are known as
56 <e>partitions</e> or <e>slices</e>.
57 </p>
58
59 <p>
60 The first partition on the first SCSI disk is <path>/dev/sda1</path>, the second
61 <path>/dev/sda2</path> and so on. Similarly, the first two partitions on the
62 first IDE disk are <path>/dev/hda1</path> and <path>/dev/hda2</path>.
63 </p>
64
65 <p>
66 The third partition on Sun systems is set aside as a special "whole disk"
67 slice. This partition must not contain a file system.
68 </p>
69
70 <p>
71 Users who are used to the DOS partitioning scheme should note that Sun
72 disklabels do not have "primary" and "extended" partitions. Instead, up to
73 eight partitions are available per drive, with the third of these being
74 reserved.
75 </p>
76
77 </body>
78 </subsection>
79 </section>
80 <section>
81 <title>Designing a Partitioning Scheme</title>
82 <subsection>
83 <title>Default Partitioning Scheme</title>
84 <body>
85
86 <p>
87 If you are not interested in drawing up a partitioning scheme,
88 the table below suggests a suitable starting point for most systems. For
89 IDE-based systems, substitute <c>hda</c> for <c>sda</c> in the following.
90 </p>
91
92 <p>
93 Note that a separate <path>/boot</path> partition is generally <e>not</e>
94 recommended on SPARC, as it complicates the bootloader configuration.
95 </p>
96
97 <table>
98 <tr>
99 <th>Partition</th>
100 <th>Filesystem</th>
101 <th>Size</th>
102 <th>Mount Point</th>
103 <th>Description</th>
104 </tr>
105 <tr>
106 <ti>/dev/sda1</ti>
107 <ti>ext3</ti>
108 <ti>&lt;2 GByte</ti>
109 <ti>/</ti>
110 <ti>Root partition. For all sparc32 systems, and sparc64 systems with older
111 OBP versions, this <e>must</e> be less than 2 GBytes in size, and the first
112 partition on the disk.</ti>
113 </tr>
114 <tr>
115 <ti>/dev/sda2</ti>
116 <ti>swap</ti>
117 <ti>512 MBytes</ti>
118 <ti>none</ti>
119 <ti>Swap partition. For bootstrap and certain larger compiles, at least 512
120 MBytes of RAM (including swap) is required.</ti>
121 </tr>
122 <tr>
123 <ti>/dev/sda3</ti>
124 <ti>none</ti>
125 <ti>Whole disk</ti>
126 <ti>none</ti>
127 <ti>Whole disk partition. This is required on SPARC systems.</ti>
128 </tr>
129 <tr>
130 <ti>/dev/sda4</ti>
131 <ti>ext3</ti>
132 <ti>at least 2 GBytes</ti>
133 <ti>/usr</ti>
134 <ti>/usr partition. Applications are installed here. By default this partition
135 is also used for portage data.</ti>
136 </tr>
137 <tr>
138 <ti>/dev/sda5</ti>
139 <ti>ext3</ti>
140 <ti>at least 1GByte</ti>
141 <ti>/var</ti>
142 <ti>/var partition. Used for program-generated data. By default portage uses
143 this partition for temporary space whilst compiling. Certain larger
144 applications such as Mozilla and OpenOffice.org can require over 1 GByte
145 of temporary space here when building.</ti>
146 </tr>
147 <tr>
148 <ti>/dev/sda6</ti>
149 <ti>ext3</ti>
150 <ti>remaining space</ti>
151 <ti>/home</ti>
152 <ti>/home partition. Used for users' home directories.</ti>
153 </tr>
154 </table>
155
156 </body>
157 </subsection>
158 </section>
159
160 <section id="fdisk">
161 <title>Using fdisk to Partition your Disk</title>
162 <subsection>
163 <body>
164
165 <p>
166 The following parts explain how to create the example partition layout described
167 previously, namely:
168 </p>
169
170 <table>
171 <tr>
172 <th>Partition</th>
173 <th>Description</th>
174 </tr>
175 <tr>
176 <ti>/dev/sda1</ti>
177 <ti>/</ti>
178 </tr>
179 <tr>
180 <ti>/dev/sda2</ti>
181 <ti>swap</ti>
182 </tr>
183 <tr>
184 <ti>/dev/sda3</ti>
185 <ti>whole disk slice</ti>
186 </tr>
187 <tr>
188 <ti>/dev/sda4</ti>
189 <ti>/usr</ti>
190 </tr>
191 <tr>
192 <ti>/dev/sda5</ti>
193 <ti>/var</ti>
194 </tr>
195 <tr>
196 <ti>/dev/sda6</ti>
197 <ti>/home</ti>
198 </tr>
199 </table>
200
201 <p>
202 Change the partition layout as required. Remember to keep the root partition
203 entirely within the first 2 GBytes of the disk for older systems.
204 </p>
205
206 </body>
207 </subsection>
208 <subsection>
209 <title>Firing up fdisk</title>
210 <body>
211
212 <p>
213 Start <c>fdisk</c> with your disk as argument:
214 </p>
215
216 <pre caption="Starting fdisk">
217 # <i>fdisk /dev/sda</i>
218 </pre>
219
220 <p>
221 You should be greeted with the fdisk prompt:
222 </p>
223
224 <pre caption="The fdisk prompt">
225 Command (m for help):
226 </pre>
227
228 <p>
229 To view the available partitions, type in <c>p</c>:
230 </p>
231
232 <pre caption="Listing available partitions">
233 Command (m for help): <i>p</i>
234
235 Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
236 Units = cylinders of 2048 * 512 bytes
237
238 Device Flag Start End Blocks Id System
239 /dev/sda1 0 488 499712 83 Linux native
240 /dev/sda2 488 976 499712 82 Linux swap
241 /dev/sda3 0 8635 8842240 5 Whole disk
242 /dev/sda4 976 1953 1000448 83 Linux native
243 /dev/sda5 1953 2144 195584 83 Linux native
244 /dev/sda6 2144 8635 6646784 83 Linux native
245 </pre>
246
247 <p>
248 Note the <c>Sun disk label</c> in the output. If this is missing, the disk is
249 using the DOS-partitioning, not the Sun partitioning. In this case, use <c>s</c>
250 to ensure that the disk has a sun partition table:
251 </p>
252
253 <pre caption="Creating a Sun Disklabel">
254 Command (m for help): s
255 Building a new sun disklabel. Changes will remain in memory only,
256 until you decide to write them. After that, of course, the previous
257 content won't be recoverable.
258
259 Drive type
260 ? auto configure
261 0 custom (with hardware detected defaults)
262 a Quantum ProDrive 80S
263 b Quantum ProDrive 105S
264 c CDC Wren IV 94171-344
265 d IBM DPES-31080
266 e IBM DORS-32160
267 f IBM DNES-318350
268 g SEAGATE ST34371
269 h SUN0104
270 i SUN0207
271 j SUN0327
272 k SUN0340
273 l SUN0424
274 m SUN0535
275 n SUN0669
276 o SUN1.0G
277 p SUN1.05
278 q SUN1.3G
279 r SUN2.1G
280 s IOMEGA Jaz
281 Select type (? for auto, 0 for custom): <i>0</i>
282 Heads (1-1024, default 64):
283 Using default value 64
284 Sectors/track (1-1024, default 32):
285 Using default value 32
286 Cylinders (1-65535, default 8635):
287 Using default value 8635
288 Alternate cylinders (0-65535, default 2):
289 Using default value 2
290 Physical cylinders (0-65535, default 8637):
291 Using default value 8637
292 Rotation speed (rpm) (1-100000, default 5400): <i>10000</i>
293 Interleave factor (1-32, default 1):
294 Using default value 1
295 Extra sectors per cylinder (0-32, default 0):
296 Using default value 0
297 </pre>
298
299 <p>
300 You can find the correct values in your disk's documentation. The
301 'auto configure' option does not usually work.
302 </p>
303
304 </body>
305 </subsection>
306 <subsection>
307 <title>Deleting Existing Partitions</title>
308 <body>
309
310 <p>
311 It's time to delete any existing partitions. To do this, type <c>d</c> and hit
312 Enter. You will then be prompted for the partition number you would like to
313 delete. To delete a pre-existing <path>/dev/sda1</path>, you would type:
314 </p>
315
316 <pre caption="Deleting a partition">
317 Command (m for help): <i>d</i>
318 Partition number (1-4): <i>1</i>
319 </pre>
320
321 <p>
322 <e>You should not delete partition 3 (whole disk).</e> This is required. If
323 this partition does not exist, follow the "Creating a Sun Disklabel"
324 instructions above.
325 </p>
326
327 <p>
328 After deleting all partitions except the Whole disk slice, you should have a
329 partition layout similar to the following:
330 </p>
331
332 <pre caption="View an empty partition scheme">
333 Command (m for help): <i>p</i>
334
335 Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
336 Units = cylinders of 2048 * 512 bytes
337
338 Device Flag Start End Blocks Id System
339 /dev/sda3 0 8635 8842240 5 Whole disk
340 </pre>
341
342
343 </body>
344 </subsection>
345
346 <subsection>
347 <title>Creating the Root Partition</title>
348 <body>
349
350 <p>
351 We're ready to create the root partition. To do this, type <c>n</c> to create a
352 new partition, then type <c>1</c> to create the partition. When prompted for the
353 first cylinder, hit enter. When prompted for the last cylinder, type <c>+512M</c>
354 to create a partition <c>512MBytes</c> in size. Make sure that the entire root
355 partition must be contained entirely within the first 2GBytes of the disk.
356 You can see output from these steps below:
357 </p>
358
359 <pre caption="Creating a root partition">
360 Command (m for help): <i>n</i>
361 Partition number (1-8): <i>1</i>
362 First cylinder (0-8635): <i>(press Enter)</i>
363 Last cylinder or +size or +sizeM or +sizeK (0-8635, default 8635): <i>+512M</i>
364 </pre>
365
366 <p>
367 Now, when you type <c>p</c>, you should see the following partition printout:
368 </p>
369
370 <pre caption="Listing the partition layout">
371 Command (m for help): <i>p</i>
372
373 Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
374 Units = cylinders of 2048 * 512 bytes
375
376 Device Flag Start End Blocks Id System
377 /dev/sda1 0 488 499712 83 Linux native
378 /dev/sda3 0 8635 8842240 5 Whole disk
379 </pre>
380
381 </body>
382 </subsection>
383 <subsection>
384 <title>Creating a swap partition</title>
385 <body>
386
387 <p>
388 Next, let's create the swap partition. To do this, type <c>n</c> to create a new
389 partition, then <c>2</c> to create the second partition, <path>/dev/sda2</path>
390 in our case. When prompted for the first cylinder, hit enter. When prompted for
391 the last cylinder, type <c>+512M</c> to create a partition 512MB in size. After
392 you've done this, type <c>t</c> to set the partition type, and then type in
393 <c>82</c> to set the partition type to "Linux Swap". After completing these
394 steps, typing <c>p</c> should display a partition table that looks similar to
395 this:
396 </p>
397
398 <pre caption="Listing of available partitions">
399 Command (m for help): <i>p</i>
400
401 Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
402 Units = cylinders of 2048 * 512 bytes
403
404 Device Flag Start End Blocks Id System
405 /dev/sda1 0 488 499712 83 Linux native
406 /dev/sda2 488 976 499712 82 Linux swap
407 /dev/sda3 0 8635 8842240 5 Whole disk
408 </pre>
409
410 </body>
411 </subsection>
412 <subsection>
413 <title>Creating the /usr, /var and /home partitions</title>
414 <body>
415
416 <p>
417 Finally, let's create the /usr, /var and /home partitions. As before,
418 type <c>n</c> to create a new partition, then type <c>4</c> to create the
419 third partition, <path>/dev/sda4</path> in our case. When prompted for the
420 first cylinder, hit enter. When prompted for the last cylinder, enter
421 <c>+2048M</c> to create a partition 2 GBytes in size. Repeat this process
422 for <path>sda5</path> and <path>sda6</path>, using the desired sizes. Once
423 you're done, you should see something like this:
424 </p>
425
426 <pre caption="Listing complete partition table">
427 Command (m for help): <i>p</i>
428
429 Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
430 Units = cylinders of 2048 * 512 bytes
431
432 Device Flag Start End Blocks Id System
433 /dev/sda1 0 488 499712 83 Linux native
434 /dev/sda2 488 976 499712 82 Linux swap
435 /dev/sda3 0 8635 8842240 5 Whole disk
436 /dev/sda4 976 1953 1000448 83 Linux native
437 /dev/sda5 1953 2144 195584 83 Linux native
438 /dev/sda6 2144 8635 6646784 83 Linux native
439 </pre>
440
441 </body>
442 </subsection>
443 <subsection>
444 <title>Save and Exit</title>
445 <body>
446
447 <p>
448 To save your partition layout and exit <c>fdisk</c>, type <c>w</c>:
449 </p>
450
451 <pre caption="Save and exit fdisk">
452 Command (m for help): <i>w</i>
453 </pre>
454
455 <p>
456 Now that your partitions are created, you can now continue with <uri
457 link="#filesystems">Creating Filesystems</uri>.
458 </p>
459
460 </body>
461 </subsection>
462 </section>
463 <section id="filesystems">
464 <title>Creating Filesystems</title>
465 <subsection>
466 <title>Introduction</title>
467 <body>
468
469 <p>
470 Now that your partitions are created, it is time to place a filesystem on them.
471 If you don't care about what filesystem to choose and are happy with what is
472 used as default in this handbook, continue with <uri
473 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
474 Otherwise, read on to learn about the available filesystems...
475 </p>
476
477 </body>
478 </subsection>
479 <subsection>
480 <title>Filesystems?</title>
481 <body>
482
483 <p>
484 Several filesystems are available, a few of which are known to be stable on the
485 SPARC architecture. Ext2 and ext3, for example, are known to work well.
486 Alternate filesystems may not function correctly.
487 </p>
488
489 <p>
490 <b>ext2</b> is the tried-and-true Linux filesystem. It does not support
491 journaling, which means that periodic checks of ext2 filesystems at startup
492 can be quite time-consuming. There is quite a selection of newer-generation
493 journaled filesystems that can be checked for consistency very quickly at
494 startup, and are therefore generally preferred over their non-journaled
495 counterparts. In general, journaled filesystems prevent long delays when a
496 system is booted and the filesystem is in an inconsistent state.
497 </p>
498
499 <p>
500 <b>ext3</b> is the journaled version of the ext2 filesystem. It provides
501 metadata journaling for fast recovery as well as other enhanced journaling
502 modes like full-data and ordered-data journaling. Ext3 has an additional hashed
503 b-tree indexing option that enables high performance in almost all situations.
504 Ext3 makes an excellent and reliable alternative to ext2.
505 </p>
506
507 <p>
508 <b>ReiserFS</b> works only partially on sparc64 systems and is therefore not
509 recommended for general use. <b>XFS</b> should be avoided, as it is known to
510 have many problems on SPARCs and could ruin your data. Another journaling
511 filesystem, <b>JFS</b>, is not supported. Regardless of your decision for
512 filesystems, the bootloader requires that the root partition be either ext2 or
513 ext3."
514 </p>
515
516 </body>
517 </subsection>
518 <subsection id="filesystems-apply">
519 <title>Applying a Filesystem to a Partition</title>
520 <body>
521
522 <p>
523 To create a filesystem on a partition or volume, tools specific to the chosen
524 filesystem are available:
525 </p>
526
527 <table>
528 <tr>
529 <th>Filesystem</th>
530 <th>Creation Command</th>
531 </tr>
532 <tr>
533 <ti>ext2</ti>
534 <ti><c>mke2fs</c></ti>
535 </tr>
536 <tr>
537 <ti>ext3</ti>
538 <ti><c>mke2fs -j</c></ti>
539 </tr>
540 <tr>
541 <ti>ext3 with hashed b-tree indexing (2.6 kernels only)</ti>
542 <ti><c>mke2fs -j -O dir_index</c></ti>
543 </tr>
544 </table>
545
546 <p>
547 For instance, to create the root partition (<path>/dev/sda1</path> in our
548 example) as ext2, and the <path>/usr</path>, <path>/var</path>, and
549 <path>/home</path> partitions (<path>/dev/sda4</path>, <path>5</path>
550 and <path>6</path> in our example, respectively) as ext3, you would use:
551 </p>
552
553 <pre caption="Applying a filesystem on a partition">
554 # <i>mke2fs /dev/sda1</i>
555 # <i>mke2fs -j /dev/sda4</i>
556 # <i>mke2fs -j /dev/sda5</i>
557 # <i>mke2fs -j /dev/sda6</i>
558 </pre>
559
560 </body>
561 </subsection>
562 <subsection>
563 <title>Activating the Swap Partition</title>
564 <body>
565
566 <p>
567 <c>mkswap</c> is the command used to initialize swap partitions:
568 </p>
569
570 <pre caption="Creating a Swap signature">
571 # <i>mkswap /dev/sda2</i>
572 </pre>
573
574 <p>
575 To activate the swap partition, use <c>swapon</c>:
576 </p>
577
578 <pre caption="Activating the swap partition">
579 # <i>swapon /dev/sda2</i>
580 </pre>
581
582 <p>
583 Create and activate the swap now.
584 </p>
585
586 </body>
587 </subsection>
588 </section>
589 <section>
590 <title>Mounting</title>
591 <body>
592
593 <p>
594 Now that your partitions are initialized and are housing a filesystem, it is
595 time to mount them using the <c>mount</c> command. Don't forget to first
596 create the necessary mount directories for every partition you created. For
597 example:
598 </p>
599
600 <pre caption="Mounting partitions">
601 # <i>mount /dev/sda1 /mnt/gentoo</i>
602 # <i>mkdir /mnt/gentoo/usr</i>
603 # <i>mount /dev/sda4 /mnt/gentoo/usr</i>
604 # <i>mkdir /mnt/gentoo/var</i>
605 # <i>mount /dev/sda5 /mnt/gentoo/var</i>
606 # <i>mkdir /mnt/gentoo/home</i>
607 # <i>mount /dev/sda6 /mnt/gentoo/home</i>
608 </pre>
609
610 <note>
611 If you want your <path>/tmp</path> to reside on a separate partition, be sure
612 to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
613 This also holds for <path>/var/tmp</path>.
614 </note>
615
616 <p>
617 We also need to mount the proc filesystem (a virtual interface with the kernel)
618 on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path>
619 mount point and then mount the filesystem:
620 </p>
621
622 <pre caption="Creating the /mnt/gentoo/proc mount point">
623 # <i>mkdir /mnt/gentoo/proc</i>
624 # <i>mount -t proc none /mnt/gentoo/proc</i>
625 </pre>
626
627 <p>
628 Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
629 Installation Files</uri>.
630 </p>
631
632 </body>
633 </section>
634 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20