/[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.31 - (show annotations) (download) (as text)
Sat Feb 23 18:38:22 2013 UTC (16 months, 3 weeks ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.30: +7 -7 lines
File MIME type: application/xml
Fix bug #451596 - Mark ext4 as recommended fs

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/2.5 -->
6
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
9 <sections>
10
11 <version>14</version>
12 <date>2013-02-23</date>
13
14 <section>
15 <title>Introduction to Block Devices</title>
16
17 <subsection>
18 <include href="hb-install-blockdevices.xml"/>
19 </subsection>
20
21 <subsection>
22 <title>Partitions and Slices</title>
23 <body>
24
25 <p>
26 Although it is theoretically possible to use a full disk to house your Linux
27 system, this is almost never done in practice. Instead, full disk block devices
28 are split up in smaller, more manageable block devices. On most systems, these
29 are called <e>partitions</e>. Other architectures use a similar technique,
30 called <e>slices</e>.
31 </p>
32
33 </body>
34 </subsection>
35 </section>
36 <section>
37 <title>Designing a Partitioning Scheme</title>
38 <subsection>
39 <title>How Many and How Big?</title>
40 <body>
41
42 <p>
43 The number of partitions is highly dependent on your environment. For instance,
44 if you have lots of users, you will most likely want to have your
45 <path>/home</path> separate as it increases security and makes backups easier.
46 If you are installing Gentoo to perform as a mailserver, your <path>/var</path>
47 should be separate as all mails are stored inside <path>/var</path>. A good
48 choice of filesystem will then maximise your performance. Gameservers will have
49 a separate <path>/opt</path> as most gaming servers are installed there. The
50 reason is similar for <path>/home</path>: security and backups. You will
51 definitely want to keep <path>/usr</path> big: not only will it contain the
52 majority of applications, the Portage tree alone takes around 500 Mbyte
53 excluding the various sources that are stored in it.
54 </p>
55
56 <p>
57 As you can see, it very much depends on what you want to achieve. Separate
58 partitions or volumes have the following advantages:
59 </p>
60
61 <ul>
62 <li>
63 You can choose the best performing filesystem for each partition or volume
64 </li>
65 <li>
66 Your entire system cannot run out of free space if one defunct tool is
67 continuously writing files to a partition or volume
68 </li>
69 <li>
70 If necessary, file system checks are reduced in time, as multiple checks can
71 be done in parallel (although this advantage is more with multiple disks than
72 it is with multiple partitions)
73 </li>
74 <li>
75 Security can be enhanced by mounting some partitions or volumes read-only,
76 nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.
77 </li>
78 </ul>
79
80 <p>
81 However, multiple partitions have disadvantages as well. If not configured
82 properly, you will have a system with lots of free space on one partition and
83 none on another. Another nuisance is that separate partitions - especially
84 for important mountpoints like <path>/usr</path> or <path>/var</path> - often
85 require the administrator to boot with an initramfs to mount the partition
86 before other boot scripts start. This isn't always the case though, so your
87 results may vary.
88 </p>
89
90 <p>
91 There is also a 15-partition limit for SCSI and SATA.
92 </p>
93
94 </body>
95 </subsection>
96 </section>
97 <section>
98 <title>Using fdisk on HPPA to Partition your Disk</title>
99 <body>
100
101 <p>
102 Use <c>fdisk</c> to create the partitions you want:
103 </p>
104
105 <pre caption="Partitioning the disk">
106 # <i>fdisk /dev/sda</i>
107 </pre>
108
109 <p>
110 HPPA machines use the PC standard DOS partition tables. To create a new
111 DOS partition table, simply use the <c>o</c> command.
112 </p>
113
114 <pre caption="Creating a DOS partition table">
115 # <i>fdisk /dev/sda</i>
116
117 Command (m for help): <i>o</i>
118 Building a new DOS disklabel.
119 </pre>
120
121 <p>
122 PALO (the HPPA bootloader) needs a special partition to work. You have
123 to create a partition of at least 16MB at the beginning of your disk.
124 The partition type must be of type <e>f0</e> (Linux/PA-RISC boot).
125 </p>
126
127 <impo>
128 If you ignore this and continue without a special PALO partition, your system
129 will stop loving you and fail to start. Also, if your disk is larger than 2GB,
130 make sure that the boot partition is in the first 2GB of your disk. PALO is
131 unable to read a kernel after the 2GB limit.
132 </impo>
133
134 <pre caption="A simple default partition scheme">
135 # <i>cat /etc/fstab</i>
136 /dev/sda2 /boot ext2 noauto,noatime 1 1
137 /dev/sda3 none swap sw 0 0
138 /dev/sda4 / ext4 noatime 0 0
139
140 # <i>fdisk /dev/sda</i>
141
142 Command (m for help): <i>p</i>
143
144 Disk /dev/sda: 4294 MB, 4294816768 bytes
145 133 heads, 62 sectors/track, 1017 cylinders
146 Units = 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
155 <p>
156 Now that your partitions are created, you can continue with <uri
157 link="#filesystems">Creating Filesystems</uri>.
158 </p>
159
160 </body>
161 </section>
162 <section id="filesystems">
163 <title>Creating Filesystems</title>
164 <subsection>
165 <title>Introduction</title>
166 <body>
167
168 <p>
169 Now that your partitions are created, it is time to place a filesystem on them.
170 If you don't care about what filesystem to choose and are happy with what we use
171 as default in this handbook, continue with <uri
172 link="#filesystems-apply">Applying a Filesystem to a Partition</uri>.
173 Otherwise read on to learn about the available filesystems...
174 </p>
175
176 </body>
177 </subsection>
178
179 <subsection>
180 <include href="hb-install-filesystems.xml"/>
181 </subsection>
182
183 <subsection id="filesystems-apply">
184 <title>Applying a Filesystem to a Partition</title>
185 <body>
186
187 <p>
188 To create a filesystem on a partition or volume, there are tools available for
189 each possible filesystem:
190 </p>
191
192 <table>
193 <tr>
194 <th>Filesystem</th>
195 <th>Creation Command</th>
196 </tr>
197 <tr>
198 <ti>ext2</ti>
199 <ti><c>mkfs.ext2</c></ti>
200 </tr>
201 <tr>
202 <ti>ext3</ti>
203 <ti><c>mkfs.ext3</c></ti>
204 </tr>
205 <tr>
206 <ti>ext4</ti>
207 <ti><c>mkfs.ext4</c></ti>
208 </tr>
209 <tr>
210 <ti>reiserfs</ti>
211 <ti><c>mkreiserfs</c></ti>
212 </tr>
213 <tr>
214 <ti>xfs</ti>
215 <ti><c>mkfs.xfs</c></ti>
216 </tr>
217 <tr>
218 <ti>jfs</ti>
219 <ti><c>mkfs.jfs</c></ti>
220 </tr>
221 </table>
222
223 <p>
224 For instance, to have the boot partition (<path>/dev/sda2</path> in our
225 example) in ext2 and the root partition (<path>/dev/sda4</path> in our example)
226 in ext4 (as in our example), you would use:
227 </p>
228
229 <pre caption="Applying a filesystem on a partition">
230 # <i>mkfs.ext2 /dev/sda2</i>
231 # <i>mkfs.ext4 /dev/sda4</i>
232 </pre>
233
234 <p>
235 Now create the filesystems on your newly created partitions (or logical
236 volumes).
237 </p>
238
239 </body>
240 </subsection>
241 <subsection>
242 <title>Activating the Swap Partition</title>
243 <body>
244
245 <p>
246 <c>mkswap</c> is the command that is used to initialize swap partitions:
247 </p>
248
249 <pre caption="Creating a Swap signature">
250 # <i>mkswap /dev/sda3</i>
251 </pre>
252
253 <p>
254 To activate the swap partition, use <c>swapon</c>:
255 </p>
256
257 <pre caption="Activating the swap partition">
258 # <i>swapon /dev/sda3</i>
259 </pre>
260
261 <p>
262 Create and activate the swap with the commands mentioned above.
263 </p>
264
265 </body>
266 </subsection>
267 </section>
268 <section>
269 <title>Mounting</title>
270 <body>
271
272 <p>
273 Now that your partitions are initialized and are housing a filesystem, it is
274 time to mount those partitions. Use the <c>mount</c> command. Don't forget to
275 create the necessary mount directories for every partition you created. As an
276 example we mount the root and boot partition:
277 </p>
278
279 <pre caption="Mounting partitions">
280 # <i>mount /dev/sda4 /mnt/gentoo</i>
281 # <i>mkdir /mnt/gentoo/boot</i>
282 # <i>mount /dev/sda2 /mnt/gentoo/boot</i>
283 </pre>
284
285 <note>
286 If you want your <path>/tmp</path> to reside on a separate partition, be sure
287 to change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>.
288 This also holds for <path>/var/tmp</path>.
289 </note>
290
291 <p>
292 We will also have to mount the proc filesystem (a virtual interface with the
293 kernel) on <path>/proc</path>. But first we will need to place our files on the
294 partitions.
295 </p>
296
297 <p>
298 Continue with <uri link="?part=1&amp;chap=5">Installing the Gentoo
299 Installation Files</uri>.
300 </p>
301
302 </body>
303 </section>
304 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20