/[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.4 - (show annotations) (download) (as text)
Wed Apr 28 07:52:30 2004 UTC (10 years, 5 months ago) by swift
Branch: MAIN
Changes since 1.3: +5 -1 lines
File MIME type: application/xml
2004.1 release. Moving docs from draft/ to correct space. Hopefully this goes without any issues *crosses fingers*

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

  ViewVC Help
Powered by ViewVC 1.1.20