/[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.5 - (hide annotations) (download) (as text)
Sun Apr 11 15:35:24 2004 UTC (10 years, 3 months ago) by swift
Branch: MAIN
Changes since 1.4: +31 -1 lines
File MIME type: application/xml
#46638 - Adding information on checking the disk for consistency

1 swift 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3    
4     <guide link="/doc/en/gentoo-x86-tipsntricks.xml">
5     <title>Gentoo/x86 Installation Tips &amp; Tricks</title>
6     <author title="Author">
7     <mail link="swift@gentoo.org">Sven Vermeulen</mail>
8     </author>
9    
10     <abstract>
11     The Gentoo installation allows for very flexible approaches to the various
12     installation methods. As it is almost impossible to insert every single tip or
13     trick in the installation instructions this document tries to deal with all
14     submitted tips and tricks for reference purposes.
15     </abstract>
16    
17     <license/>
18    
19 swift 1.5 <version>1.2</version>
20 swift 1.1 <date>April 11, 2004</date>
21    
22     <chapter>
23     <title>Introduction</title>
24     <section>
25     <title>Preliminary</title>
26     <body>
27    
28     <p>
29     This document contains various tips and tricks for the Gentoo/x86 installation.
30     Most of them are discussed in a dense way - they are meant as an addendum to the
31     installation instructions and not as a replacement.
32     </p>
33    
34     </body>
35     </section>
36     <section>
37     <title>Contents</title>
38     <body>
39    
40 swift 1.2 <p>
41     <b>Advanced Installations</b>
42     </p>
43    
44 swift 1.1 <ul>
45     <li><uri link="#software-raid">Software RAID</uri></li>
46 swift 1.4 <li><uri link="#ata-raid-2.4">ATA RAID using 2.4 kernels</uri></li>
47 swift 1.1 </ul>
48    
49 swift 1.3 <p>
50     <b>Simplifying the Installation</b>
51     </p>
52    
53     <ul>
54     <li><uri link="#leave_terminal">Leaving the Terminal</uri></li>
55     </ul>
56    
57 swift 1.5 <p>
58     <b>Fixing Errors/Issues</b>
59     </p>
60    
61     <ul>
62     <li><uri link="#checking-disks">Extensive Testing of your Disks</uri></li>
63     </ul>
64    
65 swift 1.1 </body>
66     </section>
67     </chapter>
68     <chapter>
69     <title>Advanced Installations</title>
70     <section id="software-raid">
71     <title>Software RAID</title>
72     <body>
73    
74     <note>
75     If you are not known to software raid, please read the <uri
76     link="http://tldp.org/HOWTO/Software-RAID-HOWTO.html">Software-RAID-HOWTO</uri>.
77     </note>
78    
79     <p>
80     Once you are booted from the LiveCD, load the appropriate RAID modules. For
81     instance, if you plan on using RAID-1:
82     </p>
83    
84     <pre caption="Loading the RAID-1 module">
85     # <i>modprobe raid1</i>
86     </pre>
87    
88     <p>
89     When you partition your disks, make sure that your partitions use <c>fd</c>
90     (Linux raid autodetect) as Partition Type instead of <c>83</c> (Linux native).
91     You can alter the partition type using the <c>t</c> command in <c>fdisk</c>.
92     </p>
93    
94     <p>
95     After partitioning, create the <path>/etc/raidtab</path> file (yes, indeed, on
96     the LiveCD environment) and insert the necessary commands for your RAID setup.
97     For instance, to have your boot, swap and root partition mirrored (RAID-1)
98     covering <path>/dev/sda</path> and <path>/dev/sdb</path>, you can use:
99     </p>
100    
101     <pre caption="/etc/raidtab for RAID-1 setup">
102     raiddev /dev/md0
103     raid-level 1
104     nr-raid-disks 2
105     chunk-size 32
106     persistent-superblock 1
107     device /dev/sda1
108     raid-disk 0
109     device /dev/sdb1
110     raid-disk 1
111    
112     raiddev /dev/md1
113     raid-level 1
114     nr-raid-disks 2
115     chunk-size 32
116     persistent-superblock 1
117     device /dev/sda2
118     raid-disk 0
119     device /dev/sdb2
120     raid-disk 1
121    
122     raiddev /dev/md2
123     raid-level 1
124     nr-raid-disks 2
125     chunk-size 32
126     persistent-superblock 1
127     device /dev/sda3
128     raid-disk 0
129     device /dev/sdb3
130     raid-disk 1
131     </pre>
132    
133     <p>
134     Now create the necessary RAID devices for each RAID device you listed in
135     <path>/etc/raidtab</path>:
136     </p>
137    
138     <pre caption="Creating RAID devices">
139     # <i>mkraid /dev/md0</i>
140     # <i>mkraid /dev/md1</i>
141     # <i>mkraid /dev/md2</i>
142     </pre>
143    
144     <p>
145     The Linux Software RAID driver will start creating the metadevices. You can see
146     its progress in <path>/proc/mdstat</path>. Wait until the metadevices are
147     completely finished before proceeding.
148     </p>
149    
150     <p>
151     From now onwards, use <path>/dev/md0</path> for the boot partition,
152     <path>/dev/md1</path> for the swap partition and <path>/dev/md2</path> for the
153     root partition.
154     </p>
155    
156     <p>
157     After mounting <path>/dev/md2</path> on <path>/mnt/gentoo</path>, don't forget
158     to copy over <path>/etc/raidtab</path> to <path>/mnt/gentoo/etc</path>.
159     </p>
160    
161     <p>
162     When you're configuring your kernel, make sure you have the appropriate RAID
163     support <e>in</e> your kernel and not as module.
164     </p>
165    
166     <p>
167     When installing extra tools, emerge <c>raidtools</c> as well. Note that this
168     isn't available on all LiveCDs so you might not be able to install Gentoo on a
169     Software RAID when using a networkless installation!
170     </p>
171    
172     <p>
173     When configuring your bootloader, make sure it gets installed in the MBR of
174     <e>both</e> disks if you use mirroring.
175     </p>
176    
177     </body>
178     </section>
179 swift 1.4 <section id="ata-raid-2.4">
180     <title>ATA RAID using 2.4 kernels</title>
181     <body>
182    
183     <p>
184     Make sure you boot your LiveCD using the <c>doataraid</c> option. Once booted,
185     check the contents of <path>/dev/ataraid</path>. It should contain various
186     <path>disc*</path> directories for each harddisk available in the ATA RAID. An
187     entire disk is displayed as <path>disc</path> while partitions are
188     <path>part*</path>.
189     </p>
190    
191     <p>
192     Write down the various <path>/dev/ataraid/disc*/*</path> device files that you
193     use to install Gentoo on. You will need to substitute the <path>/dev/hda</path>
194     examples in the installation with this path.
195     </p>
196    
197     <p>
198     Before chrooting, bind-mount the <path>/dev</path> structure in the new
199     environment:
200     </p>
201    
202     <pre caption="Bind-mounting /dev">
203     # <i>mount -o bind /dev /mnt/gentoo/dev</i>
204     </pre>
205    
206     <p>
207     When configuring your kernel, make sure you enable support for your ATA RAID
208     chipset and options. For instance, a popular ATA RAID system is a <e>Promise
209     FastTrack built-in RAID</e> in which case you definitely need <c>Promise
210     FastTrack Options</c> built in into your kernel.
211     </p>
212    
213     <p>
214     When configuring GRUB, you first have to create a GRUB bootdisk. This is not as
215     hard as you think. First install GRUB as you would, but when you come to the
216     part where GRUB is getting installed in the MBR, follow the following
217     instructions:
218     </p>
219    
220     <pre caption="Creating a GRUB bootdisk">
221     # <i>cd /boot/grub</i>
222     # <i>dd if=stage1 of=/dev/fd0 bs=512 count=1</i>
223     # <i>dd if=stage2 of=/dev/fd0 bs=512 seek=1</i>
224     </pre>
225    
226     <p>
227     You still need to write your <path>grub.conf</path> file. This is no different
228     from the installation instructions, just make sure that your <c>root=</c> points
229     to the ATA RAID device.
230     </p>
231    
232     <p>
233     After finishing the installation, boot with your GRUB bootdisk. You will be
234     greeted by a GRUB prompt. Now configure GRUB to boot from the ATA RAID device:
235     </p>
236    
237     <pre caption="Installing GRUB on the ATA RAID">
238     grub&gt; root (hd0,x)
239     grub&gt; setup (hd0)
240     grub&gt; quit
241     </pre>
242    
243     <p>
244     Now reboot (with the GRUB bootfloppy removed).
245     </p>
246    
247     <p>
248     LILO users can safely use the instructions mentioned in the installation
249     instructions.
250     </p>
251    
252     </body>
253     </section>
254 swift 1.1 </chapter>
255 swift 1.3
256     <chapter>
257     <title>Simplifying the Installation</title>
258     <section id="leave_terminal">
259     <title>Leaving your Terminal</title>
260     <body>
261    
262     <p>
263     Many people want to leave their system when it's compiling. In certain cases
264     this is rather difficult as the installation is done in a public environment
265     where you cannot trust everyone. If this is the case, you want to be able to
266     perform the compilation in the background and log out from all terminals.
267     </p>
268    
269     <p>
270     There are several possible solutions for this. The first one is to use
271     <c>screen</c>. After booting the LiveCD, set your root password and start a
272     screen session:
273     </p>
274    
275     <note>
276     Not all LiveCDs provide screen. If this is the case, you will have to use one of
277     the other methods described in this section.
278     </note>
279    
280     <pre caption="Starting a screen session">
281     # <i>screen -S gentoo</i>
282     </pre>
283    
284     <p>
285     Once inside the screen session you can perform the entire installation. When you
286     want to leave your terminal, press <c>Ctrl-a, d</c> (that is, control and a at
287     the same time, then followed by a d) to <e>detach</e> your screen session. You
288     can now safely log out of your system.
289     </p>
290    
291     <p>
292     To regain access to your terminal, log in as root again and <e>attach</e> to
293     the running screen session:
294     </p>
295    
296     <pre caption="Attaching to a screen session">
297     # <i>screen -x gentoo</i>
298     </pre>
299    
300     <p>
301     If you can't use screen, there is still a way to leave your terminal. Follow the
302     installation instructions, but when you come to the point where a long-term
303     compilation would be started (for instance the <c>./scripts/bootstrap.sh</c>
304     step), use <c>nohup</c> which allows for a process to continue even when you log
305     out. Don't forget the trailing "&amp;", otherwise the process won't be placed in
306     the background! Remember where you are (the <c>pwd</c> command will show you
307     that) as you will need to know this later on.
308     </p>
309    
310     <pre caption="Using nohup">
311     # <i>pwd</i>
312     /usr/portage
313     # <i>nohup ./scripts/bootstrap.sh &amp;</i>
314     </pre>
315    
316     <p>
317     Now exit the chrooted environment (<c>exit</c>) and the LiveCD session. Your
318     compilation will continue in the background.
319     </p>
320    
321     <p>
322     When you want to check the compilation, log in as root (on the LiveCD) and
323     chroot back into your environment and go to the directory where you left off:
324     </p>
325    
326     <pre caption="Chrooting back">
327     # <i>chroot /mnt/gentoo /bin/bash</i>
328     # <i>env-update &amp;&amp; source /etc/profile</i>
329     # <i>cd /usr/portage</i>
330     </pre>
331    
332     <p>
333     Now use the <c>less</c> command on the <path>nohup.out</path> file that is
334     situated inside that directory. The compilation will append its output to that
335     file, so if you want to follow the compilation progress, run <c>less
336     nohup.out</c> and press <c>F</c> to follow the changes. When the compilation is
337     finished, you can continue with the next step of the installation instructions.
338     </p>
339    
340     <p>
341     If you ever get tired of following the changes, press <c>Ctrl-C</c> followed by
342     a <c>q</c>. This won't stop the compilation process, only the <c>less</c>
343     process.
344     </p>
345    
346     </body>
347     </section>
348     </chapter>
349    
350 swift 1.5 <chapter>
351     <title>Fixing Errors/Issues</title>
352     <section id="checking-disks">
353     <title>Extensive Testing of your Disks</title>
354     <body>
355    
356     <p>
357     If you think your disk needs to be thoroughly checked for consistency (bad
358     sectors and such), you can use the <c>-c</c> option while placing the ext2 or
359     ext3 filesystem on it (using <c>mke2fs</c>). This will perform a read-test and
360     will mark all bad blocks as such. If you are really paranoid, use <c>-c -c</c>
361     to perform an extensive read/write test.
362     </p>
363    
364     <pre caption="Checking for disk consistency">
365     # <i>mke2fs -j -c /dev/hda3</i>
366     </pre>
367    
368     </body>
369     </section>
370     </chapter>
371    
372 swift 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20