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

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

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

Revision 1.8 Revision 1.9
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/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-arm-disk.xml,v 1.8 2008/04/01 08:53:46 nightmorph Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-arm-disk.xml,v 1.9 2008/05/02 08:04:23 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>6.0</version> 11<version>6.1</version>
12<date>2008-04-01</date> 12<date>2008-05-02</date>
13 13
14<!-- TODO: Add section about MTD and such --> 14<!-- TODO: Add section about MTD and such -->
15 15
16<section> 16<section>
17<title>Introduction to Block Devices</title> 17<title>Introduction to Block Devices</title>
37</p> 37</p>
38 38
39<p> 39<p>
40A <e>primary</e> partition is a partition which has its information stored in 40A <e>primary</e> partition is a partition which has its information stored in
41the MBR (master boot record). As an MBR is very small (512 bytes) only four 41the MBR (master boot record). As an MBR is very small (512 bytes) only four
42primary partitions can be defined (for instance, <path>/dev/hda1</path> to 42primary partitions can be defined (for instance, <path>/dev/sda1</path> to
43<path>/dev/hda4</path>). 43<path>/dev/sda4</path>).
44</p> 44</p>
45 45
46<p> 46<p>
47An <e>extended</e> partition is a special primary partition (meaning the 47An <e>extended</e> partition is a special primary partition (meaning the
48extended partition must be one of the four possible primary partitions) which 48extended partition must be one of the four possible primary partitions) which
82 <th>Filesystem</th> 82 <th>Filesystem</th>
83 <th>Size</th> 83 <th>Size</th>
84 <th>Description</th> 84 <th>Description</th>
85</tr> 85</tr>
86<tr> 86<tr>
87 <ti><path>/dev/hda1</path></ti> 87 <ti><path>/dev/sda1</path></ti>
88 <ti>ext2</ti> 88 <ti>ext2</ti>
89 <ti>32M</ti> 89 <ti>32M</ti>
90 <ti>Boot partition</ti> 90 <ti>Boot partition</ti>
91</tr> 91</tr>
92<tr> 92<tr>
93 <ti><path>/dev/hda2</path></ti> 93 <ti><path>/dev/sda2</path></ti>
94 <ti>(swap)</ti> 94 <ti>(swap)</ti>
95 <ti>512M</ti> 95 <ti>512M</ti>
96 <ti>Swap partition</ti> 96 <ti>Swap partition</ti>
97</tr> 97</tr>
98<tr> 98<tr>
99 <ti><path>/dev/hda3</path></ti> 99 <ti><path>/dev/sda3</path></ti>
100 <ti>ext3</ti> 100 <ti>ext3</ti>
101 <ti>Rest of the disk</ti> 101 <ti>Rest of the disk</ti>
102 <ti>Root partition</ti> 102 <ti>Root partition</ti>
103</tr> 103</tr>
104</table> 104</table>
167</p> 167</p>
168 168
169<pre caption="Filesystem usage example"> 169<pre caption="Filesystem usage example">
170$ <i>df -h</i> 170$ <i>df -h</i>
171Filesystem Type Size Used Avail Use% Mounted on 171Filesystem Type Size Used Avail Use% Mounted on
172/dev/hda5 ext3 509M 132M 351M 28% / 172/dev/sda5 ext3 509M 132M 351M 28% /
173/dev/hda2 ext3 5.0G 3.0G 1.8G 63% /home 173/dev/sda2 ext3 5.0G 3.0G 1.8G 63% /home
174/dev/hda7 ext3 7.9G 6.2G 1.3G 83% /usr 174/dev/sda7 ext3 7.9G 6.2G 1.3G 83% /usr
175/dev/hda8 ext3 1011M 483M 477M 51% /opt 175/dev/sda8 ext3 1011M 483M 477M 51% /opt
176/dev/hda9 ext3 2.0G 607M 1.3G 32% /var 176/dev/sda9 ext3 2.0G 607M 1.3G 32% /var
177/dev/hda1 ext2 51M 17M 31M 36% /boot 177/dev/sda1 ext2 51M 17M 31M 36% /boot
178/dev/hda6 swap 516M 12M 504M 2% &lt;not mounted&gt; 178/dev/sda6 swap 516M 12M 504M 2% &lt;not mounted&gt;
179<comment>(Unpartitioned space for future usage: 2 GB)</comment> 179<comment>(Unpartitioned space for future usage: 2 GB)</comment>
180</pre> 180</pre>
181 181
182<p> 182<p>
183<path>/usr</path> is rather full (83% used) here, but once 183<path>/usr</path> is rather full (83% used) here, but once
207<tr> 207<tr>
208 <th>Partition</th> 208 <th>Partition</th>
209 <th>Description</th> 209 <th>Description</th>
210</tr> 210</tr>
211<tr> 211<tr>
212 <ti><path>/dev/hda1</path></ti> 212 <ti><path>/dev/sda1</path></ti>
213 <ti>Boot partition</ti> 213 <ti>Boot partition</ti>
214</tr> 214</tr>
215<tr> 215<tr>
216 <ti><path>/dev/hda2</path></ti> 216 <ti><path>/dev/sda2</path></ti>
217 <ti>Swap partition</ti> 217 <ti>Swap partition</ti>
218</tr> 218</tr>
219<tr> 219<tr>
220 <ti><path>/dev/hda3</path></ti> 220 <ti><path>/dev/sda3</path></ti>
221 <ti>Root partition</ti> 221 <ti>Root partition</ti>
222</tr> 222</tr>
223</table> 223</table>
224 224
225<p> 225<p>
233<body> 233<body>
234 234
235<p> 235<p>
236<c>fdisk</c> is a popular and powerful tool to split your disk into partitions. 236<c>fdisk</c> is a popular and powerful tool to split your disk into partitions.
237Fire up <c>fdisk</c> on your disk (in our example, we use 237Fire up <c>fdisk</c> on your disk (in our example, we use
238<path>/dev/hda</path>): 238<path>/dev/sda</path>):
239</p> 239</p>
240 240
241<pre caption="Starting fdisk"> 241<pre caption="Starting fdisk">
242# <i>fdisk /dev/hda</i> 242# <i>fdisk /dev/sda</i>
243</pre> 243</pre>
244 244
245<p> 245<p>
246Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like this: 246Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like this:
247</p> 247</p>
255</p> 255</p>
256 256
257<pre caption="An example partition configuration"> 257<pre caption="An example partition configuration">
258Command (m for help): <i>p</i> 258Command (m for help): <i>p</i>
259 259
260Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders 260Disk /dev/sda: 240 heads, 63 sectors, 2184 cylinders
261Units = cylinders of 15120 * 512 bytes 261Units = cylinders of 15120 * 512 bytes
262 262
263Device Boot Start End Blocks Id System 263Device Boot Start End Blocks Id System
264/dev/hda1 1 14 105808+ 83 Linux 264/dev/sda1 1 14 105808+ 83 Linux
265/dev/hda2 15 49 264600 82 Linux swap 265/dev/sda2 15 49 264600 82 Linux swap
266/dev/hda3 50 70 158760 83 Linux 266/dev/sda3 50 70 158760 83 Linux
267/dev/hda4 71 2184 15981840 5 Extended 267/dev/sda4 71 2184 15981840 5 Extended
268/dev/hda5 71 209 1050808+ 83 Linux 268/dev/sda5 71 209 1050808+ 83 Linux
269/dev/hda6 210 348 1050808+ 83 Linux 269/dev/sda6 210 348 1050808+ 83 Linux
270/dev/hda7 349 626 2101648+ 83 Linux 270/dev/sda7 349 626 2101648+ 83 Linux
271/dev/hda8 627 904 2101648+ 83 Linux 271/dev/sda8 627 904 2101648+ 83 Linux
272/dev/hda9 905 2184 9676768+ 83 Linux 272/dev/sda9 905 2184 9676768+ 83 Linux
273 273
274Command (m for help): 274Command (m for help):
275</pre> 275</pre>
276 276
277<p> 277<p>
286<title>Removing all Partitions</title> 286<title>Removing all Partitions</title>
287<body> 287<body>
288 288
289<p> 289<p>
290We will first remove all existing partitions from the disk. Type <c>d</c> to 290We will first remove all existing partitions from the disk. Type <c>d</c> to
291delete a partition. For instance, to delete an existing <path>/dev/hda1</path>: 291delete a partition. For instance, to delete an existing <path>/dev/sda1</path>:
292</p> 292</p>
293 293
294<pre caption="Deleting a partition"> 294<pre caption="Deleting a partition">
295Command (m for help): <i>d</i> 295Command (m for help): <i>d</i>
296Partition number (1-4): <i>1</i> 296Partition number (1-4): <i>1</i>
309<c>d</c> and the number of the partition to delete it. Eventually, you'll end 309<c>d</c> and the number of the partition to delete it. Eventually, you'll end
310up with a partition table with nothing in it: 310up with a partition table with nothing in it:
311</p> 311</p>
312 312
313<pre caption="An empty partition table"> 313<pre caption="An empty partition table">
314Disk /dev/hda: 30.0 GB, 30005821440 bytes 314Disk /dev/sda: 30.0 GB, 30005821440 bytes
315240 heads, 63 sectors/track, 3876 cylinders 315240 heads, 63 sectors/track, 3876 cylinders
316Units = cylinders of 15120 * 512 = 7741440 bytes 316Units = cylinders of 15120 * 512 = 7741440 bytes
317 317
318Device Boot Start End Blocks Id System 318Device Boot Start End Blocks Id System
319 319
358</p> 358</p>
359 359
360<pre caption="Created boot partition"> 360<pre caption="Created boot partition">
361Command (m for help): <i>p</i> 361Command (m for help): <i>p</i>
362 362
363Disk /dev/hda: 30.0 GB, 30005821440 bytes 363Disk /dev/sda: 30.0 GB, 30005821440 bytes
364240 heads, 63 sectors/track, 3876 cylinders 364240 heads, 63 sectors/track, 3876 cylinders
365Units = cylinders of 15120 * 512 = 7741440 bytes 365Units = cylinders of 15120 * 512 = 7741440 bytes
366 366
367Device Boot Start End Blocks Id System 367Device Boot Start End Blocks Id System
368/dev/hda1 1 14 105808+ 83 Linux 368/dev/sda1 1 14 105808+ 83 Linux
369</pre> 369</pre>
370 370
371<p> 371<p>
372We need to make this partition bootable. Type <c>a</c> to toggle the bootable 372We need to make this partition bootable. Type <c>a</c> to toggle the bootable
373flag on a partition and select <c>1</c>. If you press <c>p</c> again, you will 373flag on a partition and select <c>1</c>. If you press <c>p</c> again, you will
381<body> 381<body>
382 382
383<p> 383<p>
384Let's now create the swap partition. To do this, type <c>n</c> to create a new 384Let's now create the swap partition. To do this, type <c>n</c> to create a new
385partition, then <c>p</c> to tell fdisk that you want a primary partition. Then 385partition, then <c>p</c> to tell fdisk that you want a primary partition. Then
386type <c>2</c> to create the second primary partition, <path>/dev/hda2</path> in 386type <c>2</c> to create the second primary partition, <path>/dev/sda2</path> in
387our case. When prompted for the first cylinder, hit enter. When prompted for 387our case. When prompted for the first cylinder, hit enter. When prompted for
388the last cylinder, type <c>+512M</c> to create a partition 512MB in size. After 388the last cylinder, type <c>+512M</c> to create a partition 512MB in size. After
389you've done this, type <c>t</c> to set the partition type, <c>2</c> to select 389you've done this, type <c>t</c> to set the partition type, <c>2</c> to select
390the partition you just created and then type in <c>82</c> to set the partition 390the partition you just created and then type in <c>82</c> to set the partition
391type to "Linux Swap". After completing these steps, typing <c>p</c> should 391type to "Linux Swap". After completing these steps, typing <c>p</c> should
393</p> 393</p>
394 394
395<pre caption="Partition listing after creating a swap partition"> 395<pre caption="Partition listing after creating a swap partition">
396Command (m for help): <i>p</i> 396Command (m for help): <i>p</i>
397 397
398Disk /dev/hda: 30.0 GB, 30005821440 bytes 398Disk /dev/sda: 30.0 GB, 30005821440 bytes
399240 heads, 63 sectors/track, 3876 cylinders 399240 heads, 63 sectors/track, 3876 cylinders
400Units = cylinders of 15120 * 512 = 7741440 bytes 400Units = cylinders of 15120 * 512 = 7741440 bytes
401 401
402Device Boot Start End Blocks Id System 402Device Boot Start End Blocks Id System
403/dev/hda1 * 1 14 105808+ 83 Linux 403/dev/sda1 * 1 14 105808+ 83 Linux
404/dev/hda2 15 81 506520 82 Linux swap 404/dev/sda2 15 81 506520 82 Linux swap
405</pre> 405</pre>
406 406
407</body> 407</body>
408</subsection> 408</subsection>
409<subsection> 409<subsection>
411<body> 411<body>
412 412
413<p> 413<p>
414Finally, let's create the root partition. To do this, type <c>n</c> to create a 414Finally, let's create the root partition. To do this, type <c>n</c> to create a
415new partition, then <c>p</c> to tell fdisk that you want a primary partition. 415new partition, then <c>p</c> to tell fdisk that you want a primary partition.
416Then type <c>3</c> to create the third primary partition, <path>/dev/hda3</path> 416Then type <c>3</c> to create the third primary partition, <path>/dev/sda3</path>
417in our case. When prompted for the first cylinder, hit enter. When prompted for 417in our case. When prompted for the first cylinder, hit enter. When prompted for
418the last cylinder, hit enter to create a partition that takes up the rest of the 418the last cylinder, hit enter to create a partition that takes up the rest of the
419remaining space on your disk. After completing these steps, typing <c>p</c> 419remaining space on your disk. After completing these steps, typing <c>p</c>
420should display a partition table that looks similar to this: 420should display a partition table that looks similar to this:
421</p> 421</p>
422 422
423<pre caption="Partition listing after creating the root partition"> 423<pre caption="Partition listing after creating the root partition">
424Command (m for help): <i>p</i> 424Command (m for help): <i>p</i>
425 425
426Disk /dev/hda: 30.0 GB, 30005821440 bytes 426Disk /dev/sda: 30.0 GB, 30005821440 bytes
427240 heads, 63 sectors/track, 3876 cylinders 427240 heads, 63 sectors/track, 3876 cylinders
428Units = cylinders of 15120 * 512 = 7741440 bytes 428Units = cylinders of 15120 * 512 = 7741440 bytes
429 429
430Device Boot Start End Blocks Id System 430Device Boot Start End Blocks Id System
431/dev/hda1 * 1 14 105808+ 83 Linux 431/dev/sda1 * 1 14 105808+ 83 Linux
432/dev/hda2 15 81 506520 82 Linux swap 432/dev/sda2 15 81 506520 82 Linux swap
433/dev/hda3 82 3876 28690200 83 Linux 433/dev/sda3 82 3876 28690200 83 Linux
434</pre> 434</pre>
435 435
436</body> 436</body>
437</subsection> 437</subsection>
438<subsection> 438<subsection>
511 <ti><c>mkfs.jfs</c></ti> 511 <ti><c>mkfs.jfs</c></ti>
512</tr> 512</tr>
513</table> 513</table>
514 514
515<p> 515<p>
516For instance, to have the boot partition (<path>/dev/hda1</path> in our 516For instance, to have the boot partition (<path>/dev/sda1</path> in our
517example) in ext2 and the root partition (<path>/dev/hda3</path> in our example) 517example) in ext2 and the root partition (<path>/dev/sda3</path> in our example)
518in ext3 (as in our example), you would use: 518in ext3 (as in our example), you would use:
519</p> 519</p>
520 520
521<pre caption="Applying a filesystem on a partition"> 521<pre caption="Applying a filesystem on a partition">
522# <i>mke2fs /dev/hda1</i> 522# <i>mke2fs /dev/sda1</i>
523# <i>mke2fs -j /dev/hda3</i> 523# <i>mke2fs -j /dev/sda3</i>
524</pre> 524</pre>
525 525
526<p> 526<p>
527Now create the filesystems on your newly created partitions (or logical 527Now create the filesystems on your newly created partitions (or logical
528volumes). 528volumes).
537<p> 537<p>
538<c>mkswap</c> is the command that is used to initialize swap partitions: 538<c>mkswap</c> is the command that is used to initialize swap partitions:
539</p> 539</p>
540 540
541<pre caption="Creating a Swap signature"> 541<pre caption="Creating a Swap signature">
542# <i>mkswap /dev/hda2</i> 542# <i>mkswap /dev/sda2</i>
543</pre> 543</pre>
544 544
545<p> 545<p>
546To activate the swap partition, use <c>swapon</c>: 546To activate the swap partition, use <c>swapon</c>:
547</p> 547</p>
548 548
549<pre caption="Activating the swap partition"> 549<pre caption="Activating the swap partition">
550# <i>swapon /dev/hda2</i> 550# <i>swapon /dev/sda2</i>
551</pre> 551</pre>
552 552
553<p> 553<p>
554Create and activate the swap with the commands mentioned above. 554Create and activate the swap with the commands mentioned above.
555</p> 555</p>
567create the necessary mount directories for every partition you created. As an 567create the necessary mount directories for every partition you created. As an
568example we mount the root and boot partition: 568example we mount the root and boot partition:
569</p> 569</p>
570 570
571<pre caption="Mounting partitions"> 571<pre caption="Mounting partitions">
572# <i>mount /dev/hda3 /mnt/gentoo</i> 572# <i>mount /dev/sda3 /mnt/gentoo</i>
573# <i>mkdir /mnt/gentoo/boot</i> 573# <i>mkdir /mnt/gentoo/boot</i>
574# <i>mount /dev/hda1 /mnt/gentoo/boot</i> 574# <i>mount /dev/sda1 /mnt/gentoo/boot</i>
575</pre> 575</pre>
576 576
577<note> 577<note>
578If you want your <path>/tmp</path> to reside on a separate partition, be sure to 578If you want your <path>/tmp</path> to reside on a separate partition, be sure to
579change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This 579change its permissions after mounting: <c>chmod 1777 /mnt/gentoo/tmp</c>. This

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20