/[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.25 - (hide annotations) (download) (as text)
Wed Aug 30 22:52:28 2006 UTC (8 years ago) by nightmorph
Branch: MAIN
Changes since 1.24: +4 -11 lines
File MIME type: application/xml
2006.1 networked docs are in. portage handbook still untouched per separate bugs. thanks to all the hard work, guys. blame me if something is wrong (and please fix quickly) :)

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 swift 1.20 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.1
7 nightmorph 1.25 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-sparc-disk.xml,v 1.24 2005/10/02 17:18:14 swift Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.10
11 nightmorph 1.25 <version>2.5</version> <date>2005-10-02</date>
12 swift 1.10
13 swift 1.1 <section>
14     <title>Introduction to Block Devices</title>
15     <subsection>
16     <title>Block Devices</title>
17     <body>
18    
19     <p>
20     We'll take a good look at some of the disk-oriented aspects of Gentoo Linux
21     and Linux in general, including Linux filesystems, partitions, and block
22     devices. Then, once you're familiar with the ins and outs of disks and
23     filesystems, you'll be guided through the process of setting up partitions
24     and filesystems for your Gentoo Linux installation.
25     </p>
26    
27     <p>
28     To begin, we introduce <e>block devices</e>. The most typical block device is
29     probably the one that represents the first SCSI hard disk in a Linux system,
30     namely <path>/dev/sda</path>.
31     </p>
32    
33     <p>
34     Block devices represent an abstract interface to the disk. User programs can
35     use these block devices to interact with your disk without worrying about
36     whether your drives are IDE, SCSI, or something else. The program can simply
37     address the storage on the disk as a bunch of contiguous, randomly-accessible
38     512-byte blocks.
39     </p>
40    
41     <p>
42     Block devices show up as entries in <path>/dev/</path>. Typically, the first
43     SCSI drive is named <path>/dev/sda</path>, the second <path>/dev/sdb</path>,
44     and so on. IDE drives are named similarly, however, they are prefixed by hd-
45     instead of sd-. If you are using IDE drives, the first one will be named
46     <path>/dev/hda</path>, the second <path>/dev/hdb</path>, and so on.
47     </p>
48    
49     </body>
50     </subsection>
51     <subsection>
52     <title>Partitions</title>
53     <body>
54    
55     <p>
56     Although it is theoretically possible to use the entire disk to house your Linux
57     system, this is almost never done in practice. Instead, full disk block devices
58     are split up in smaller, more manageable block devices. These are known as
59     <e>partitions</e> or <e>slices</e>.
60     </p>
61    
62     <p>
63     The first partition on the first SCSI disk is <path>/dev/sda1</path>, the second
64     <path>/dev/sda2</path> and so on. Similarly, the first two partitions on the
65     first IDE disk are <path>/dev/hda1</path> and <path>/dev/hda2</path>.
66     </p>
67    
68     <p>
69     The third partition on Sun systems is set aside as a special "whole disk"
70     slice. This partition must not contain a file system.
71     </p>
72    
73     <p>
74     Users who are used to the DOS partitioning scheme should note that Sun
75     disklabels do not have "primary" and "extended" partitions. Instead, up to
76     eight partitions are available per drive, with the third of these being
77     reserved.
78     </p>
79    
80     </body>
81     </subsection>
82     </section>
83     <section>
84     <title>Designing a Partitioning Scheme</title>
85     <subsection>
86     <title>Default Partitioning Scheme</title>
87     <body>
88    
89     <p>
90     If you are not interested in drawing up a partitioning scheme,
91     the table below suggests a suitable starting point for most systems. For
92     IDE-based systems, substitute <c>hda</c> for <c>sda</c> in the following.
93     </p>
94    
95     <p>
96     Note that a separate <path>/boot</path> partition is generally <e>not</e>
97     recommended on SPARC, as it complicates the bootloader configuration.
98     </p>
99    
100     <table>
101     <tr>
102     <th>Partition</th>
103     <th>Filesystem</th>
104     <th>Size</th>
105     <th>Mount Point</th>
106     <th>Description</th>
107     </tr>
108     <tr>
109     <ti>/dev/sda1</ti>
110     <ti>ext3</ti>
111     <ti>&lt;2 GByte</ti>
112     <ti>/</ti>
113 bennyc 1.3 <ti>
114 swift 1.24 Root partition. For sun4c, sun4d and sun4m systems, some PROMs require
115     this partition to be less than 1 GBytes in size and the first
116 bennyc 1.3 partition on the disk.
117     </ti>
118 swift 1.1 </tr>
119     <tr>
120     <ti>/dev/sda2</ti>
121     <ti>swap</ti>
122     <ti>512 MBytes</ti>
123     <ti>none</ti>
124 bennyc 1.3 <ti>
125     Swap partition. For bootstrap and certain larger compiles, at least 512
126     MBytes of RAM (including swap) is required.
127     </ti>
128 swift 1.1 </tr>
129     <tr>
130     <ti>/dev/sda3</ti>
131     <ti>none</ti>
132     <ti>Whole disk</ti>
133     <ti>none</ti>
134     <ti>Whole disk partition. This is required on SPARC systems.</ti>
135     </tr>
136     <tr>
137     <ti>/dev/sda4</ti>
138     <ti>ext3</ti>
139     <ti>at least 2 GBytes</ti>
140     <ti>/usr</ti>
141 bennyc 1.3 <ti>
142     /usr partition. Applications are installed here. By default this partition
143 swift 1.20 is also used for Portage data (which takes around 500 Mbyte excluding
144     source code).
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 neysx 1.23 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
366     the first cylinder, hit enter. When prompted for the last cylinder, type
367     <c>+512M</c> to create a partition <c>512MBytes</c> in size. Make sure that the
368     entire root partition fits within the first 2GBytes of the disk. You can see
369     output from these steps below:
370 swift 1.1 </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 nightmorph 1.25 modes like full-data and ordered-data journaling. Ext3 makes an excellent and
516     reliable alternative to ext2.
517 swift 1.1 </p>
518    
519     </body>
520     </subsection>
521     <subsection id="filesystems-apply">
522     <title>Applying a Filesystem to a Partition</title>
523     <body>
524    
525     <p>
526     To create a filesystem on a partition or volume, tools specific to the chosen
527     filesystem are available:
528     </p>
529    
530     <table>
531     <tr>
532     <th>Filesystem</th>
533     <th>Creation Command</th>
534     </tr>
535     <tr>
536     <ti>ext2</ti>
537     <ti><c>mke2fs</c></ti>
538     </tr>
539     <tr>
540     <ti>ext3</ti>
541     <ti><c>mke2fs -j</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 swift 1.17 Create and activate the swap with the commands mentioned above.
583 swift 1.1 </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 neysx 1.2 # <i>mount /dev/sda5 /mnt/gentoo/var</i>
605 swift 1.1 # <i>mkdir /mnt/gentoo/home</i>
606 neysx 1.2 # <i>mount /dev/sda6 /mnt/gentoo/home</i>
607 swift 1.1 </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 swift 1.5 We will also have to mount the proc filesystem (a virtual interface with the
617     kernel) on <path>/proc</path>. But first we will need to place our files on the partitions.
618 swift 1.1 </p>
619    
620     <p>
621 swift 1.5 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
622 swift 1.1 Installation Files</uri>.
623     </p>
624    
625     </body>
626     </section>
627     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20