/[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.16 - (hide annotations) (download) (as text)
Sun Jan 30 10:43:45 2005 UTC (9 years, 2 months ago) by neysx
Branch: MAIN
Changes since 1.15: +3 -3 lines
File MIME type: application/xml
Bumped version/date

1 swift 1.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 neysx 1.16 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-disk.xml,v 1.15 2005/01/25 21:02:06 swift Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.10
11 neysx 1.16 <version>1.10</version>
12     <date>2005-01-25</date>
13 swift 1.10
14 swift 1.1 <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 bennyc 1.3 <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 swift 1.1 </tr>
120     <tr>
121     <ti>/dev/sda2</ti>
122     <ti>swap</ti>
123     <ti>512 MBytes</ti>
124     <ti>none</ti>
125 bennyc 1.3 <ti>
126     Swap partition. For bootstrap and certain larger compiles, at least 512
127     MBytes of RAM (including swap) is required.
128     </ti>
129 swift 1.1 </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 bennyc 1.3 <ti>
143     /usr partition. Applications are installed here. By default this partition
144 swift 1.9 is also used for Portage data.
145 bennyc 1.3 </ti>
146 swift 1.1 </tr>
147     <tr>
148     <ti>/dev/sda5</ti>
149     <ti>ext3</ti>
150     <ti>at least 1GByte</ti>
151     <ti>/var</ti>
152 bennyc 1.3 <ti>
153 swift 1.9 /var partition. Used for program-generated data. By default Portage uses
154 bennyc 1.3 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 swift 1.1 </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 swift 1.6 entirely within the first 2 GBytes of the disk for older systems. There is also
216 swift 1.8 a 15-partition limit for SCSI and SATA.
217 swift 1.1 </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 neysx 1.2 to create a partition <c>512MBytes</c> in size. Make sure that the entire root
368 swift 1.1 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 neysx 1.2 <pre caption="Creating a root partition">
373 swift 1.1 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 neysx 1.2
394 swift 1.1 </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 neysx 1.7 Several filesystems are available, some are known to be stable on the
498 swift 1.1 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     </body>
521     </subsection>
522     <subsection id="filesystems-apply">
523     <title>Applying a Filesystem to a Partition</title>
524     <body>
525    
526     <p>
527     To create a filesystem on a partition or volume, tools specific to the chosen
528     filesystem are available:
529     </p>
530    
531     <table>
532     <tr>
533     <th>Filesystem</th>
534     <th>Creation Command</th>
535     </tr>
536     <tr>
537     <ti>ext2</ti>
538     <ti><c>mke2fs</c></ti>
539     </tr>
540     <tr>
541     <ti>ext3</ti>
542     <ti><c>mke2fs -j</c></ti>
543     </tr>
544     <tr>
545     <ti>ext3 with hashed b-tree indexing (2.6 kernels only)</ti>
546     <ti><c>mke2fs -j -O dir_index</c></ti>
547     </tr>
548     </table>
549    
550     <p>
551     For instance, to create the root partition (<path>/dev/sda1</path> in our
552     example) as ext2, and the <path>/usr</path>, <path>/var</path>, and
553     <path>/home</path> partitions (<path>/dev/sda4</path>, <path>5</path>
554     and <path>6</path> in our example, respectively) as ext3, you would use:
555     </p>
556    
557     <pre caption="Applying a filesystem on a partition">
558     # <i>mke2fs /dev/sda1</i>
559     # <i>mke2fs -j /dev/sda4</i>
560     # <i>mke2fs -j /dev/sda5</i>
561     # <i>mke2fs -j /dev/sda6</i>
562     </pre>
563    
564     </body>
565     </subsection>
566     <subsection>
567     <title>Activating the Swap Partition</title>
568     <body>
569    
570     <p>
571     <c>mkswap</c> is the command used to initialize swap partitions:
572     </p>
573    
574     <pre caption="Creating a Swap signature">
575     # <i>mkswap /dev/sda2</i>
576     </pre>
577    
578     <p>
579     To activate the swap partition, use <c>swapon</c>:
580     </p>
581    
582     <pre caption="Activating the swap partition">
583     # <i>swapon /dev/sda2</i>
584     </pre>
585    
586     <p>
587     Create and activate the swap now.
588     </p>
589    
590     </body>
591     </subsection>
592     </section>
593     <section>
594     <title>Mounting</title>
595     <body>
596    
597     <p>
598     Now that your partitions are initialized and are housing a filesystem, it is
599     time to mount them using the <c>mount</c> command. Don't forget to first
600     create the necessary mount directories for every partition you created. For
601     example:
602     </p>
603    
604     <pre caption="Mounting partitions">
605     # <i>mount /dev/sda1 /mnt/gentoo</i>
606     # <i>mkdir /mnt/gentoo/usr</i>
607     # <i>mount /dev/sda4 /mnt/gentoo/usr</i>
608     # <i>mkdir /mnt/gentoo/var</i>
609 neysx 1.2 # <i>mount /dev/sda5 /mnt/gentoo/var</i>
610 swift 1.1 # <i>mkdir /mnt/gentoo/home</i>
611 neysx 1.2 # <i>mount /dev/sda6 /mnt/gentoo/home</i>
612 swift 1.1 </pre>
613    
614     <note>
615     If you want your <path>/tmp</path> to reside on a separate partition, be sure
616     to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
617     This also holds for <path>/var/tmp</path>.
618     </note>
619    
620     <p>
621 swift 1.5 We will also have to mount the proc filesystem (a virtual interface with the
622     kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
623 swift 1.1 </p>
624    
625     <p>
626 swift 1.5 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
627 swift 1.1 Installation Files</uri>.
628     </p>
629    
630     </body>
631     </section>
632     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20