/[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.1 - (hide annotations) (download) (as text)
Mon Apr 5 09:11:03 2004 UTC (10 years, 5 months ago) by swift
Branch: MAIN
File MIME type: application/xml
Adding Gentoo/SPARC instructions atomically

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     <!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-sparc-disk.xml,v 1.4 2004/04/05 08:17:49 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 boot
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 boot 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     </body>
381     </subsection>
382     <subsection>
383     <title>Creating a swap partition</title>
384     <body>
385    
386     <p>
387     Next, let's create the swap partition. To do this, type <c>n</c> to create a new
388     partition, then <c>2</c> to create the second partition, <path>/dev/sda2</path>
389     in our case. When prompted for the first cylinder, hit enter. When prompted for
390     the last cylinder, type <c>+512M</c> to create a partition 512MB in size. After
391     you've done this, type <c>t</c> to set the partition type, and then type in
392     <c>82</c> to set the partition type to "Linux Swap". After completing these
393     steps, typing <c>p</c> should display a partition table that looks similar to
394     this:
395     </p>
396    
397     <pre caption="Listing of available partitions">
398     Command (m for help): <i>p</i>
399    
400     Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
401     Units = cylinders of 2048 * 512 bytes
402    
403     Device Flag Start End Blocks Id System
404     /dev/sda1 0 488 499712 83 Linux native
405     /dev/sda2 488 976 499712 82 Linux swap
406     /dev/sda3 0 8635 8842240 5 Whole disk
407     </pre>
408    
409     </body>
410     </subsection>
411     <subsection>
412     <title>Creating the /usr, /var and /home partitions</title>
413     <body>
414    
415     <p>
416     Finally, let's create the /usr, /var and /home partitions. As before,
417     type <c>n</c> to create a new partition, then type <c>4</c> to create the
418     third partition, <path>/dev/sda4</path> in our case. When prompted for the
419     first cylinder, hit enter. When prompted for the last cylinder, enter
420     <c>+2048M</c> to create a partition 2 GBytes in size. Repeat this process
421     for <path>sda5</path> and <path>sda6</path>, using the desired sizes. Once
422     you're done, you should see something like this:
423     </p>
424    
425     <pre caption="Listing complete partition table">
426     Command (m for help): <i>p</i>
427    
428     Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders
429     Units = cylinders of 2048 * 512 bytes
430    
431     Device Flag Start End Blocks Id System
432     /dev/sda1 0 488 499712 83 Linux native
433     /dev/sda2 488 976 499712 82 Linux swap
434     /dev/sda3 0 8635 8842240 5 Whole disk
435     /dev/sda4 976 1953 1000448 83 Linux native
436     /dev/sda5 1953 2144 195584 83 Linux native
437     /dev/sda6 2144 8635 6646784 83 Linux native
438     </pre>
439    
440     </body>
441     </subsection>
442     <subsection>
443     <title>Save and Exit</title>
444     <body>
445    
446     <p>
447     To save your partition layout and exit <c>fdisk</c>, type <c>w</c>:
448     </p>
449    
450     <pre caption="Save and exit fdisk">
451     Command (m for help): <i>w</i>
452     </pre>
453    
454     <p>
455     Now that your partitions are created, you can now continue with <uri
456     link="#filesystems">Creating Filesystems</uri>.
457     </p>
458    
459     </body>
460     </subsection>
461     </section>
462     <section id="filesystems">
463     <title>Creating Filesystems</title>
464     <subsection>
465     <title>Introduction</title>
466     <body>
467    
468     <p>
469     Now that your partitions are created, it is time to place a filesystem on them.
470     If you don't care about what filesystem to choose and are happy with what is
471     used as default in this handbook, continue with <uri
472     link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
473     Otherwise, read on to learn about the available filesystems...
474     </p>
475    
476     </body>
477     </subsection>
478     <subsection>
479     <title>Filesystems?</title>
480     <body>
481    
482     <p>
483     Several filesystems are available, a few of which are known to be stable on the
484     SPARC architecture. Ext2 and ext3, for example, are known to work well.
485     Alternate filesystems may not function correctly.
486     </p>
487    
488     <p>
489     <b>ext2</b> is the tried-and-true Linux filesystem. It does not support
490     journaling, which means that periodic checks of ext2 filesystems at startup
491     can be quite time-consuming. There is quite a selection of newer-generation
492     journaled filesystems that can be checked for consistency very quickly at
493     startup, and are therefore generally preferred over their non-journaled
494     counterparts. In general, journaled filesystems prevent long delays when a
495     system is booted and the filesystem is in an inconsistent state.
496     </p>
497    
498     <p>
499     <b>ext3</b> is the journaled version of the ext2 filesystem. It provides
500     metadata journaling for fast recovery as well as other enhanced journaling
501     modes like full-data and ordered-data journaling. Ext3 has an additional hashed
502     b-tree indexing option that enables high performance in almost all situations.
503     Ext3 makes an excellent and reliable alternative to ext2.
504     </p>
505    
506     <p>
507     <b>ReiserFS</b> works only partially on sparc64 systems and is therefore not
508     recommended for general use. <b>XFS</b> should be avoided, as it is known to
509     have many problems on SPARCs and could ruin your data. Another journaling
510     filesystem, <b>JFS</b>, is not supported. Regardless of your decision for
511     filesystems, the bootloader requires that the root partition be either ext2 or
512     ext3."
513     </p>
514    
515     </body>
516     </subsection>
517     <subsection id="filesystems-apply">
518     <title>Applying a Filesystem to a Partition</title>
519     <body>
520    
521     <p>
522     To create a filesystem on a partition or volume, tools specific to the chosen
523     filesystem are available:
524     </p>
525    
526     <table>
527     <tr>
528     <th>Filesystem</th>
529     <th>Creation Command</th>
530     </tr>
531     <tr>
532     <ti>ext2</ti>
533     <ti><c>mke2fs</c></ti>
534     </tr>
535     <tr>
536     <ti>ext3</ti>
537     <ti><c>mke2fs -j</c></ti>
538     </tr>
539     <tr>
540     <ti>ext3 with hashed b-tree indexing (2.6 kernels only)</ti>
541     <ti><c>mke2fs -j -O dir_index</c></ti>
542     </tr>
543     </table>
544    
545     <p>
546     For instance, to create the root partition (<path>/dev/sda1</path> in our
547     example) as ext2, and the <path>/usr</path>, <path>/var</path>, and
548     <path>/home</path> partitions (<path>/dev/sda4</path>, <path>5</path>
549     and <path>6</path> in our example, respectively) as ext3, you would use:
550     </p>
551    
552     <pre caption="Applying a filesystem on a partition">
553     # <i>mke2fs /dev/sda1</i>
554     # <i>mke2fs -j /dev/sda4</i>
555     # <i>mke2fs -j /dev/sda5</i>
556     # <i>mke2fs -j /dev/sda6</i>
557     </pre>
558    
559     </body>
560     </subsection>
561     <subsection>
562     <title>Activating the Swap Partition</title>
563     <body>
564    
565     <p>
566     <c>mkswap</c> is the command used to initialize swap partitions:
567     </p>
568    
569     <pre caption="Creating a Swap signature">
570     # <i>mkswap /dev/sda2</i>
571     </pre>
572    
573     <p>
574     To activate the swap partition, use <c>swapon</c>:
575     </p>
576    
577     <pre caption="Activating the swap partition">
578     # <i>swapon /dev/sda2</i>
579     </pre>
580    
581     <p>
582     Create and activate the swap now.
583     </p>
584    
585     </body>
586     </subsection>
587     </section>
588     <section>
589     <title>Mounting</title>
590     <body>
591    
592     <p>
593     Now that your partitions are initialized and are housing a filesystem, it is
594     time to mount them using the <c>mount</c> command. Don't forget to first
595     create the necessary mount directories for every partition you created. For
596     example:
597     </p>
598    
599     <pre caption="Mounting partitions">
600     # <i>mount /dev/sda1 /mnt/gentoo</i>
601     # <i>mkdir /mnt/gentoo/usr</i>
602     # <i>mount /dev/sda4 /mnt/gentoo/usr</i>
603     # <i>mkdir /mnt/gentoo/var</i>
604     # <i>mount /dev/sda4 /mnt/gentoo/var</i>
605     # <i>mkdir /mnt/gentoo/home</i>
606     # <i>mount /dev/sda4 /mnt/gentoo/home</i>
607     </pre>
608    
609     <note>
610     If you want your <path>/tmp</path> to reside on a separate partition, be sure
611     to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
612     This also holds for <path>/var/tmp</path>.
613     </note>
614    
615     <p>
616     We also need to mount the proc filesystem (a virtual interface with the kernel)
617     on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path>
618     mount point and then mount the filesystem:
619     </p>
620    
621     <pre caption="Creating the /mnt/gentoo/proc mount point">
622     # <i>mkdir /mnt/gentoo/proc</i>
623     # <i>mount -t proc none /mnt/gentoo/proc</i>
624     </pre>
625    
626     <p>
627     Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
628     Installation Files</uri>.
629     </p>
630    
631     </body>
632     </section>
633     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20