/[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.5 Revision 1.25
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.5 2004/07/26 09:04:42 dertobi123 Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-hppa-disk.xml,v 1.25 2008/04/01 16:44:56 rane Exp $ -->
8 8
9<sections> 9<sections>
10
11<version>9.1</version>
12<date>2008-04-01</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 one big disadvantage: if not configured
99properly, you might result in having a system with lots 82properly, you might result in having a system with lots of free space on one
100of free space on one partition and none on another. 83partition and none on another. There is also a 15-partition limit for SCSI and
84SATA.
101</p> 85</p>
102 86
103</body> 87</body>
104</subsection> 88</subsection>
105</section> 89</section>
114<pre caption="Partitioning the disk"> 98<pre caption="Partitioning the disk">
115# <i>fdisk /dev/sda</i> 99# <i>fdisk /dev/sda</i>
116</pre> 100</pre>
117 101
118<p> 102<p>
119PALO needs a special partition to work. You have to create a partition of at 103HPPA 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 104DOS partition table, simply use the <c>o</c> command.
121<e>f0</e> (Linux/PA-RISC boot). 105</p>
106
107<pre caption="Creating a DOS partition table">
108# <i>fdisk /dev/sda</i>
109
110Command (m for help): <i>o</i>
111Building a new DOS disklabel.
112</pre>
113
114<p>
115PALO (the HPPA bootloader) needs a special partition to work. You have
116to create a partition of at least 16MB at the beginning of your disk.
117The partition type must be of type <e>f0</e> (Linux/PA-RISC boot).
122</p> 118</p>
123 119
124<impo> 120<impo>
125If you ignore this and continue without a special PALO partition, your system 121If 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, 122will 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 123make sure that the boot partition is in the first 2GB of your disk. PALO is
128unable to read a kernel after the 2Gb limit. 124unable to read a kernel after the 2GB limit.
129</impo> 125</impo>
126
127<pre caption="A simple default partition schema">
128# <i>cat /etc/fstab</i>
129/dev/sda2 /boot ext3 noauto,noatime 1 1
130/dev/sda3 none swap sw 0 0
131/dev/sda4 / ext3 noatime 0 0
132
133# <i>fdisk /dev/sda</i>
134
135Command (m for help): <i>p</i>
136
137Disk /dev/sda: 4294 MB, 4294816768 bytes
138133 heads, 62 sectors/track, 1017 cylinders
139Units = cylinders of 8246 * 512 = 4221952 bytes
140
141 Device Boot Start End Blocks Id System
142/dev/sda1 1 8 32953 f0 Linux/PA-RISC boot
143/dev/sda2 9 20 49476 83 Linux
144/dev/sda3 21 70 206150 82 Linux swap
145/dev/sda4 71 1017 3904481 83 Linux
146</pre>
130 147
131<p> 148<p>
132Now that your partitions are created, you can now continue with <uri 149Now that your partitions are created, you can now continue with <uri
133link="#filesystems">Creating Filesystems</uri>. 150link="#filesystems">Creating Filesystems</uri>.
134</p> 151</p>
149Otherwise read on to learn about the available filesystems... 166Otherwise read on to learn about the available filesystems...
150</p> 167</p>
151 168
152</body> 169</body>
153</subsection> 170</subsection>
154<subsection>
155<title>Filesystems?</title>
156<body>
157 171
158<p>
159Several filesystems are available. Ext2, ext3, XFS 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 which comes with a robust
194feature-set and is optimized for scalability. We only recommend using this
195filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
196an uninterruptible power supply. Because XFS aggressively caches in-transit data
197in RAM, improperly designed programs (those that don't take proper precautions
198when writing files to disk and there are quite a few of them) can lose a good
199deal of data if the system goes down unexpectedly.
200</p>
201
202<p>
203<b>JFS</b> is IBM's high-performance journaling filesystem. It has recently
204become production-ready and there hasn't been a sufficient track record to
205comment positively nor negatively on its general stability at this point.
206</p>
207
208</body>
209</subsection> 172<subsection>
173<include href="hb-install-filesystems.xml"/>
174</subsection>
175
210<subsection id="filesystems-apply"> 176<subsection id="filesystems-apply">
211<title>Applying a Filesystem to a Partition</title> 177<title>Applying a Filesystem to a Partition</title>
212<body> 178<body>
213 179
214<p> 180<p>
280<pre caption="Activating the swap partition"> 246<pre caption="Activating the swap partition">
281# <i>swapon /dev/sda3</i> 247# <i>swapon /dev/sda3</i>
282</pre> 248</pre>
283 249
284<p> 250<p>
285Create and activate the swap now. 251Create and activate the swap with the commands mentioned above.
286</p> 252</p>
287 253
288</body> 254</body>
289</subsection> 255</subsection>
290</section> 256</section>
304# <i>mkdir /mnt/gentoo/boot</i> 270# <i>mkdir /mnt/gentoo/boot</i>
305# <i>mount /dev/sda2 /mnt/gentoo/boot</i> 271# <i>mount /dev/sda2 /mnt/gentoo/boot</i>
306</pre> 272</pre>
307 273
308<note> 274<note>
309If you want your <path>/tmp</path> to reside on a separate partition, be sure to 275If you want your <path>/tmp</path> to reside on a separate partition, be sure
310change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This 276to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
311also holds for <path>/var/tmp</path>. 277This also holds for <path>/var/tmp</path>.
312</note> 278</note>
313 279
314<p> 280<p>
315We also need to mount the proc filesystem (a virtual interface with the kernel) 281We will also have to mount the proc filesystem (a virtual interface with the
316on <path>/proc</path>. We first create the <path>/mnt/gentoo/proc</path> 282kernel) on <path>/proc</path>. But first we will need to place our files on the
317mountpoint and then mount the filesystem: 283partitions.
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> 284</p>
285
286<p>
326Now continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo 287Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
327Installation Files</uri>. 288Installation Files</uri>.
328</p> 289</p>
329 290
330</body> 291</body>
331</section> 292</section>

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20