/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-hppa-disk.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-hppa-disk.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Fri Apr 2 08:14:45 2004 UTC (10 years ago) by swift
Branch: MAIN
File MIME type: application/xml
#42823 - Separate architecture specific instructions in separate handbooks

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-hppa-disk.xml,v 1.1 2004/03/30 16:56:48 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 disk-oriented aspects of Gentoo Linux
18     and Linux in general, including Linux filesystems, partitions and block devices.
19     Then, once you're familiar with the ins and outs of disks and filesystems,
20     you'll be guided through the process of setting up partitions and filesystems
21     for your Gentoo Linux installation.
22     </p>
23    
24     <p>
25     To begin, we'll introduce <e>block devices</e>. The most famous block device is
26     probably the one that represents the first SCSI HD in a Linux system, namely
27     <path>/dev/sda</path>.
28     </p>
29    
30     <p>
31     The block devices above represent an abstract interface to the disk. User
32     programs can use these block devices to interact with your disk without worrying
33     about whether your drives are IDE, SCSI or something else. The program can
34     simply address the storage on the disk as a bunch of contiguous,
35     randomly-accessible 512-byte blocks.
36     </p>
37    
38     </body>
39     </subsection>
40     <subsection>
41     <title>Partitions and Slices</title>
42     <body>
43    
44     <p>
45     Although it is theoretically possible to use a full disk to house your Linux
46     system, this is almost never done in practice. Instead, full disk block devices
47     are split up in smaller, more manageable block devices. On most systems,
48     these are called <e>partitions</e>. Other architectures use a similar technique,
49     called <e>slices</e>.
50     </p>
51    
52     </body>
53     </subsection>
54     </section>
55     <section>
56     <title>Designing a Partitioning Scheme</title>
57     <subsection>
58     <title>How Many and How Big?</title>
59     <body>
60    
61     <p>
62     The number of partitions is highly dependent on your environment. For instance,
63     if you have lots of users, you will most likely want to have your
64     <path>/home</path> separate as it increases security and makes backups easier.
65     If you are installing Gentoo to perform as a mailserver, your
66     <path>/var</path> should be separate as all mails are stored inside
67     <path>/var</path>. A good choice of filesystem will then maximise your
68     performance. Gameservers will have a separate <path>/opt</path> as most gaming
69     servers are installed there. The reason is similar for <path>/home</path>:
70     security and backups.
71     </p>
72    
73     <p>
74     As you can see, it very much depends on what you want to achieve. Separate
75     partitions or volumes have the following advantages:
76     </p>
77    
78     <ul>
79     <li>
80     You can choose the most performant filesystem for each partition or volume
81     </li>
82     <li>
83     Your entire system cannot run out of free space if one defunct tool is
84     continuously writing files to a partition or volume
85     </li>
86     <li>
87     If necessary, file system checks are reduced in time, as multiple checks can
88     be done in parallel (although this advantage is more with multiple disks than
89     it is with multiple partitions)
90     </li>
91     <li>
92     Security can be enhanced by mounting some partitions or volumes read-only,
93     nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
94     </li>
95     </ul>
96    
97     <p>
98     However, multiple partitions have one big disadvantage: if not configured
99     properly, you might result in having a system with lots
100     of free space on one partition and none on another.
101     </p>
102    
103     </body>
104     </subsection>
105     </section>
106     <section>
107     <title>Using fdisk on HPPA to Partition your Disk</title>
108     <body>
109    
110     <p>
111     Use <c>fdisk</c> to create the partitions you want:
112     </p>
113    
114     <pre caption="Partitioning the disk">
115     # <i>fdisk /dev/sda</i>
116     </pre>
117    
118     <p>
119     PALO needs a special partition to work. You have to create a partition of at
120     least 16Mb at the beginning of your disk. The partition type must be of type
121     <e>f0</e> (Linux/PA-RISC boot).
122     </p>
123    
124     <impo>
125     If you ignore this and continue without a special PALO partition, your system
126     will stop loving you and fail to start.
127     </impo>
128    
129     <p>
130     Also, if your disk is larger than 2Gb, make sure that the boot partition is in
131     the first 2Gb of your disk. PALO is unable to read a kernel after the 2Gb limit.
132     </p>
133    
134     <p>
135     Now that your partitions are created, you can now continue with <uri
136     link="#filesystems">Creating Filesystems</uri>.
137     </p>
138    
139     </body>
140     </section>
141     <section id="filesystems">
142     <title>Creating Filesystems</title>
143     <subsection>
144     <title>Introduction</title>
145     <body>
146    
147     <p>
148     Now that your partitions are created, it is time to place a filesystem on them.
149     If you don't care about what filesystem to choose and are happy with what we use
150     as default in this handbook, continue with <uri
151     link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
152     Otherwise read on to learn about the available filesystems...
153     </p>
154    
155     </body>
156     </subsection>
157     <subsection>
158     <title>Filesystems?</title>
159     <body>
160    
161     <p>
162     Several filesystems are available. Ext2, ext3 and reiserfs are found stable on
163     the HPPA architecture. The others are very experimental.
164     </p>
165    
166     <p>
167     <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
168     journaling, which means that routine ext2 filesystem checks at startup time can
169     be quite time-consuming. There is now quite a selection of newer-generation
170     journaled filesystems that can be checked for consistency very quickly and are
171     thus generally preferred over their non-journaled counterparts. Journaled
172     filesystems prevent long delays when you boot your system and your filesystem
173     happens to be in an inconsistent state.
174     </p>
175    
176     <p>
177     <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
178     journaling for fast recovery in addition to other enhanced journaling modes like
179     full data and ordered data journaling. ext3 is a very good and reliable
180     filesystem. It has an additional hashed b-tree indexing option that enables
181     high performance in almost all situations. In short, ext3 is an excellent
182     filesystem.
183     </p>
184    
185     <p>
186     <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
187     performance and greatly outperforms both ext2 and ext3 when dealing with small
188     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
189     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
190     solid and usable as both general-purpose filesystem and for extreme cases such
191     as the creation of large filesystems, the use of many small files, very large
192     files and directories containing tens of thousands of files.
193     </p>
194    
195     <p>
196     <b>XFS</b> is a filesystem with metadata journaling that is fully supported
197     under Gentoo Linux's xfs-sources kernel. It comes with a robust feature-set and
198     is optimized for scalability. We only recommend using this filesystem on Linux
199     systems with high-end SCSI and/or fibre channel storage and a uninterruptible
200     power supply. Because XFS aggressively caches in-transit data in RAM, improperly
201     designed programs (those that don't take proper precautions when writing files
202     to disk and there are quite a few of them) can lose a good deal of data if the
203     system goes down unexpectedly.
204     </p>
205    
206     <p>
207     <b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
208     become production-ready and there hasn't been a sufficient track record to
209     comment positively nor negatively on its general stability at this point.
210     </p>
211    
212     </body>
213     </subsection>
214     <subsection id="filesystems-apply">
215     <title>Applying a Filesystem to a Partition</title>
216     <body>
217    
218     <p>
219     To create a filesystem on a partition or volume, there are tools available for
220     each possible filesystem:
221     </p>
222    
223     <table>
224     <tr>
225     <th>Filesystem</th>
226     <th>Creation Command</th>
227     </tr>
228     <tr>
229     <ti>ext2</ti>
230     <ti><c>mke2fs</c></ti>
231     </tr>
232     <tr>
233     <ti>ext3</ti>
234     <ti><c>mke2fs -j</c></ti>
235     </tr>
236     <tr>
237     <ti>reiserfs</ti>
238     <ti><c>mkreiserfs</c></ti>
239     </tr>
240     <tr>
241     <ti>xfs</ti>
242     <ti><c>mkfs.xfs</c></ti>
243     </tr>
244     <tr>
245     <ti>jfs</ti>
246     <ti><c>mkfs.jfs</c></ti>
247     </tr>
248     </table>
249    
250     <p>
251     For instance, to have the boot partition (<path>/dev/sda1</path> in our
252     example) in ext2 and the root partition (<path>/dev/sda3</path> in our example)
253     in ext3 (as in our example), you would use:
254     </p>
255    
256     <pre caption="Applying a filesystem on a partition">
257     # <i>mke2fs /dev/sda1</i>
258     # <i>mke2fs -j /dev/sda3</i>
259     </pre>
260    
261     <p>
262     Now create the filesystems on your newly created partitions (or logical
263     volumes).
264     </p>
265    
266     </body>
267     </subsection>
268     <subsection>
269     <title>Activating the Swap Partition</title>
270     <body>
271    
272     <p>
273     <c>mkswap</c> is the command that is used to initialize swap partitions:
274     </p>
275    
276     <pre caption="Creating a Swap signature">
277     # <i>mkswap /dev/sda2</i>
278     </pre>
279    
280     <p>
281     To activate the swap partition, use <c>swapon</c>:
282     </p>
283    
284     <pre caption="Activating the swap partition">
285     # <i>swapon /dev/sda2</i>
286     </pre>
287    
288     <p>
289     Create and activate the swap now.
290     </p>
291    
292     </body>
293     </subsection>
294     </section>
295     <section>
296     <title>Mounting</title>
297     <body>
298    
299     <p>
300     Now that your partitions are initialized and are housing a filesystem, it is
301     time to mount those partitions. Use the <c>mount</c> command. Don't forget to
302     create the necessary mount directories for every partition you created. As an
303     example we mount the root and boot partition:
304     </p>
305    
306     <pre caption="Mounting partitions">
307     # <i>mount /dev/sda3 /mnt/gentoo</i>
308     # <i>mkdir /mnt/gentoo/boot</i>
309     # <i>mount /dev/sda1 /mnt/gentoo/boot</i>
310     </pre>
311    
312     <note>
313     If you want your <path>/tmp</path> to reside on a separate partition, be sure to
314     change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
315     also holds for <path>/var/tmp</path>.
316     </note>
317    
318     <p>
319     We also need to mount the proc filesystem (a virtual interface with the kernel)
320     on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path>
321     mountpoint and then mount the filesystem:
322     </p>
323    
324     <pre caption="Creating the /mnt/gentoo/proc mountpoint">
325     # <i>mkdir /mnt/gentoo/proc</i>
326     # <i>mount -t proc none /mnt/gentoo/proc</i>
327     </pre>
328    
329     <p>
330     Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
331     Installation Files</uri>.
332     </p>
333    
334     </body>
335     </section>
336     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20