/[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.6 - (hide annotations) (download) (as text)
Sun Aug 29 12:17:07 2004 UTC (9 years, 7 months ago) by swift
Branch: MAIN
Changes since 1.5: +3 -2 lines
File MIME type: application/xml
#61651 - Tell the user that there is a 15-partition limit for SCSI

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

  ViewVC Help
Powered by ViewVC 1.1.20