/[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.10 - (show annotations) (download) (as text)
Tue Nov 9 13:01:52 2004 UTC (9 years, 10 months ago) by swift
Branch: MAIN
Changes since 1.9: +5 -1 lines
File MIME type: application/xml
Adding version/date information in pages

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

  ViewVC Help
Powered by ViewVC 1.1.20