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

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

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

Revision 1.10 Revision 1.11
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/1.0 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-mips-disk.xml,v 1.10 2005/01/04 18:11:20 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-mips-disk.xml,v 1.11 2005/02/14 14:59:19 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.6</version> 11<version>1.7</version>
12<date>2004-09-14</date> 12<date>2005-02-14</date>
13 13
14<section> 14<section>
15<title>Introduction to Block Devices</title> 15<title>Introduction to Block Devices</title>
16<subsection> 16<subsection>
17<title>Block Devices</title> 17<title>Block Devices</title>
108</subsection> 108</subsection>
109</section> 109</section>
110<section> 110<section>
111<title>Using fdisk on MIPS to Partition your Disk</title> 111<title>Using fdisk on MIPS to Partition your Disk</title>
112<subsection> 112<subsection>
113<title>Creating an SGI Disk Label</title> 113<title>SGI Machines: Creating an SGI Disk Label</title>
114<body> 114<body>
115 115
116<p> 116<p>
117All disks in an SGI System require an <e>SGI Disk Label</e>, which serves a 117All disks in an SGI System require an <e>SGI Disk Label</e>, which serves a
118similar function as Sun &amp; MS-DOS disklabels -- It stores information about 118similar function as Sun &amp; MS-DOS disklabels -- It stores information about
120partitions on the disk: 120partitions on the disk:
121</p> 121</p>
122 122
123<ul> 123<ul>
124 <li> 124 <li>
125 <e>SGI Volume Header</e> (9th partition): This partition is important. It 125<!-- <e>SGI Volume Header</e> (9th partition): This partition is important. It
126 is where the kernel images will go. To store kernel images, you will utilize 126 is where the kernel images will go. To store kernel images, you will utilize
127 the tool known as <c>dvhtool</c> to copy kernel images to this partition. 127 the tool known as <c>dvhtool</c> to copy kernel images to this partition.
128 You will then be able to boot kernels from this partition via the SGI PROM 128 You will then be able to boot kernels from this partition via the SGI PROM
129 Monitor. 129 Monitor. -->
130 <e>SGI Volume Header</e> (9th partition): This partition is important. It
131 is where the arcboot bootloader will go.
130 </li> 132 </li>
131 <li> 133 <li>
132 <e>SGI Volume</e> (11th partition): This partition is similar in purpose to 134 <e>SGI Volume</e> (11th partition): This partition is similar in purpose to
133 the Sun Disklabel's third partition of "Whole Disk". This partition spans 135 the Sun Disklabel's third partition of "Whole Disk". This partition spans
134 the entire disk, and should be left untouched. It serves no special purpose 136 the entire disk, and should be left untouched. It serves no special purpose
198Sun or MS-DOS disklabel, write the changes to disk, and restart fdisk. The 200Sun or MS-DOS disklabel, write the changes to disk, and restart fdisk. The
199second is to overwrite the partition table with null data via the following 201second is to overwrite the partition table with null data via the following
200command: <c>dd if=/dev/zero of=/dev/sda bs=512 count=1</c>. 202command: <c>dd if=/dev/zero of=/dev/sda bs=512 count=1</c>.
201</note> 203</note>
202 204
203</body> 205<!-- This has been dropped in favour of using arcboot
204</subsection>
205<subsection>
206<title>Getting the SGI Volume Header to just the right size</title> 206<p>Getting the SGI Volume Header to just the right size</p>
207<body>
208 207
209<p> 208<p>
210Now that an SGI Disklabel is created, partitions may now be defined. In the 209Now that an SGI Disklabel is created, partitions may now be defined. In the
211above example, there are already two partitions defined for you. These are the 210above example, there are already two partitions defined for you. These are the
212special partitions mentioned above and should not normally be altered. However, 211special partitions mentioned above and should not normally be altered. However,
215yet. The volume header itself can hold up to <e>eight</e> images of any size, 214yet. The volume header itself can hold up to <e>eight</e> images of any size,
216with each image allowed eight-character names. 215with each image allowed eight-character names.
217</p> 216</p>
218 217
219<p> 218<p>
220The process of making the volume header larger isn't exactly straight-forward -- 219The process of making the volume header larger isn't exactly straight-forward - -
221there's a bit of a trick to it. One cannot simply delete and re-add the volume 220there's a bit of a trick to it. One cannot simply delete and re-add the volume
222header due to odd fdisk behavior. In the example provided below, we'll create a 221header due to odd fdisk behavior. In the example provided below, we'll create a
22350MB Volume header in conjunction with a 50MB /boot partition. The actual layout 22250MB Volume header in conjunction with a 50MB /boot partition. The actual layout
224of your disk may vary, but this is for illustrative purposes only. 223of your disk may vary, but this is for illustrative purposes only.
225</p> 224</p>
227<pre caption="Resizing the SGI Volume Header correctly"> 226<pre caption="Resizing the SGI Volume Header correctly">
228Command (m for help): <i>n</i> 227Command (m for help): <i>n</i>
229Partition number (1-16): <i>1</i> 228Partition number (1-16): <i>1</i>
230First cylinder (5-8682, default 5): <i>51</i> 229First cylinder (5-8682, default 5): <i>51</i>
231 Last cylinder (51-8682, default 8682): <i>101</i> 230 Last cylinder (51-8682, default 8682): <i>101</i>
231
232<comment>(Notice how fdisk only allows Partition #1 to be re-created starting at a minimum of cylinder 5)</comment> 232<comment>(Notice how fdisk only allows Partition #1 to be re-created starting at a
233<comment>(Had you attempted to delete &amp; re-create the SGI Volume Header this way, this is the same issue 233minimum of cylinder 5? Had you attempted to delete &amp; re-create the SGI
234 you would have encountered.)</comment> 234Volume Header this way, this is the same issue you would have encountered.
235<comment>(In our example, we want /boot to be 50MB, so we start it at cylinder 51 (the Volume Header needs to 235In our example, we want /boot to be 50MB, so we start it at cylinder 51 (the
236 start at cylinder 0, remember?), and set its ending cylinder to 101, which will roughly be 50MB (+/- 1-5MB))</comment> 236Volume Header needs to start at cylinder 0, remember?), and set its ending
237cylinder to 101, which will roughly be 50MB (+/- 1-5MB).)</comment>
237 238
238Command (m for help): <i>d</i> 239Command (m for help): <i>d</i>
239Partition number (1-16): <i>9</i> 240Partition number (1-16): <i>9</i>
241
240<comment>(Delete Partition #9 (SGI Volume Header))</comment> 242<comment>(Delete Partition #9 (SGI Volume Header))</comment>
241 243
242Command (m for help): <i>n</i> 244Command (m for help): <i>n</i>
243Partition number (1-16): <i>9</i> 245Partition number (1-16): <i>9</i>
244First cylinder (0-50, default 0): <i>0</i> 246First cylinder (0-50, default 0): <i>0</i>
245 Last cylinder (0-50, default 50): <i>50</i> 247 Last cylinder (0-50, default 50): <i>50</i>
248
246<comment>(Re-Create Partition #9, ending just before Partition #1)</comment> 249<comment>(Re-Create Partition #9, ending just before Partition #1)</comment>
247</pre> 250</pre>
248 251-->
249</body> 252<p>
250</subsection> 253If you're unsure how to use <c>fdisk</c> have a look down further at the
251<subsection> 254instructions for partitioning on Cobalts. The concepts are exactly the same --
252<title>Final partition layout</title> 255just remember to leave the volume header and whole disk partitions alone.
253<body>
254
255<p> 256</p>
257
258<!-- <p> Perhaps part of the above commented-out block?
256Once this is done, you are safe to create the rest of your partitions as you see 259Once this is done, you are safe to create the rest of your partitions as you see
257fit. After all your partitions are laid out, make sure you set the partition ID 260fit. After all your partitions are laid out, make sure you set the partition ID
258of your swap partition to <c>82</c>, which is Linux Swap. By default, it will be 261of your swap partition to <c>82</c>, which is Linux Swap. By default, it will be
259<c>83</c>, Linux Native. 262<c>83</c>, Linux Native.
260</p> 263</p> -->
261 264
262<p> 265<p>
263Now that your partitions are created, you can now continue with <uri 266Now that your partitions are created, you can now continue with <uri
264link="#filesystems">Creating Filesystems</uri>. 267link="#filesystems">Creating Filesystems</uri>.
265</p> 268</p>
266 269
267</body> 270</body>
268</subsection> 271</subsection>
272
273<subsection>
274<title>Cobalt Machines: Partitioning your drive</title>
275<body>
276
277<p>
278On Cobalt machines, the BOOTROM expects to see a MS-DOS MBR, so partitioning the
279drive is relatively straightforward -- in fact, it's done the same way as you'd
280do for an Intel x86 machine. <e>However</e> there are some things you need to
281bear in mind.
282</p>
283
284<ul>
285 <li>
286 Cobalt firmware will expect <path>/dev/hda1</path> to be a Linux partition
287 formatted <e>EXT2 Revision 0</e>. <e>EXT2 Revision 1 partitions will NOT
288 WORK!</e> (The Cobalt BOOTROM only understands EXT2r0)
289 </li>
290 <li>
291 The above said partition must contain a gzipped ELF image,
292 <path>vmlinux.gz</path> in the root of that partition, which it loads as the
293 kernel
294 </li>
295</ul>
296
297<p>
298For that reason, I recommend creating a ~20MB <path>/boot</path> partition
299formatted EXT2r0 upon which you can install CoLo &amp; your kernels. This
300allows you to run a modern filesystem (EXT3 or ReiserFS) for your root
301filesystem.
302</p>
303
304<p>
305I will assume you have created <path>/dev/hda1</path> to mount later as a
306<path>/boot</path> partition. If you wish to make this <path>/</path>, you'll
307need to keep the PROM's expectations in mind.
308</p>
309
310<p>
311So, continuing on... To create the partitions you type <c>fdisk /dev/hda</c> at
312the prompt. The main commands you need to know are these:
313</p>
314
315<ul>
316 <li>
317 <c>o</c>: Wipe out old partition table, starting with an empty MS-DOS
318 partition table
319 </li>
320 <li>
321 <c>n</c>: New Partition
322 </li>
323 <li>
324 <c>t</c>: Change Partition Type
325 <ul>
326 <li>Use type <c>82</c> for Linux Swap, <c>83</c> for Linux FS</li>
327 </ul>
328 </li>
329 <li>
330 <c>d</c>: Delete a partition
331 </li>
332 <li>
333 <c>p</c>: Display (print) Partition Table
334 </li>
335 <li>
336 <c>q</c>: Quit -- leaving old partition table as is.
337 </li>
338 <li>
339 <c>w</c>: Quit -- writing partition table in the process.
340 </li>
341</ul>
342
343<pre caption="Partitioning the disk">
344# <i>fdisk /dev/hda</i>
345
346The number of cylinders for this disk is set to 19870.
347There is nothing wrong with that, but this is larger than 1024,
348and could in certain setups cause problems with:
3491) software that runs at boot time (e.g., old versions of LILO)
3502) booting and partitioning software from other OSs
351 (e.g., DOS FDISK, OS/2 FDISK)
352
353<comment>(Start by clearing out any existing partitions)</comment>
354Command (m for help): <i>o</i>
355Building a new DOS disklabel. Changes will remain in memory only,
356until you decide to write them. After that, of course, the previous
357content won't be recoverable.
358
359
360The number of cylinders for this disk is set to 19870.
361There is nothing wrong with that, but this is larger than 1024,
362and could in certain setups cause problems with:
3631) software that runs at boot time (e.g., old versions of LILO)
3642) booting and partitioning software from other OSs
365 (e.g., DOS FDISK, OS/2 FDISK)
366Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
367
368<comment>(You can now verify the partition table is empty using the 'p' command)</comment>
369
370Command (m for help): <i>p</i>
371
372Disk /dev/hda: 10.2 GB, 10254827520 bytes
37316 heads, 63 sectors/track, 19870 cylinders
374Units = cylinders of 1008 * 512 = 516096 bytes
375
376 Device Boot Start End Blocks Id System
377
378<comment>(Create the /boot partition)</comment>
379
380Command (m for help): <i>n</i>
381Command action
382 e extended
383 p primary partition (1-4)
384<i>p</i>
385Partition number (1-4): <i>1</i>
386
387<comment>(Just press ENTER here to accept the default)</comment>
388
389First cylinder (1-19870, default 1):
390Last cylinder or +size or +sizeM or +sizeK (1-19870, default 19870): <i>+20M</i>
391
392<comment>(and now if we type 'p' again, we should see the new partition)</comment>
393Command (m for help): <i>p</i>
394
395Disk /dev/hda: 10.2 GB, 10254827520 bytes
39616 heads, 63 sectors/track, 19870 cylinders
397Units = cylinders of 1008 * 512 = 516096 bytes
398
399 Device Boot Start End Blocks Id System
400/dev/hda1 1 40 20128+ 83 Linux
401
402<comment>(The rest, I prefer to put in an extended partition, so I'll create that)</comment>
403
404Command (m for help): <i>n</i>
405Command action
406 e extended
407 p primary partition (1-4)
408<i>e</i>
409Partition number (1-4): <i>2</i>
410
411<comment>(Again, the default is fine, just press ENTER.)</comment>
412
413First cylinder (41-19870, default 41):
414Using default value 41
415
416<comment>(We want to use the whole disk here, so just press ENTER again)</comment>
417Last cylinder or +size or +sizeM or +sizeK (41-19870, default 19870):
418Using default value 19870
419
420<comment>(Now, the / partition -- I use separate partitions for /usr, /var,
421etc... so / can be small. Adjust as per your preference.)</comment>
422
423Command (m for help): <i>n</i>
424Command action
425 l logical (5 or over)
426 p primary partition (1-4)
427<i>l</i>
428First cylinder (41-19870, default 41):<i>&lt;Press ENTER&gt;</i>
429Using default value 41
430Last cylinder or +size or +sizeM or +sizeK (41-19870, default 19870): <i>+500M</i>
431
432<comment>(... and similar for any other partitions ...)</comment>
433
434<comment>(Last but not least, the swap space. I recommend at least 250MB swap,
435preferrably 1GB)</comment>
436
437Command (m for help): <i>n</i>
438Command action
439 l logical (5 or over)
440 p primary partition (1-4)
441<i>l</i>
442First cylinder (17294-19870, default 17294): <i>&lt;Press ENTER&gt;</i>
443Using default value 17294
444Last cylinder or +size or +sizeM or +sizeK (1011-19870, default 19870): <i>&lt;Press ENTER&gt;</i>
445Using default value 19870
446
447<comment>(Now, if we check our partition table, everything should mostly be ship
448shape except for one thing...)</comment>
449
450Command (m for help): <i>p</i>
451
452Disk /dev/hda: 10.2 GB, 10254827520 bytes
45316 heads, 63 sectors/track, 19870 cylinders
454Units = cylinders of 1008 * 512 = 516096 bytes
455
456Device Boot Start End Blocks ID System
457/dev/hda1 1 21 10552+ 83 Linux
458/dev/hda2 22 19870 10003896 5 Extended
459/dev/hda5 22 1037 512032+ 83 Linux
460/dev/hda6 1038 5101 2048224+ 83 Linux
461/dev/hda7 5102 9165 2048224+ 83 Linux
462/dev/hda8 9166 13229 2048224+ 83 Linux
463/dev/hda9 13230 17293 2048224+ 83 Linux
464/dev/hda10 17294 19870 1298776+ 83 Linux
465
466<comment>(Notice how #10, our swap partition is still type 83?)</comment>
467
468Command (m for help): <i>t</i>
469Partition number (1-10): <i>10</i>
470Hex code (type L to list codes): <i>82</i>
471Changed system type of partition 10 to 82 (Linux swap)
472
473<comment>(That should fix it... just to verify...)</comment>
474
475Command (m for help): <i>p</i>
476
477Disk /dev/hda: 10.2 GB, 10254827520 bytes
47816 heads, 63 sectors/track, 19870 cylinders
479Units = cylinders of 1008 * 512 = 516096 bytes
480
481Device Boot Start End Blocks ID System
482/dev/hda1 1 21 10552+ 83 Linux
483/dev/hda2 22 19870 10003896 5 Extended
484/dev/hda5 22 1037 512032+ 83 Linux
485/dev/hda6 1038 5101 2048224+ 83 Linux
486/dev/hda7 5102 9165 2048224+ 83 Linux
487/dev/hda8 9166 13229 2048224+ 83 Linux
488/dev/hda9 13230 17293 2048224+ 83 Linux
489/dev/hda10 17294 19870 1298776+ 82 Linux Swap
490
491<comment>(Now, we write out the new partition table.)</comment>
492
493Command (m for help): <i>w</i>
494The partition table has been altered!
495
496Calling ioctl() to re-read partition table.
497Syncing disks.
498
499#
500</pre>
501
502<p>
503And that's all there is to it. You should now be right to proceed onto the
504next stage: <uri link="#filesystems">Creating Filesystems</uri>.
505</p>
506
507</body>
508</subsection>
269</section> 509</section>
510
270<section id="filesystems"> 511<section id="filesystems">
271<title>Creating Filesystems</title> 512<title>Creating Filesystems</title>
272<subsection> 513<subsection>
273<title>Introduction</title> 514<title>Introduction</title>
274<body> 515<body>
286<subsection> 527<subsection>
287<title>Filesystems?</title> 528<title>Filesystems?</title>
288<body> 529<body>
289 530
290<p> 531<p>
291Several filesystems are available. Ext2 and ext3 are found stable on the 532Several filesystems are available. ReiserFS, EXT2 and EXT3 are found stable
292MIPS architectures, others are experimental. 533on the MIPS architectures, others are experimental.
293</p> 534</p>
294 535
295<p> 536<p>
296<b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata 537<b>ext2</b> is the tried and true Linux filesystem but doesn't have metadata
297journaling, which means that routine ext2 filesystem checks at startup time can 538journaling, which means that routine ext2 filesystem checks at startup time can
389<p> 630<p>
390Now create the filesystems on your newly created partitions (or logical 631Now create the filesystems on your newly created partitions (or logical
391volumes). 632volumes).
392</p> 633</p>
393 634
635<warn>
636If you're installing on a Cobalt server, remember <path>/dev/hda1</path> MUST be
637of type <e>EXT2 revision 0</e>; Anything else (e.g. EXT2 revision 1, EXT3,
638ReiserFS, XFS, JFS and others) <e>WILL NOT WORK!</e>
639You can format the partition using the command: <c>mke2fs -r 0 /dev/hda1</c>.
640</warn>
641
642<warn>
643Also, be aware that arcboot currently is not able to read any filesystem other
644than EXT2, EXT3 and ISO9660 (recent versions). For that reason,
645<path>/boot</path> on SGI machines must also reside on an EXT2 or EXT3 partition.
646</warn>
647
394</body> 648</body>
395</subsection> 649</subsection>
396<subsection> 650<subsection>
397<title>Activating the Swap Partition</title> 651<title>Activating the Swap Partition</title>
398<body> 652<body>
399 653
400<p> 654<p>
401<c>mkswap</c> is the command that is used to initialize swap partitions: 655<c>mkswap</c> is the command that is used to create and initialize swap partitions:
402</p> 656</p>
403 657
404<pre caption="Creating a Swap signature"> 658<pre caption="Creating a Swap signature">
405# <i>mkswap /dev/sda2</i> 659# <i>mkswap /dev/sda2</i>
406</pre> 660</pre>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20