/[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.5 - (hide annotations) (download) (as text)
Mon Jul 26 09:04:42 2004 UTC (10 years ago) by dertobi123
Branch: MAIN
Changes since 1.4: +2 -2 lines
File MIME type: application/xml
Move over files from the draft/ directory. 2004.2 is released :)

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 dertobi123 1.5 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-hppa-disk.xml,v 1.4 2004/07/19 10:12:55 dertobi123 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 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 neysx 1.3 You can choose the best performing filesystem for each partition or volume
81 swift 1.1 </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 dertobi123 1.2 will stop loving you and fail to start. Also, if your disk is larger than 2Gb,
127     make sure that the boot partition is in the first 2Gb of your disk. PALO is
128     unable to read a kernel after the 2Gb limit.
129 swift 1.1 </impo>
130    
131     <p>
132     Now that your partitions are created, you can now continue with <uri
133     link="#filesystems">Creating Filesystems</uri>.
134     </p>
135    
136     </body>
137     </section>
138     <section id="filesystems">
139     <title>Creating Filesystems</title>
140     <subsection>
141     <title>Introduction</title>
142     <body>
143    
144     <p>
145     Now that your partitions are created, it is time to place a filesystem on them.
146     If you don't care about what filesystem to choose and are happy with what we use
147     as default in this handbook, continue with <uri
148     link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
149     Otherwise read on to learn about the available filesystems...
150     </p>
151    
152     </body>
153     </subsection>
154     <subsection>
155     <title>Filesystems?</title>
156     <body>
157    
158     <p>
159 dertobi123 1.5 Several filesystems are available. Ext2, ext3, XFS and reiserfs are found stable on
160 swift 1.1 the HPPA architecture. The others are very experimental.
161     </p>
162    
163     <p>
164     <b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
165     journaling, which means that routine ext2 filesystem checks at startup time can
166     be quite time-consuming. There is now quite a selection of newer-generation
167     journaled filesystems that can be checked for consistency very quickly and are
168     thus generally preferred over their non-journaled counterparts. Journaled
169     filesystems prevent long delays when you boot your system and your filesystem
170     happens to be in an inconsistent state.
171     </p>
172    
173     <p>
174     <b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata
175     journaling for fast recovery in addition to other enhanced journaling modes like
176     full data and ordered data journaling. ext3 is a very good and reliable
177     filesystem. It has an additional hashed b-tree indexing option that enables
178     high performance in almost all situations. In short, ext3 is an excellent
179     filesystem.
180     </p>
181    
182     <p>
183     <b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
184     performance and greatly outperforms both ext2 and ext3 when dealing with small
185     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
186     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
187     solid and usable as both general-purpose filesystem and for extreme cases such
188     as the creation of large filesystems, the use of many small files, very large
189     files and directories containing tens of thousands of files.
190     </p>
191    
192     <p>
193 neysx 1.4 <b>XFS</b> is a filesystem with metadata journaling which comes with a robust
194     feature-set and is optimized for scalability. We only recommend using this
195     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
196     an uninterruptible power supply. Because XFS aggressively caches in-transit data
197     in RAM, improperly designed programs (those that don't take proper precautions
198     when writing files to disk and there are quite a few of them) can lose a good
199     deal of data if the system goes down unexpectedly.
200 swift 1.1 </p>
201    
202     <p>
203     <b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
204     become production-ready and there hasn't been a sufficient track record to
205     comment positively nor negatively on its general stability at this point.
206     </p>
207    
208     </body>
209     </subsection>
210     <subsection id="filesystems-apply">
211     <title>Applying a Filesystem to a Partition</title>
212     <body>
213    
214     <p>
215     To create a filesystem on a partition or volume, there are tools available for
216     each possible filesystem:
217     </p>
218    
219     <table>
220     <tr>
221     <th>Filesystem</th>
222     <th>Creation Command</th>
223     </tr>
224     <tr>
225     <ti>ext2</ti>
226     <ti><c>mke2fs</c></ti>
227     </tr>
228     <tr>
229     <ti>ext3</ti>
230     <ti><c>mke2fs -j</c></ti>
231     </tr>
232     <tr>
233     <ti>reiserfs</ti>
234     <ti><c>mkreiserfs</c></ti>
235     </tr>
236     <tr>
237     <ti>xfs</ti>
238     <ti><c>mkfs.xfs</c></ti>
239     </tr>
240     <tr>
241     <ti>jfs</ti>
242     <ti><c>mkfs.jfs</c></ti>
243     </tr>
244     </table>
245    
246     <p>
247 dertobi123 1.2 For instance, to have the boot partition (<path>/dev/sda2</path> in our
248     example) in ext2 and the root partition (<path>/dev/sda4</path> in our example)
249 swift 1.1 in ext3 (as in our example), you would use:
250     </p>
251    
252     <pre caption="Applying a filesystem on a partition">
253 dertobi123 1.2 # <i>mke2fs /dev/sda2</i>
254     # <i>mke2fs -j /dev/sda4</i>
255 swift 1.1 </pre>
256    
257     <p>
258     Now create the filesystems on your newly created partitions (or logical
259     volumes).
260     </p>
261    
262     </body>
263     </subsection>
264     <subsection>
265     <title>Activating the Swap Partition</title>
266     <body>
267    
268     <p>
269     <c>mkswap</c> is the command that is used to initialize swap partitions:
270     </p>
271    
272     <pre caption="Creating a Swap signature">
273 dertobi123 1.2 # <i>mkswap /dev/sda3</i>
274 swift 1.1 </pre>
275    
276     <p>
277     To activate the swap partition, use <c>swapon</c>:
278     </p>
279    
280     <pre caption="Activating the swap partition">
281 dertobi123 1.2 # <i>swapon /dev/sda3</i>
282 swift 1.1 </pre>
283    
284     <p>
285     Create and activate the swap now.
286     </p>
287    
288     </body>
289     </subsection>
290     </section>
291     <section>
292     <title>Mounting</title>
293     <body>
294    
295     <p>
296     Now that your partitions are initialized and are housing a filesystem, it is
297     time to mount those partitions. Use the <c>mount</c> command. Don't forget to
298     create the necessary mount directories for every partition you created. As an
299     example we mount the root and boot partition:
300     </p>
301    
302     <pre caption="Mounting partitions">
303 dertobi123 1.2 # <i>mount /dev/sda4 /mnt/gentoo</i>
304 swift 1.1 # <i>mkdir /mnt/gentoo/boot</i>
305 dertobi123 1.2 # <i>mount /dev/sda2 /mnt/gentoo/boot</i>
306 swift 1.1 </pre>
307    
308     <note>
309     If you want your <path>/tmp</path> to reside on a separate partition, be sure to
310     change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This
311     also holds for <path>/var/tmp</path>.
312     </note>
313    
314     <p>
315     We also need to mount the proc filesystem (a virtual interface with the kernel)
316     on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path>
317     mountpoint and then mount the filesystem:
318     </p>
319    
320     <pre caption="Creating the /mnt/gentoo/proc mountpoint">
321     # <i>mkdir /mnt/gentoo/proc</i>
322     # <i>mount -t proc none /mnt/gentoo/proc</i>
323     </pre>
324    
325     <p>
326     Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
327     Installation Files</uri>.
328     </p>
329    
330     </body>
331     </section>
332     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20