/[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.21
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.21 2007/02/16 13:45:39 neysx Exp $ -->
8 8
9<sections> 9<sections>
10
11<version>7.2</version>
12<date>2007-02-16</date>
13
10<section> 14<section>
11<title>Introduction to Block Devices</title> 15<title>Introduction to Block Devices</title>
12<subsection> 16<subsection>
13<title>Block Devices</title> 17<title>Block Devices</title>
14<body> 18<body>
15 19
16<p> 20<p>
17We'll take a good look at disk-oriented aspects of Gentoo Linux 21We'll take a good look at disk-oriented aspects of Gentoo Linux and Linux in
18and Linux in general, including Linux filesystems, partitions and block devices. 22general, including Linux filesystems, partitions and block devices. Then, once
19Then, once you're familiar with the ins and outs of disks and filesystems, 23you're familiar with the ins and outs of disks and filesystems, you'll be
20you'll be guided through the process of setting up partitions and filesystems 24guided through the process of setting up partitions and filesystems for your
21for your Gentoo Linux installation. 25Gentoo Linux installation.
22</p> 26</p>
23 27
24<p> 28<p>
25To begin, we'll introduce <e>block devices</e>. The most famous block device is 29To 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 30probably the one that represents the first SCSI HD in a Linux system, namely
27<path>/dev/sda</path>. 31<path>/dev/sda</path>.
28</p> 32</p>
29 33
30<p> 34<p>
31The block devices above represent an abstract interface to the disk. User 35The block devices above represent an abstract interface to the disk. User
32programs can use these block devices to interact with your disk without worrying 36programs can use these block devices to interact with your disk without
33about whether your drives are IDE, SCSI or something else. The program can 37worrying about whether your drives are IDE, SCSI or something else. The program
34simply address the storage on the disk as a bunch of contiguous, 38can simply address the storage on the disk as a bunch of contiguous,
35randomly-accessible 512-byte blocks. 39randomly-accessible 512-byte blocks.
36</p> 40</p>
37 41
38</body> 42</body>
39</subsection> 43</subsection>
42<body> 46<body>
43 47
44<p> 48<p>
45Although it is theoretically possible to use a full disk to house your Linux 49Although 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 50system, this is almost never done in practice. Instead, full disk block devices
47are split up in smaller, more manageable block devices. On most systems, 51are split up in smaller, more manageable block devices. On most systems, these
48these are called <e>partitions</e>. Other architectures use a similar technique, 52are called <e>partitions</e>. Other architectures use a similar technique,
49called <e>slices</e>. 53called <e>slices</e>.
50</p> 54</p>
51 55
52</body> 56</body>
53</subsection> 57</subsection>
60 64
61<p> 65<p>
62The number of partitions is highly dependent on your environment. For instance, 66The 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 67if 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. 68<path>/home</path> separate as it increases security and makes backups easier.
65If you are installing Gentoo to perform as a mailserver, your 69If 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 70should 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 71choice of filesystem will then maximise your performance. Gameservers will have
68performance. Gameservers will have a separate <path>/opt</path> as most gaming 72a separate <path>/opt</path> as most gaming servers are installed there. The
69servers are installed there. The reason is similar for <path>/home</path>: 73reason is similar for <path>/home</path>: security and backups. You will
70security and backups. 74definitely want to keep <path>/usr</path> big: not only will it contain the
75majority of applications, the Portage tree alone takes around 500 Mbyte
76excluding the various sources that are stored in it.
71</p> 77</p>
72 78
73<p> 79<p>
74As you can see, it very much depends on what you want to achieve. Separate 80As you can see, it very much depends on what you want to achieve. Separate
75partitions or volumes have the following advantages: 81partitions or volumes have the following advantages:
93 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc. 99 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
94</li> 100</li>
95</ul> 101</ul>
96 102
97<p> 103<p>
98However, multiple partitions have one big disadvantage: if not configured 104However, multiple partitions have one big disadvantage: if not configured
99properly, you might result in having a system with lots 105properly, you might result in having a system with lots of free space on one
100of free space on one partition and none on another. 106partition and none on another. There is also a 15-partition limit for SCSI and
107SATA.
101</p> 108</p>
102 109
103</body> 110</body>
104</subsection> 111</subsection>
105</section> 112</section>
114<pre caption="Partitioning the disk"> 121<pre caption="Partitioning the disk">
115# <i>fdisk /dev/sda</i> 122# <i>fdisk /dev/sda</i>
116</pre> 123</pre>
117 124
118<p> 125<p>
119PALO needs a special partition to work. You have to create a partition of at 126HPPA 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 127DOS partition table, simply use the <c>o</c> command.
121<e>f0</e> (Linux/PA-RISC boot). 128</p>
129
130<pre caption="Creating a DOS partition table">
131# <i>fdisk /dev/sda</i>
132
133Command (m for help): <i>o</i>
134Building a new DOS disklabel.
135</pre>
136
137<p>
138PALO (the HPPA bootloader) needs a special partition to work. You have
139to create a partition of at least 16MB at the beginning of your disk.
140The partition type must be of type <e>f0</e> (Linux/PA-RISC boot).
122</p> 141</p>
123 142
124<impo> 143<impo>
125If you ignore this and continue without a special PALO partition, your system 144If 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, 145will 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 146make sure that the boot partition is in the first 2GB of your disk. PALO is
128unable to read a kernel after the 2Gb limit. 147unable to read a kernel after the 2GB limit.
129</impo> 148</impo>
149
150<pre caption="A simple default partition schema">
151# <i>cat /etc/fstab</i>
152/dev/sda2 /boot ext3 noauto,noatime 1 1
153/dev/sda3 none swap sw 0 0
154/dev/sda4 / ext3 noatime 0 0
155
156# <i>fdisk /dev/sda</i>
157
158Command (m for help): <i>p</i>
159
160Disk /dev/sda: 4294 MB, 4294816768 bytes
161133 heads, 62 sectors/track, 1017 cylinders
162Units = cylinders of 8246 * 512 = 4221952 bytes
163
164 Device Boot Start End Blocks Id System
165/dev/sda1 1 8 32953 f0 Linux/PA-RISC boot
166/dev/sda2 9 20 49476 83 Linux
167/dev/sda3 21 70 206150 82 Linux swap
168/dev/sda4 71 1017 3904481 83 Linux
169</pre>
130 170
131<p> 171<p>
132Now that your partitions are created, you can now continue with <uri 172Now that your partitions are created, you can now continue with <uri
133link="#filesystems">Creating Filesystems</uri>. 173link="#filesystems">Creating Filesystems</uri>.
134</p> 174</p>
154<subsection> 194<subsection>
155<title>Filesystems?</title> 195<title>Filesystems?</title>
156<body> 196<body>
157 197
158<p> 198<p>
159Several filesystems are available. Ext2, ext3 and reiserfs are found stable on 199Several filesystems are available. Ext2, ext3, XFS and reiserfs are found
160the HPPA architecture. The others are very experimental. 200stable on the HPPA architecture. The others are very experimental.
161</p> 201</p>
162 202
163<p> 203<p>
164<b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata 204<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 205journaling, which means that routine ext2 filesystem checks at startup time can
170happens to be in an inconsistent state. 210happens to be in an inconsistent state.
171</p> 211</p>
172 212
173<p> 213<p>
174<b>ext3</b> is the journaled version of the ext2 filesystem, providing metadata 214<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 215journaling for fast recovery in addition to other enhanced journaling modes
176full data and ordered data journaling. ext3 is a very good and reliable 216like full data and ordered data journaling. It uses a hashed B*-tree index that
177filesystem. It has an additional hashed b-tree indexing option that enables
178high performance in almost all situations. In short, ext3 is an excellent 217enables high performance in almost all situations. In short, ext3 is a very
179filesystem. 218good and reliable filesystem.
180</p>
181
182<p> 219</p>
220
221<p>
183<b>ReiserFS</b> is a B*-tree based filesystem that has very good overall 222<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 223performance 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 224files (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 225extremely well and has metadata journaling. ReiserFS is solid and usable as
187solid and usable as both general-purpose filesystem and for extreme cases such 226both general-purpose filesystem and for extreme cases such as the creation of
188as the creation of large filesystems, the use of many small files, very large 227large filesystems, very large files and directories containing tens of
189files and directories containing tens of thousands of files. 228thousands of small files.
190</p>
191
192<p> 229</p>
193<b>XFS</b> is a filesystem with metadata journaling that is fully supported 230
194under Gentoo Linux's xfs-sources kernel. It comes with a robust feature-set and 231<p>
232<b>XFS</b> is a filesystem with metadata journaling which comes with a robust
195is optimized for scalability. We only recommend using this filesystem on Linux 233feature-set and is optimized for scalability. We only recommend using this
196systems with high-end SCSI and/or fibre channel storage and a uninterruptible 234filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
197power supply. Because XFS aggressively caches in-transit data in RAM, improperly 235an uninterruptible power supply. Because XFS aggressively caches in-transit data
198designed programs (those that don't take proper precautions when writing files 236in RAM, improperly designed programs (those that don't take proper precautions
199to disk and there are quite a few of them) can lose a good deal of data if the 237when writing files to disk and there are quite a few of them) can lose a good
200system goes down unexpectedly. 238deal of data if the system goes down unexpectedly.
201</p> 239</p>
202 240
203<p> 241<p>
204<b>JFS</b> is IBM's high-performance journaling filesystem. It has recently 242<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 243become production-ready and there hasn't been a sufficient track record to
250in ext3 (as in our example), you would use: 288in ext3 (as in our example), you would use:
251</p> 289</p>
252 290
253<pre caption="Applying a filesystem on a partition"> 291<pre caption="Applying a filesystem on a partition">
254# <i>mke2fs /dev/sda2</i> 292# <i>mke2fs /dev/sda2</i>
255# <i>mke2fs -j /dev/sda4</i> 293# <i>mke2fs -j -O dir_index /dev/sda4</i>
256</pre> 294</pre>
257 295
258<p> 296<p>
259Now create the filesystems on your newly created partitions (or logical 297Now create the filesystems on your newly created partitions (or logical
260volumes). 298volumes).
281<pre caption="Activating the swap partition"> 319<pre caption="Activating the swap partition">
282# <i>swapon /dev/sda3</i> 320# <i>swapon /dev/sda3</i>
283</pre> 321</pre>
284 322
285<p> 323<p>
286Create and activate the swap now. 324Create and activate the swap with the commands mentioned above.
287</p> 325</p>
288 326
289</body> 327</body>
290</subsection> 328</subsection>
291</section> 329</section>
305# <i>mkdir /mnt/gentoo/boot</i> 343# <i>mkdir /mnt/gentoo/boot</i>
306# <i>mount /dev/sda2 /mnt/gentoo/boot</i> 344# <i>mount /dev/sda2 /mnt/gentoo/boot</i>
307</pre> 345</pre>
308 346
309<note> 347<note>
310If you want your <path>/tmp</path> to reside on a separate partition, be sure to 348If 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 349to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
312also holds for <path>/var/tmp</path>. 350This also holds for <path>/var/tmp</path>.
313</note> 351</note>
314 352
315<p> 353<p>
316We also need to mount the proc filesystem (a virtual interface with the kernel) 354We 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> 355kernel) on <path>/proc</path>. But first we will need to place our files on the
318mountpoint and then mount the filesystem: 356partitions.
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> 357</p>
358
359<p>
327Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo 360Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
328Installation Files</uri>. 361Installation Files</uri>.
329</p> 362</p>
330 363
331</body> 364</body>
332</section> 365</section>

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

  ViewVC Help
Powered by ViewVC 1.1.20