/[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.8 - (hide annotations) (download) (as text)
Tue Sep 14 11:55:12 2004 UTC (10 years ago) by swift
Branch: MAIN
Changes since 1.7: +2 -2 lines
File MIME type: application/xml
#63752 - Add "and SATA" to the 15-partition limit warning

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

  ViewVC Help
Powered by ViewVC 1.1.20