/[gentoo]/xml/htdocs/doc/en/gentoo-x86-tipsntricks.xml
Gentoo

Contents of /xml/htdocs/doc/en/gentoo-x86-tipsntricks.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (hide annotations) (download) (as text)
Mon Apr 16 05:39:54 2007 UTC (7 years, 5 months ago) by nightmorph
Branch: MAIN
Changes since 1.23: +4 -4 lines
File MIME type: application/xml
changed modules-update command to update-modules, per the runtime warning about modules-update being deprecated. weird. seems update-modules used to be the name anyway years ago, see lpi 101 part 2.

1 swift 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 nightmorph 1.24 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-x86-tipsntricks.xml,v 1.23 2007/04/10 06:48:59 nightmorph Exp $ -->
4 swift 1.1
5     <guide link="/doc/en/gentoo-x86-tipsntricks.xml">
6     <title>Gentoo/x86 Installation Tips &amp; Tricks</title>
7 neysx 1.16
8 swift 1.1 <author title="Author">
9 nightmorph 1.21 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
10 neysx 1.16 </author>
11     <author title="Editor">
12     <mail link="neysx@gentoo.org">Xavier Neys</mail>
13 swift 1.1 </author>
14    
15     <abstract>
16     The Gentoo installation allows for very flexible approaches to the various
17     installation methods. As it is almost impossible to insert every single tip or
18     trick in the installation instructions this document tries to deal with all
19     submitted tips and tricks for reference purposes.
20     </abstract>
21    
22 rane 1.15 <!-- The content of this document is licensed under the CC-BY-SA license -->
23     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
24 swift 1.1 <license/>
25    
26 nightmorph 1.24 <version>1.14</version>
27     <date>2007-04-15</date>
28 swift 1.1
29     <chapter>
30     <title>Introduction</title>
31     <section>
32     <title>Preliminary</title>
33     <body>
34    
35     <p>
36     This document contains various tips and tricks for the Gentoo/x86 installation.
37     Most of them are discussed in a dense way - they are meant as an addendum to the
38     installation instructions and not as a replacement.
39     </p>
40    
41     </body>
42     </section>
43     <section>
44     <title>Contents</title>
45     <body>
46    
47 swift 1.2 <p>
48     <b>Advanced Installations</b>
49     </p>
50    
51 swift 1.1 <ul>
52     <li><uri link="#software-raid">Software RAID</uri></li>
53 swift 1.4 <li><uri link="#ata-raid-2.4">ATA RAID using 2.4 kernels</uri></li>
54 rane 1.15 <li><uri link="#livecd-kernel">Using the Installation CD kernel</uri></li>
55 swift 1.1 </ul>
56    
57 swift 1.3 <p>
58     <b>Simplifying the Installation</b>
59     </p>
60    
61     <ul>
62     <li><uri link="#leave_terminal">Leaving the Terminal</uri></li>
63     </ul>
64    
65 swift 1.5 <p>
66     <b>Fixing Errors/Issues</b>
67     </p>
68    
69     <ul>
70     <li><uri link="#checking-disks">Extensive Testing of your Disks</uri></li>
71 swift 1.6 <li>
72     <uri link="#recover">Recovering from a malfunctioning installation</uri>
73     </li>
74 swift 1.5 </ul>
75    
76 swift 1.1 </body>
77     </section>
78     </chapter>
79     <chapter>
80     <title>Advanced Installations</title>
81     <section id="software-raid">
82     <title>Software RAID</title>
83     <body>
84    
85     <note>
86 neysx 1.12 If you are not familiar with software raid, please read the <uri
87 swift 1.1 link="http://tldp.org/HOWTO/Software-RAID-HOWTO.html">Software-RAID-HOWTO</uri>.
88     </note>
89    
90 neysx 1.19 <note>
91     A more detailed procedure can be found in our <uri
92     link="/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml">Software Raid and LVM2 x86
93     Quick Install Guide</uri>.
94     </note>
95    
96 swift 1.1 <p>
97 neysx 1.19 Once you are booted from the Installation CD, load the appropriate RAID
98     modules. For instance, if you plan on using RAID-1:
99 swift 1.1 </p>
100    
101     <pre caption="Loading the RAID-1 module">
102     # <i>modprobe raid1</i>
103     </pre>
104    
105     <p>
106     When you partition your disks, make sure that your partitions use <c>fd</c>
107     (Linux raid autodetect) as Partition Type instead of <c>83</c> (Linux native).
108     You can alter the partition type using the <c>t</c> command in <c>fdisk</c>.
109     </p>
110    
111     <p>
112 swift 1.11 Now before we start creating the RAID arrays, we need to create the metadevice
113     nodes:
114     </p>
115    
116     <pre caption="Creating metadevice nodes">
117 neysx 1.17 # <i>mknod /dev/md1 b 9 1</i>
118     # <i>mknod /dev/md2 b 9 2</i>
119     # <i>mknod /dev/md3 b 9 3</i>
120 swift 1.11 </pre>
121    
122     <p>
123 swift 1.8 After partitioning, create the <path>/etc/mdadm.conf</path> file (yes, indeed,
124 rane 1.15 on the Installation CD environment) using <c>mdadm</c>, an advanced tool for <uri
125 swift 1.7 link="http://www.linuxdevcenter.com/pub/a/linux/2002/12/05/RAID.html">RAID
126     management</uri>. For instance, to have your boot, swap and root partition
127     mirrored (RAID-1) covering <path>/dev/sda</path> and <path>/dev/sdb</path>,
128     you can use:
129 swift 1.1 </p>
130    
131 neysx 1.17 <pre caption="Creating raid devices with the mdadm command">
132 neysx 1.16 # <i>mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1</i>
133     # <i>mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2</i>
134     # <i>mdadm --create --verbose /dev/md3 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3</i>
135 swift 1.1 </pre>
136    
137 neysx 1.16 <impo>
138 nightmorph 1.18 You should not use any form of striping such as RAID-0 or RAID-5 on the
139 neysx 1.16 partition you boot from.
140     </impo>
141    
142 swift 1.1 <p>
143     The Linux Software RAID driver will start creating the metadevices. You can see
144     its progress in <path>/proc/mdstat</path>. Wait until the metadevices are
145     completely finished before proceeding.
146     </p>
147    
148 neysx 1.17 <pre caption="Saving information about the created devices">
149     # <i>mdadm --detail --scan > /etc/mdadm.conf</i>
150     </pre>
151    
152 swift 1.1 <p>
153 neysx 1.16 From now onwards, use <path>/dev/md1</path> for the boot partition,
154     <path>/dev/md2</path> for the swap partition and <path>/dev/md3</path> for the
155 swift 1.1 root partition.
156     </p>
157    
158     <p>
159 neysx 1.16 Right before chrooting, don't forget to copy over <path>/etc/mdadm.conf</path>
160     to <path>/mnt/gentoo/etc</path>.
161 swift 1.1 </p>
162    
163     <p>
164     When you're configuring your kernel, make sure you have the appropriate RAID
165     support <e>in</e> your kernel and not as module.
166     </p>
167    
168     <p>
169 neysx 1.16 When installing extra tools, emerge <c>mdadm</c> as well. Note that this isn't
170     available on all Installation CDs so you might not be able to install Gentoo on
171     a Software RAID when using a networkless installation!
172 swift 1.1 </p>
173    
174     <p>
175     When configuring your bootloader, make sure it gets installed in the MBR of
176     <e>both</e> disks if you use mirroring.
177     </p>
178    
179     </body>
180     </section>
181 swift 1.4 <section id="ata-raid-2.4">
182     <title>ATA RAID using 2.4 kernels</title>
183     <body>
184    
185     <p>
186 rane 1.15 Make sure you boot your Installation CD using the <c>doataraid</c> option. Once booted,
187 swift 1.4 check the contents of <path>/dev/ataraid</path>. It should contain various
188     <path>disc*</path> directories for each harddisk available in the ATA RAID. An
189     entire disk is displayed as <path>disc</path> while partitions are
190     <path>part*</path>.
191     </p>
192    
193     <p>
194     Write down the various <path>/dev/ataraid/disc*/*</path> device files that you
195     use to install Gentoo on. You will need to substitute the <path>/dev/hda</path>
196     examples in the installation with this path.
197     </p>
198    
199     <p>
200     Before chrooting, bind-mount the <path>/dev</path> structure in the new
201     environment:
202     </p>
203    
204     <pre caption="Bind-mounting /dev">
205     # <i>mount -o bind /dev /mnt/gentoo/dev</i>
206     </pre>
207    
208     <p>
209     When configuring your kernel, make sure you enable support for your ATA RAID
210     chipset and options. For instance, a popular ATA RAID system is a <e>Promise
211     FastTrack built-in RAID</e> in which case you definitely need <c>Promise
212     FastTrack Options</c> built in into your kernel.
213     </p>
214    
215     <p>
216     When configuring GRUB, you first have to create a GRUB bootdisk. This is not as
217     hard as you think. First install GRUB as you would, but when you come to the
218     part where GRUB is getting installed in the MBR, follow the following
219     instructions:
220     </p>
221    
222     <pre caption="Creating a GRUB bootdisk">
223     # <i>cd /boot/grub</i>
224     # <i>dd if=stage1 of=/dev/fd0 bs=512 count=1</i>
225     # <i>dd if=stage2 of=/dev/fd0 bs=512 seek=1</i>
226     </pre>
227    
228     <p>
229     You still need to write your <path>grub.conf</path> file. This is no different
230     from the installation instructions, just make sure that your <c>root=</c> points
231     to the ATA RAID device.
232     </p>
233    
234     <p>
235     After finishing the installation, boot with your GRUB bootdisk. You will be
236     greeted by a GRUB prompt. Now configure GRUB to boot from the ATA RAID device:
237     </p>
238    
239     <pre caption="Installing GRUB on the ATA RAID">
240     grub&gt; root (hd0,x)
241     grub&gt; setup (hd0)
242     grub&gt; quit
243     </pre>
244    
245     <p>
246     Now reboot (with the GRUB bootfloppy removed).
247     </p>
248    
249     <p>
250     LILO users can safely use the instructions mentioned in the installation
251     instructions.
252     </p>
253    
254     </body>
255     </section>
256 swift 1.10 <section id="livecd-kernel">
257 rane 1.15 <title>Using the Installation CD kernel</title>
258 swift 1.10 <body>
259    
260     <p>
261     If you don't want to compile a kernel yourself you can use the kernel from the
262 rane 1.15 Installation CD and copy it to your system. When you come to the point that you're asked
263 swift 1.10 to compile a kernel, go to another terminal (press Alt-F2) and log in with the
264     root password you've supplied at the beginning of the installation.
265     </p>
266    
267     <p>
268     Copy over the kernel and modules to your Gentoo system:
269     </p>
270    
271 rane 1.15 <pre caption="Copying over the Installation CD kernel">
272 swift 1.10 <comment>(${KN} is the kernel name, usually something like 'gentoo' or 'smp')</comment>
273 nightmorph 1.22 cdimage ~# <i>cp /mnt/cdrom/isolinux/${KN} /mnt/cdrom/isolinux/${KN}.igz /mnt/gentoo/boot</i>
274 swift 1.10 cdimage ~# <i>mkdir -p /mnt/gentoo/lib/modules</i>
275     cdiamge ~# <i>cp -Rp /lib/modules/`uname -r` /mnt/gentoo/lib/modules</i>
276     </pre>
277    
278     <p>
279 nightmorph 1.23 To have all modules that are currently running (from the Installation CD) loaded
280     during bootup of your Gentoo system, run the following command from within the
281     chrooted environment:
282 swift 1.10 </p>
283    
284     <pre caption="Adding all running modules to the modules.conf file">
285     # <i>cat /proc/modules | cut -d ' ' -f 1 &gt;&gt; \</i>
286     <i>/etc/modules.autoload.d/kernel-`uname -r | cut -d . -f -2`</i>
287 nightmorph 1.24 # <i>update-modules</i>
288 swift 1.10 </pre>
289    
290     </body>
291     </section>
292 swift 1.1 </chapter>
293 swift 1.3
294     <chapter>
295     <title>Simplifying the Installation</title>
296     <section id="leave_terminal">
297     <title>Leaving your Terminal</title>
298     <body>
299    
300     <p>
301     Many people want to leave their system when it's compiling. In certain cases
302     this is rather difficult as the installation is done in a public environment
303     where you cannot trust everyone. If this is the case, you want to be able to
304     perform the compilation in the background and log out from all terminals.
305     </p>
306    
307     <p>
308     There are several possible solutions for this. The first one is to use
309 rane 1.15 <c>screen</c>. After booting the Installation CD, set your root password and start a
310 swift 1.3 screen session:
311     </p>
312    
313     <note>
314 rane 1.15 Not all Installation CDs provide screen. If this is the case, you will have to use one of
315 swift 1.3 the other methods described in this section.
316     </note>
317    
318     <pre caption="Starting a screen session">
319     # <i>screen -S gentoo</i>
320     </pre>
321    
322     <p>
323     Once inside the screen session you can perform the entire installation. When you
324     want to leave your terminal, press <c>Ctrl-a, d</c> (that is, control and a at
325     the same time, then followed by a d) to <e>detach</e> your screen session. You
326     can now safely log out of your system.
327     </p>
328    
329     <p>
330     To regain access to your terminal, log in as root again and <e>attach</e> to
331     the running screen session:
332     </p>
333    
334     <pre caption="Attaching to a screen session">
335     # <i>screen -x gentoo</i>
336     </pre>
337    
338     <p>
339     If you can't use screen, there is still a way to leave your terminal. Follow the
340     installation instructions, but when you come to the point where a long-term
341     compilation would be started (for instance the <c>./scripts/bootstrap.sh</c>
342     step), use <c>nohup</c> which allows for a process to continue even when you log
343     out. Don't forget the trailing "&amp;", otherwise the process won't be placed in
344     the background! Remember where you are (the <c>pwd</c> command will show you
345     that) as you will need to know this later on.
346     </p>
347    
348     <pre caption="Using nohup">
349     # <i>pwd</i>
350     /usr/portage
351     # <i>nohup ./scripts/bootstrap.sh &amp;</i>
352     </pre>
353    
354     <p>
355 rane 1.15 Now exit the chrooted environment (<c>exit</c>) and the Installation CD session. Your
356 swift 1.3 compilation will continue in the background.
357     </p>
358    
359     <p>
360 rane 1.15 When you want to check the compilation, log in as root (on the Installation CD) and
361 swift 1.3 chroot back into your environment and go to the directory where you left off:
362     </p>
363    
364     <pre caption="Chrooting back">
365     # <i>chroot /mnt/gentoo /bin/bash</i>
366     # <i>env-update &amp;&amp; source /etc/profile</i>
367     # <i>cd /usr/portage</i>
368     </pre>
369    
370     <p>
371     Now use the <c>less</c> command on the <path>nohup.out</path> file that is
372     situated inside that directory. The compilation will append its output to that
373     file, so if you want to follow the compilation progress, run <c>less
374     nohup.out</c> and press <c>F</c> to follow the changes. When the compilation is
375     finished, you can continue with the next step of the installation instructions.
376     </p>
377    
378     <p>
379     If you ever get tired of following the changes, press <c>Ctrl-C</c> followed by
380     a <c>q</c>. This won't stop the compilation process, only the <c>less</c>
381     process.
382     </p>
383    
384     </body>
385     </section>
386     </chapter>
387    
388 swift 1.5 <chapter>
389     <title>Fixing Errors/Issues</title>
390     <section id="checking-disks">
391     <title>Extensive Testing of your Disks</title>
392     <body>
393    
394     <p>
395     If you think your disk needs to be thoroughly checked for consistency (bad
396     sectors and such), you can use the <c>-c</c> option while placing the ext2 or
397     ext3 filesystem on it (using <c>mke2fs</c>). This will perform a read-test and
398     will mark all bad blocks as such. If you are really paranoid, use <c>-c -c</c>
399     to perform an extensive read/write test.
400     </p>
401    
402     <pre caption="Checking for disk consistency">
403     # <i>mke2fs -j -c /dev/hda3</i>
404     </pre>
405    
406     </body>
407     </section>
408 swift 1.6 <section id="recover">
409     <title>Recovering from a malfunctioning installation</title>
410     <body>
411    
412     <p>
413     If for some reason your Gentoo installation fails, you don't have to redo the
414     installation all over again. Instead, you can safely "go" to the point where you
415     think you made a mistake (or where you think the instructions are flawed) and
416     try a different approach.
417     </p>
418    
419     <p>
420     First of all you need to chroot back into your Gentoo Linux environment. Follow
421     the instructions again, but ignore the partitioning steps as your partitions are
422     already created and even populated. You can therefore immediately mount those
423     partitions at <path>/mnt/gentoo</path>. You should also ignore the steps about
424     stage extraction and modifying <path>make.conf</path> - you don't want to
425     overwrite your files do you?
426     </p>
427    
428     <p>
429     Once chrooted inside your Gentoo Linux environment, immediately go to the step
430     where you think you should try a different approach. Don't redo all the steps
431     like bootstrapping and such unless that is the place where you think things
432     went wrong.
433     </p>
434    
435     <p>
436     For instance, if you believe that you have a wrongly configured
437     <path>grub.conf</path>, you can immediately fire up your editor to update
438     <path>/boot/grub/grub.conf</path>.
439     </p>
440    
441     <p>
442     Once you have tried a different approach for your situation, you should consider
443     how much of the subsequent steps you need to perform again. If the subsequent
444     steps are depending on your change, you will need to redo those.
445     </p>
446    
447     <p>
448     For instance,
449     </p>
450    
451     <ul>
452     <li>
453     if you have changed a variable inside <path>make.conf</path> you will need
454     to do all subsequent compiling since those depend on the settings inside
455     <path>make.conf</path>
456     </li>
457     <li>
458     if you have altered <path>/boot/grub/grub.conf</path> you can immediately
459     exit the chrooted environment and reboot as no subsequent steps are
460     depending on <path>grub.conf</path>
461     </li>
462     <li>
463     if you have recompiled your kernel you only need to make sure that your
464     bootloader configuration points to the correct kernel image (double-check
465     that you mounted your <path>/boot</path>!), then you can exit the chrooted
466     environment and reboot
467     </li>
468     <li>
469     if you have altered <path>/etc/fstab</path> you can exit the chrooted
470     environment and reboot
471     </li>
472     </ul>
473    
474     <p>
475     As you can see, for most recovery operations you can immediately reboot. Only in
476     certain cases will you need to redo the subsequent installation steps.
477     </p>
478    
479     </body>
480     </section>
481    
482 swift 1.5 </chapter>
483    
484 swift 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20