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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.30
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-hppa-disk.xml,v 1.3 2004/07/16 09:37:11 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-hppa-disk.xml,v 1.30 2012/10/06 19:54:14 swift Exp $ -->
8 8
9<sections> 9<sections>
10
11<version>13</version>
12<date>2012-10-06</date>
13
10<section> 14<section>
11<title>Introduction to Block Devices</title> 15<title>Introduction to Block Devices</title>
12<subsection>
13<title>Block Devices</title>
14<body>
15 16
16<p>
17We'll take a good look at disk-oriented aspects of Gentoo Linux
18and Linux in general, including Linux filesystems, partitions and block devices.
19Then, once you're familiar with the ins and outs of disks and filesystems,
20you'll be guided through the process of setting up partitions and filesystems
21for your Gentoo Linux installation.
22</p>
23
24<p>
25To begin, we'll introduce <e>block devices</e>. The most famous block device is
26probably the one that represents the first SCSI HD in a Linux system, namely
27<path>/dev/sda</path>.
28</p>
29
30<p>
31The block devices above represent an abstract interface to the disk. User
32programs can use these block devices to interact with your disk without worrying
33about whether your drives are IDE, SCSI or something else. The program can
34simply address the storage on the disk as a bunch of contiguous,
35randomly-accessible 512-byte blocks.
36</p>
37
38</body>
39</subsection> 17<subsection>
18<include href="hb-install-blockdevices.xml"/>
19</subsection>
20
40<subsection> 21<subsection>
41<title>Partitions and Slices</title> 22<title>Partitions and Slices</title>
42<body> 23<body>
43 24
44<p> 25<p>
45Although it is theoretically possible to use a full disk to house your Linux 26Although it is theoretically possible to use a full disk to house your Linux
46system, this is almost never done in practice. Instead, full disk block devices 27system, this is almost never done in practice. Instead, full disk block devices
47are split up in smaller, more manageable block devices. On most systems, 28are split up in smaller, more manageable block devices. On most systems, these
48these are called <e>partitions</e>. Other architectures use a similar technique, 29are called <e>partitions</e>. Other architectures use a similar technique,
49called <e>slices</e>. 30called <e>slices</e>.
50</p> 31</p>
51 32
52</body> 33</body>
53</subsection> 34</subsection>
60 41
61<p> 42<p>
62The number of partitions is highly dependent on your environment. For instance, 43The number of partitions is highly dependent on your environment. For instance,
63if you have lots of users, you will most likely want to have your 44if 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. 45<path>/home</path> separate as it increases security and makes backups easier.
65If you are installing Gentoo to perform as a mailserver, your 46If you are installing Gentoo to perform as a mailserver, your <path>/var</path>
66<path>/var</path> should be separate as all mails are stored inside 47should be separate as all mails are stored inside <path>/var</path>. A good
67<path>/var</path>. A good choice of filesystem will then maximise your 48choice of filesystem will then maximise your performance. Gameservers will have
68performance. Gameservers will have a separate <path>/opt</path> as most gaming 49a separate <path>/opt</path> as most gaming servers are installed there. The
69servers are installed there. The reason is similar for <path>/home</path>: 50reason is similar for <path>/home</path>: security and backups. You will
70security and backups. 51definitely want to keep <path>/usr</path> big: not only will it contain the
52majority of applications, the Portage tree alone takes around 500 Mbyte
53excluding the various sources that are stored in it.
71</p> 54</p>
72 55
73<p> 56<p>
74As you can see, it very much depends on what you want to achieve. Separate 57As you can see, it very much depends on what you want to achieve. Separate
75partitions or volumes have the following advantages: 58partitions or volumes have the following advantages:
93 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc. 76 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
94</li> 77</li>
95</ul> 78</ul>
96 79
97<p> 80<p>
98However, multiple partitions have one big disadvantage: if not configured 81However, multiple partitions have disadvantages as well. If not configured
99properly, you might result in having a system with lots 82properly, you will have a system with lots of free space on one partition and
100of free space on one partition and none on another. 83none on another. Another nuisance is that separate partitions - especially
84for important mountpoints like <path>/usr</path> or <path>/var</path> - often
85require the administrator to boot with an initramfs to mount the partition
86before other boot scripts start. This isn't always the case though, so your
87results may vary.
88</p>
89
90<p>
91There is also a 15-partition limit for SCSI and SATA.
101</p> 92</p>
102 93
103</body> 94</body>
104</subsection> 95</subsection>
105</section> 96</section>
114<pre caption="Partitioning the disk"> 105<pre caption="Partitioning the disk">
115# <i>fdisk /dev/sda</i> 106# <i>fdisk /dev/sda</i>
116</pre> 107</pre>
117 108
118<p> 109<p>
119PALO needs a special partition to work. You have to create a partition of at 110HPPA machines use the PC standard DOS partition tables. To create a new
120least 16Mb at the beginning of your disk. The partition type must be of type 111DOS partition table, simply use the <c>o</c> command.
121<e>f0</e> (Linux/PA-RISC boot). 112</p>
113
114<pre caption="Creating a DOS partition table">
115# <i>fdisk /dev/sda</i>
116
117Command (m for help): <i>o</i>
118Building a new DOS disklabel.
119</pre>
120
121<p>
122PALO (the HPPA bootloader) needs a special partition to work. You have
123to create a partition of at least 16MB at the beginning of your disk.
124The partition type must be of type <e>f0</e> (Linux/PA-RISC boot).
122</p> 125</p>
123 126
124<impo> 127<impo>
125If you ignore this and continue without a special PALO partition, your system 128If you ignore this and continue without a special PALO partition, your system
126will stop loving you and fail to start. Also, if your disk is larger than 2Gb, 129will stop loving you and fail to start. Also, if your disk is larger than 2GB,
127make sure that the boot partition is in the first 2Gb of your disk. PALO is 130make sure that the boot partition is in the first 2GB of your disk. PALO is
128unable to read a kernel after the 2Gb limit. 131unable to read a kernel after the 2GB limit.
129</impo> 132</impo>
130 133
134<pre caption="A simple default partition scheme">
135# <i>cat /etc/fstab</i>
136/dev/sda2 /boot ext3 noauto,noatime 1 1
137/dev/sda3 none swap sw 0 0
138/dev/sda4 / ext3 noatime 0 0
139
140# <i>fdisk /dev/sda</i>
141
142Command (m for help): <i>p</i>
143
144Disk /dev/sda: 4294 MB, 4294816768 bytes
145133 heads, 62 sectors/track, 1017 cylinders
146Units = cylinders of 8246 * 512 = 4221952 bytes
147
148 Device Boot Start End Blocks Id System
149/dev/sda1 1 8 32953 f0 Linux/PA-RISC boot
150/dev/sda2 9 20 49476 83 Linux
151/dev/sda3 21 70 206150 82 Linux swap
152/dev/sda4 71 1017 3904481 83 Linux
153</pre>
154
131<p> 155<p>
132Now that your partitions are created, you can now continue with <uri 156Now that your partitions are created, you can continue with <uri
133link="#filesystems">Creating Filesystems</uri>. 157link="#filesystems">Creating Filesystems</uri>.
134</p> 158</p>
135 159
136</body> 160</body>
137</section> 161</section>
149Otherwise read on to learn about the available filesystems... 173Otherwise read on to learn about the available filesystems...
150</p> 174</p>
151 175
152</body> 176</body>
153</subsection> 177</subsection>
154<subsection>
155<title>Filesystems?</title>
156<body>
157 178
158<p>
159Several filesystems are available. Ext2, ext3 and reiserfs are found stable on
160the 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
165journaling, which means that routine ext2 filesystem checks at startup time can
166be quite time-consuming. There is now quite a selection of newer-generation
167journaled filesystems that can be checked for consistency very quickly and are
168thus generally preferred over their non-journaled counterparts. Journaled
169filesystems prevent long delays when you boot your system and your filesystem
170happens 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
175journaling for fast recovery in addition to other enhanced journaling modes like
176full data and ordered data journaling. ext3 is a very good and reliable
177filesystem. It has an additional hashed b-tree indexing option that enables
178high performance in almost all situations. In short, ext3 is an excellent
179filesystem.
180</p>
181
182<p>
183<b>ReiserFS</b> is a B*-tree based filesystem that has very good overall
184performance and greatly outperforms both ext2 and ext3 when dealing with small
185files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
186extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
187solid and usable as both general-purpose filesystem and for extreme cases such
188as the creation of large filesystems, the use of many small files, very large
189files and directories containing tens of thousands of files.
190</p>
191
192<p>
193<b>XFS</b> is a filesystem with metadata journaling that is fully supported
194under Gentoo Linux's xfs-sources kernel. It comes with a robust feature-set and
195is optimized for scalability. We only recommend using this filesystem on Linux
196systems with high-end SCSI and/or fibre channel storage and a uninterruptible
197power supply. Because XFS aggressively caches in-transit data in RAM, improperly
198designed programs (those that don't take proper precautions when writing files
199to disk and there are quite a few of them) can lose a good deal of data if the
200system goes down unexpectedly.
201</p>
202
203<p>
204<b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
205become production-ready and there hasn't been a sufficient track record to
206comment positively nor negatively on its general stability at this point.
207</p>
208
209</body>
210</subsection> 179<subsection>
180<include href="hb-install-filesystems.xml"/>
181</subsection>
182
211<subsection id="filesystems-apply"> 183<subsection id="filesystems-apply">
212<title>Applying a Filesystem to a Partition</title> 184<title>Applying a Filesystem to a Partition</title>
213<body> 185<body>
214 186
215<p> 187<p>
222 <th>Filesystem</th> 194 <th>Filesystem</th>
223 <th>Creation Command</th> 195 <th>Creation Command</th>
224</tr> 196</tr>
225<tr> 197<tr>
226 <ti>ext2</ti> 198 <ti>ext2</ti>
227 <ti><c>mke2fs</c></ti> 199 <ti><c>mkfs.ext2</c></ti>
228</tr> 200</tr>
229<tr> 201<tr>
230 <ti>ext3</ti> 202 <ti>ext3</ti>
231 <ti><c>mke2fs -j</c></ti> 203 <ti><c>mkfs.ext3</c></ti>
204</tr>
205<tr>
206 <ti>ext4</ti>
207 <ti><c>mkfs.ext4</c></ti>
232</tr> 208</tr>
233<tr> 209<tr>
234 <ti>reiserfs</ti> 210 <ti>reiserfs</ti>
235 <ti><c>mkreiserfs</c></ti> 211 <ti><c>mkreiserfs</c></ti>
236</tr> 212</tr>
249example) in ext2 and the root partition (<path>/dev/sda4</path> in our example) 225example) in ext2 and the root partition (<path>/dev/sda4</path> in our example)
250in ext3 (as in our example), you would use: 226in ext3 (as in our example), you would use:
251</p> 227</p>
252 228
253<pre caption="Applying a filesystem on a partition"> 229<pre caption="Applying a filesystem on a partition">
254# <i>mke2fs /dev/sda2</i> 230# <i>mkfs.ext2 /dev/sda2</i>
255# <i>mke2fs -j /dev/sda4</i> 231# <i>mkfs.ext3 /dev/sda4</i>
256</pre> 232</pre>
257 233
258<p> 234<p>
259Now create the filesystems on your newly created partitions (or logical 235Now create the filesystems on your newly created partitions (or logical
260volumes). 236volumes).
281<pre caption="Activating the swap partition"> 257<pre caption="Activating the swap partition">
282# <i>swapon /dev/sda3</i> 258# <i>swapon /dev/sda3</i>
283</pre> 259</pre>
284 260
285<p> 261<p>
286Create and activate the swap now. 262Create and activate the swap with the commands mentioned above.
287</p> 263</p>
288 264
289</body> 265</body>
290</subsection> 266</subsection>
291</section> 267</section>
305# <i>mkdir /mnt/gentoo/boot</i> 281# <i>mkdir /mnt/gentoo/boot</i>
306# <i>mount /dev/sda2 /mnt/gentoo/boot</i> 282# <i>mount /dev/sda2 /mnt/gentoo/boot</i>
307</pre> 283</pre>
308 284
309<note> 285<note>
310If you want your <path>/tmp</path> to reside on a separate partition, be sure to 286If you want your <path>/tmp</path> to reside on a separate partition, be sure
311change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This 287to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
312also holds for <path>/var/tmp</path>. 288This also holds for <path>/var/tmp</path>.
313</note> 289</note>
314 290
315<p> 291<p>
316We also need to mount the proc filesystem (a virtual interface with the kernel) 292We will also have to mount the proc filesystem (a virtual interface with the
317on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path> 293kernel) on <path>/proc</path>. But first we will need to place our files on the
318mountpoint and then mount the filesystem: 294partitions.
319</p>
320
321<pre caption="Creating the /mnt/gentoo/proc mountpoint">
322# <i>mkdir /mnt/gentoo/proc</i>
323# <i>mount -t proc none /mnt/gentoo/proc</i>
324</pre>
325
326<p> 295</p>
296
297<p>
327Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo 298Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
328Installation Files</uri>. 299Installation Files</uri>.
329</p> 300</p>
330 301
331</body> 302</body>
332</section> 303</section>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20