/[gentoo]/xml/htdocs/doc/en/altinstall.xml
Gentoo

Contents of /xml/htdocs/doc/en/altinstall.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.68 - (hide annotations) (download) (as text)
Fri Nov 17 07:45:55 2006 UTC (8 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.67: +9 -20 lines
File MIME type: application/xml
updated altinstall guide for the grub netboot USE flag, bug 141290

1 zhen 1.3 <?xml version='1.0' encoding="UTF-8"?>
2 nightmorph 1.68 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.67 2006/09/17 09:41:30 neysx Exp $ -->
3 antifa 1.12 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 drobbins 1.1
5 zhen 1.2 <guide link="/doc/en/altinstall.xml">
6 neysx 1.32
7 drobbins 1.1 <title>The Gentoo Linux alternative installation method HOWTO</title>
8 neysx 1.32
9     <author title="Contributor">
10     <mail link="gerrynjr@gentoo.org">Gerald Normandin Jr.</mail>
11     </author>
12     <author title="Contributor">
13     <mail link="lordviram@rebelpacket.net">Travis Tilley</mail>
14     </author>
15     <author title="Contributor">
16     <mail link="volontir@yahoo.com">Oleg Raisky</mail>
17     </author>
18     <author title="Contributor">
19     <mail link="luminousit@hotmail.com">Alex Garbutt</mail>
20     </author>
21     <author title="Contributor">
22     <mail link="alex@openvs.com">Alexandre Georges</mail>
23     </author>
24     <author title="Contributor">
25     <mail link="vargen@b0d.org">Magnus Backanda</mail>
26     </author>
27     <author title="Contributor">
28     <mail link="davoid@gentoo.org">Faust A. Tanasescu</mail>
29     </author>
30     <author title="Contributor">
31     <mail link="aliz@gentoo.org">Daniel Ahlberg</mail>
32     </author>
33     <author title="Editor">
34     <mail link="swift@gentoo.org">Sven Vermeulen</mail>
35     </author>
36     <author title="Reviewer">
37 swift 1.36 Ken Nowack <!-- antifa@gentoo.org seems out -->
38 neysx 1.32 </author>
39     <author title="Editor">
40     <mail link="blubber@gentoo.org">Tiemo Kieft</mail>
41     </author>
42 bennyc 1.37 <author title="Editor">
43     <mail link="bennyc@gentoo.org">Benny Chuang</mail>
44     </author>
45 swift 1.53 <author title="Editor">
46 swift 1.57 <mail link="smithj@gentoo.org">Jonathan Smith</mail>
47 swift 1.53 </author>
48    
49 drobbins 1.1 <abstract>
50     This HOWTO is meant to be a repository of alternative Gentoo installation
51     methods, for those with special installation needs such as lack of a cdrom
52 gerrynjr 1.14 or a computer that can't boot cds.
53 drobbins 1.1 </abstract>
54    
55 rane 1.64 <!-- The content of this document is licensed under the CC-BY-SA license -->
56     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
57 swift 1.21 <license/>
58    
59 nightmorph 1.68 <version>0.70</version>
60     <date>2006-11-16</date>
61 gerrynjr 1.9
62 drobbins 1.1 <chapter>
63     <title>About this document</title>
64     <section>
65     <body>
66    
67 neysx 1.32 <p>
68     If the standard boot-from-CD install method doesn't work for you (or you just
69     don't like it), help is now here. This document serves to provide a repository
70     of alternative Gentoo Linux installation techniques to those who need them.
71     Or, if you prefer, it serves as a place to put your wacky installation methods.
72     If you have an installation method that you yourself find useful, or you have
73     devised an amusing way of installing Gentoo, please don't hesitate to write
74 neysx 1.54 something up and post it on <uri link="http://bugs.gentoo.org">Bugzilla</uri>.
75 neysx 1.32 </p>
76 gerrynjr 1.9
77     </body>
78     </section>
79     </chapter>
80    
81     <chapter>
82 smithj 1.58 <title>Booting the Install CD with Smart BootManager</title>
83 gerrynjr 1.9 <section>
84 neysx 1.32 <body>
85 gerrynjr 1.9
86 neysx 1.32 <p>
87 swift 1.36 Download Smart BootManager available from
88     <uri>http://btmgr.sourceforge.net/download.html</uri>.
89 neysx 1.32 Linux source or binary format and windows .exe versions are available as well
90     as many language packs. However, at this time, the preferred method would be to
91     use the binary format, as the source will not compile with newer versions of
92     NASM.
93     </p>
94 gerrynjr 1.9
95 neysx 1.32 <p>
96     Either compile the package from source or just grab the binary. There are
97     several options that can be utilized while creating your boot floppy, as seen
98     below.
99     </p>
100 gerrynjr 1.9
101     <pre caption="Smart BootManager Options">
102 neysx 1.49 sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file]
103 gerrynjr 1.9
104 neysx 1.49 -t theme select the theme to be used, in which the theme could be:
105     us = English theme de = German theme
106     hu = Hungarian theme zh = Chinese theme
107     ru = Russian theme cz = Czech theme
108     es = Spanish theme fr = French theme
109     pt = Portuguese theme
110 gerrynjr 1.9
111    
112 neysx 1.49 -d drv set the drive that you want to install Smart BootManager on;
113     for Linux:
114     /dev/fd0 is the first floppy driver,
115     /dev/hda is the first IDE harddisk driver.
116     /dev/sda is the first SCSI harddisk driver.
117     for DOS:
118     0 is the first floppy drive
119     128 is the first hard drive;
120 gerrynjr 1.9
121     -c disable CD-ROM booting feature;
122    
123 gerrynjr 1.14 -b backup_file backup the data that will be overwritten for
124 gerrynjr 1.9 future uninstallation;
125    
126     -u backup_file uninstall Smart BootManager, should be used alone;
127    
128 neysx 1.49 -y do not ask any question or warning.
129 gerrynjr 1.9 </pre>
130    
131     <pre caption="Using sbminst to build the boot floppy">
132     # <i>sbminst -t us -d /dev/fd0</i>
133     </pre>
134    
135 neysx 1.32 <note>
136 rane 1.64 Replace <path>fd0</path> with your respective floppy device name if yours is different.
137 neysx 1.32 </note>
138    
139     <p>
140     Now simply place the floppy in the floppy drive of the computer you'd like to
141 smithj 1.58 boot the Install CD on, as well as placing the Install CD in the CD-ROM and boot
142     the computer.
143 neysx 1.32 </p>
144    
145     <p>
146     You'll be greeted with the Smart BootManager dialog. Select your CD-ROM and
147 smithj 1.58 press ENTER to boot the Install CD. Once booted proceed with the standard
148 neysx 1.32 installation instructions.
149     </p>
150    
151     <p>
152     Further information on Smart BootManager may be found at
153     <uri>http://btmgr.sourceforge.net/</uri>
154     </p>
155 gerrynjr 1.9
156     </body>
157     </section>
158     </chapter>
159    
160     <chapter>
161     <title>Knoppix Installation</title>
162     <section>
163     <body>
164    
165 swift 1.51 <note>
166     Knoppix is only available for x86 users.
167     </note>
168    
169 swift 1.57 <!-- this works with knoppix 3.6+ and gentoo 2004.3, 2005.0-->
170 swift 1.53
171 neysx 1.32 <p>
172     Booting from the <uri link="http://www.knoppix.org/">Knoppix</uri> LiveCD is a
173 neysx 1.56 way to have a fully functional system while you're compiling Gentoo. Tux Racer
174     will help you pass the time while you wait, and you can use OpenOffice for
175     work.
176 neysx 1.32 </p>
177 gerrynjr 1.9
178 neysx 1.56 <warn>
179     Be aware that if you save anything in Knoppix's home directory while waiting
180     for your Gentoo system to install, it will not be available when you reboot
181     into Gentoo. Be sure to save important files on the hard disk or on some other
182     computer!
183     </warn>
184    
185 neysx 1.32 <p>
186 neysx 1.56 Boot from the Knoppix CD. If you have Knoppix 3.6-3.8.2, you will need to
187     specify <c>knoppix26</c> as a boot option to load a 2.6 kernel. If you miss
188     this step, when you <c>chroot</c>, you will recieve an error saying that your
189     kernel is too old. If, however, you have Knoppix 3.9+, this step is
190     unnecessary, since the 2.6 kernel is default.
191 neysx 1.32 </p>
192    
193     <p>
194 rane 1.64 By default Knoppix boots into a KDE desktop. Open a <c>konsole</c> and <c>su -</c>
195 swift 1.53 so you can change your password. This lets you set the root password for
196     Knoppix. You can now configure <c>sshd</c> for remote login, at your
197     preference.
198 neysx 1.32 </p>
199 swift 1.16
200 swift 1.22 <pre caption="Creating the /mnt/gentoo mountpoint">
201     # <i>mkdir /mnt/gentoo</i>
202     </pre>
203    
204 neysx 1.32 <p>
205     At this point, you can pick up with the standard install documentation at <uri
206     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">part 4</uri>.
207 swift 1.53 However, when you are asked to mount the proc system, issue the following
208 neysx 1.32 command instead:
209     </p>
210 swift 1.22
211 neysx 1.32 <pre caption="Bind-mounting the proc pseudo filesystem">
212 swift 1.16 # <i>mount -o bind /proc /mnt/gentoo/proc</i>
213     </pre>
214    
215 smithj 1.60 <p>
216 jkt 1.61 Also, know that some of Portage's FEATURES will not work in knoppix. Especially
217 smithj 1.60 watch out for <c>userpriv</c> and <c>usersandbox</c>. If you find yourself
218     getting errors, it might be wise to disable some or all of the optional
219     features.
220     </p>
221    
222 swift 1.50 <!--
223     Commenting out due to #78716. If it needs to be restated again, note
224     that some will require to bind-mount it, others don't, and that you have
225     a 50-50 chance of winning the gold strike.
226    
227    
228 swift 1.45 <p>
229     You will also need to bind-mount the device tree to resolve permission issues
230     with various device files.
231     </p>
232    
233 swift 1.50 < ! - -
234 swift 1.45 If this doesn't seem to work, #71901 mentions the following command:
235     mount -o remount,rw,nosuid /dev/hd* /mnt/hd*
236     before all. Looks weird to me, but if this doesn't work, we might want to try
237     that.
238 swift 1.50 - - >
239 swift 1.45
240     <pre caption="Bind-mounting the device tree">
241     # <i>mount -o bind /dev /mnt/gentoo/dev</i>
242     </pre>
243 swift 1.50 -->
244 swift 1.45
245 gerrynjr 1.9 </body>
246     </section>
247     </chapter>
248    
249     <chapter>
250     <title>Installing from Stage 1 without network access</title>
251     <section>
252     <body>
253    
254 neysx 1.32 <p>
255 jkt 1.61 Burn an Install CD ISO.
256 neysx 1.32 </p>
257 gerrynjr 1.9
258 neysx 1.32 <p>
259 jkt 1.61 Get the latest Portage snapshot from
260 neysx 1.32 <uri>http://distro.ibiblio.org/pub/linux/distributions/gentoo/snapshots/</uri>
261     (or your favorite <uri
262     link="http://www.gentoo.org/main/en/mirrors.xml">mirror</uri>). Either place
263 neysx 1.67 this tarball on an existing partition on the computer you are installing to,
264 neysx 1.32 or burn it to a CD.
265     </p>
266 gerrynjr 1.9
267 neysx 1.32 <p>
268 rane 1.65 Follow all instructions of the <uri link="/doc/en/handbook">Gentoo Installation Handbook</uri> up to <c>chroot
269 neysx 1.32 /mnt/gentoo</c> in Chapter 6. If you only have one CD-ROM remember to use the
270 smithj 1.58 <c>docache</c> option while booting so you can unmount the Install CD and mount
271 jkt 1.61 your Portage snapshot CD.
272 neysx 1.32 </p>
273 gerrynjr 1.9
274 neysx 1.32 <p>
275     Open a new console (Alt-F2), we will continue with the Install Doc up to
276 jkt 1.61 running the <c>bootstrap.sh</c> script.
277 neysx 1.32 </p>
278 gerrynjr 1.9
279 neysx 1.32 <warn>
280 cam 1.59 Older releases of the Install CD required you to change the password using the
281 neysx 1.32 <c>passwd</c> command, before logging in manually.
282 cam 1.47 </warn>
283 gerrynjr 1.9
284 neysx 1.32 <p>
285     Go back to the first console (Alt-F1, without chroot) and mount a second CD on
286 jkt 1.61 <path>/mnt/gentoo/mnt/cdrom2</path>. Copy the Portage tarball from cdrom2 and
287 cam 1.47 unpack it to <path>/mnt/gentoo/usr</path>.
288 neysx 1.32 </p>
289 gerrynjr 1.9
290     <pre caption="Mount the snapshot cd">
291     # <i>umount /mnt/cdrom</i>
292     # <i>mkdir /mnt/gentoo/mnt/cdrom2</i>
293     # <i>mount /dev/cdroms/cdrom0 /mnt/gentoo/mnt/cdrom2</i>
294 cam 1.47 # <i>cp /mnt/gentoo/mnt/cdrom2/portage-$date.tar.bz2 /mnt/gentoo/usr</i>
295     # <i>cd /mnt/gentoo/usr</i>
296     # <i>tar -xvjpf portage-$date.tar.bz2</i>
297 gerrynjr 1.9 </pre>
298    
299 neysx 1.32 <p>
300 jkt 1.61 Switch back to the F2 console. Now if you try to run <c>bootstrap.sh</c> it will
301     fail because it won't be able to download any files. We will fetch these files
302     somewhere else and put them in <path>/usr/portage/distfiles</path> (on F2
303     console).
304 neysx 1.32 </p>
305 gerrynjr 1.9
306 neysx 1.32 <p>
307     You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib,
308     binutils, gcc, ncurses plus their dependencies.
309     </p>
310 gerrynjr 1.9
311 neysx 1.32 <note>
312 jkt 1.61 Note that you need the versions of each package synced with your Portage tree.
313 neysx 1.32 </note>
314 gerrynjr 1.9
315 swift 1.27 <pre caption="Getting the download listing">
316 swift 1.26 <comment>(Don't forget the 2 in front of the &gt;)</comment>
317     # <i>emerge -fp glibc baselayout texinfo gettext zlib binutils gcc ncurses 2&gt; stage1.list</i>
318 gerrynjr 1.9 # <i>mount -t vfat /dev/fd0 /mnt/floppy</i>
319     # <i>cp /mnt/gentoo/stage1.list /mnt/floppy</i>
320     # <i>umount /mnt/floppy</i>
321     </pre>
322    
323 swift 1.26 <p>
324     Take the floppy to the computer that has fast access. If you take a look at the
325 neysx 1.32 <path>stage1.list</path> file, you'll see that it provides you with several
326     URLs to download. Sadly, it lists several possible URLs for each package as
327     well, which isn't what you want. Strip all but one of the URLs first:
328 swift 1.26 </p>
329    
330     <pre caption="Stripping URLs">
331     <comment>(This script is depending on the output format given by emerge which
332     might change in the future without further notice - use with caution!)</comment>
333     # <i>cut -f 1 -d ' ' stage1.list > stage1.download</i>
334     </pre>
335    
336     <p>
337     Now use <c>wget</c> to fetch all the listed sources:
338     </p>
339 gerrynjr 1.9
340     <pre caption="Use wget to grab your source packages">
341 neysx 1.33 # <i>wget -N -i stage1.download</i>
342 gerrynjr 1.9 </pre>
343    
344 neysx 1.32 <p>
345     Once you have obtained all the files, take them to the computer and copy them
346     to <path>/mnt/gentoo/usr/portage/distfiles</path>. You will then be able to run
347     <c>bootstrap.sh</c>. Repeat this same wget fetch and place procedure for stage2
348     and 3.
349     </p>
350 gerrynjr 1.9
351 neysx 1.32 </body>
352     </section>
353     </chapter>
354 gerrynjr 1.9
355 neysx 1.32 <chapter>
356     <title>Diskless install using PXE boot</title>
357     <section>
358     <title>Requirements</title>
359     <body>
360 drobbins 1.1
361 neysx 1.32 <p>
362     You will need a network card on the diskless client that uses the PXE protocol
363     to boot, like many 3com cards. You will also need a BIOS that supports booting
364     from PXE.
365     </p>
366 drobbins 1.1
367     </body>
368     </section>
369 neysx 1.32 <section>
370     <title>Server base setup</title>
371 gerrynjr 1.9 <body>
372    
373 neysx 1.32 <p>
374     Create directories: The first thing to do is to create the directories where
375     your diskless system will be stored. Create a directory called
376     <path>/diskless</path> which houses a directory for each diskless client. For
377     the rest of this howto we'll be working on the client 'eta'.
378     </p>
379 gerrynjr 1.9
380 rane 1.62 <pre caption="Directory setup">
381 gerrynjr 1.9 # <i>mkdir /diskless</i>
382     # <i>mkdir /diskless/eta</i>
383     # <i>mkdir /diskless/eta/boot</i>
384     </pre>
385    
386 neysx 1.32 <p>
387     DHCP and TFTP setup: The client will get boot informations using DHCP and
388     download all the required files using TFTP. Just emerge DHCP and configure it
389     for your basic needs. Then, add the following on
390     <path>/etc/dhcp/dhcpd.conf</path>.
391     </p>
392 gerrynjr 1.9
393 neysx 1.32 <note>
394     This provide a static IP address for the client and the path of a PXE boot
395 rane 1.64 image, here <path>pxegrub</path>. You have to replace the MAC address of the Ethernet card
396 neysx 1.32 of the client and the directory where you will put the client files with the
397     one you use.
398     </note>
399 gerrynjr 1.9
400 swift 1.46 <p>
401     For DHCPd, run <c>emerge dhcp</c> (or any other DHCP server of your choice).
402     Make sure that the correct interface is selected in
403     <path>/etc/conf.d/dhcp</path>.
404     </p>
405    
406 gerrynjr 1.9 <pre caption="dhcp.conf">
407     option option-150 code 150 = text ;
408 swift 1.46 ddns-update-style none ;
409 gerrynjr 1.9 host eta {
410     hardware ethernet 00:00:00:00:00:00;
411 cam 1.24 fixed-address <i>ip.add.re.ss</i>;
412 gerrynjr 1.9 option option-150 "/eta/boot/grub.lst";
413     filename "/eta/boot/pxegrub";
414     }
415     </pre>
416    
417 neysx 1.32 <p>
418     For TFTP, emerge <c>app-admin/tftp-hpa</c>. In
419     <path>/etc/conf.d/in.tftpd</path>, put the following :
420     </p>
421 gerrynjr 1.9
422     <pre caption="in.tftpd">
423     INTFTPD_PATH="/diskless"
424     INTFTPD_USER="nobody"
425     INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"
426     </pre>
427    
428 neysx 1.32 <p>
429 nightmorph 1.68 Setup GRUB: To provide PXE booting I use GRUB with the <c>netboot</c> USE flag
430     enabled. Once GRUB is compiled, copy the PXE image to the diskless client's
431     boot directory. Then edit its <path>grub.lst</path> config file.
432 neysx 1.32 </p>
433 gerrynjr 1.9
434 rane 1.62 <pre caption="Grub setup">
435 nightmorph 1.68 # <i>echo "sys-boot/grub netboot" &gt;&gt; /etc/portage/package.use"</i>
436     # <i>emerge -av grub</i>
437     # <i>cp /usr/lib/grub/pxegrub /diskless/eta/boot/pxegrub</i>
438 gerrynjr 1.9 # <i>nano -w /diskless/eta/boot/grub.lst</i>
439     </pre>
440    
441     <pre caption="grub.lst">
442     default 0
443     timeout 30
444    
445     title=Diskless Gentoo
446     root (nd)
447 cam 1.24 kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=<i>ip.add.re.ss</i>:/diskless/eta
448 drobbins 1.1
449 swift 1.53 <comment># For the nfsroot option, the IP address is the one of the server and
450     the directory is the one where your diskless client files are located (on the server).</comment>
451 gerrynjr 1.9 </pre>
452    
453 neysx 1.32 <p>
454     Setup NFS: NFS is quite easy to configure. The only thing you have to do is to
455 neysx 1.67 add a line on the <path>/etc/exports</path> config file:
456 neysx 1.32 </p>
457 gerrynjr 1.9
458     <pre caption="/etc/exports">
459     # <i>nano -w /etc/exports</i>
460 neysx 1.32 # /etc/exports: NFS file systems being exported. See exports(5).
461 gerrynjr 1.9 /diskless/eta eta(rw,sync,no_root_squash)
462     </pre>
463    
464 neysx 1.32 <p>
465 neysx 1.67 Update your hosts: One important thing to do now is to modify your
466 neysx 1.32 <path>/etc/hosts</path> file to fit your needs.
467     </p>
468 gerrynjr 1.9
469     <pre caption="/etc/hosts">
470     127.0.0.1 localhost
471    
472     192.168.1.10 eta.example.com eta
473     192.168.1.20 sigma.example.com sigma
474     </pre>
475 neysx 1.32
476 gerrynjr 1.9 </body>
477     </section>
478 neysx 1.32 <section>
479     <title>Creating the system on the server</title>
480 gerrynjr 1.9 <body>
481    
482 neysx 1.32 <p>
483 smithj 1.58 You might want to reboot the server with a Gentoo Install CD, although you can
484 swift 1.34 very well continue immediately if you know how to proceed with the Gentoo
485     Installation Instructions from an existing installation. Follow the standard
486 rane 1.65 install procedure as explained in the <uri link="/doc/en/handbook/">Gentoo Handbook</uri> BUT with the
487 swift 1.34 following differences:
488 rane 1.64 When you mount the file system, do the following (where <path>hdaX</path> is the partition
489     where you created the <path>/diskless</path> directory). You do not need to mount any other
490 neysx 1.32 partitions as all of the files will reside in the <path>/diskless/eta</path>
491     directory.
492     </p>
493 gerrynjr 1.9
494 rane 1.62 <pre caption="Mounting the filesystem">
495 rane 1.66 #<i> mount /dev/hdaX /mnt/gentoo</i>
496 gerrynjr 1.9 </pre>
497    
498 neysx 1.32 <p>
499     Stage tarballs and chroot: This example uses a stage3 tarball. Mount
500     <path>/proc</path> to your diskless directory and chroot into it to continue
501     with the install. Then follow the installation manual until kernel
502     configuration.
503     </p>
504 gerrynjr 1.9
505 neysx 1.32 <warn>
506     Be very careful where you extract your stage tarball. You don't want to end up
507     extracting over your existing installation.
508     </warn>
509 gerrynjr 1.9
510 rane 1.62 <pre caption="Extracting the stage tarball">
511 gerrynjr 1.9 # <i>cd /mnt/gentoo/diskless/eta/</i>
512     # <i>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2</i>
513     # <i>mount -t proc /proc /mnt/gentoo/diskless/eta/proc</i>
514     # <i>cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf</i>
515     # <i>chroot /mnt/gentoo/diskless/eta/ /bin/bash</i>
516     # <i>env-update</i>
517     # <i>source /etc/profile</i>
518     </pre>
519    
520 neysx 1.32 <p>
521     Kernel configuration: When you do the <c>make menuconfig</c> of your kernel
522     configuration, don't forget to enable the following options with the others
523     recommended into the install howto.
524     </p>
525 gerrynjr 1.9
526     <pre caption="menuconfig options">
527     - Your network card device support
528 swift 1.34 <comment>(In the kernel, *not* as a module!)</comment>
529 gerrynjr 1.9
530     - Under "Networking options" :
531    
532     [*] TCP/IP networking
533     [*] IP: kernel level autoconfiguration
534     [*] IP: DHCP support
535     [*] IP: BOOTP support
536    
537    
538     - Under "File systems --> Network File Systems" :
539    
540     &lt;*&gt; NFS file system support
541     [*] Provide NFSv3 client support
542     [*] Root file system on NFS
543     </pre>
544    
545 neysx 1.32 <p>
546 swift 1.43 Save the kernel in your chrooted <path>/</path> (not in <path>/boot</path>)
547     according to the pxegrub setting defined earlier. Next configure your
548     diskless client's <path>/etc/fstab</path>.
549 neysx 1.32 </p>
550 gerrynjr 1.9
551     <pre caption="/etc/fstab">
552     # <i>nano -w /etc/fstab</i>
553     /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
554     proc /proc proc defaults 0 0
555 vapier 1.41 tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
556 gerrynjr 1.9 </pre>
557    
558 neysx 1.32 <p>
559 swift 1.35 You also need to prevent the client to run a filesystem check:
560     </p>
561    
562     <pre caption="Preventing the client to run a filesystem check">
563     # <i>touch /fastboot</i>
564     # <i>echo "touch /fastboot" &gt;&gt; /etc/conf.d/local.start</i>
565     </pre>
566    
567     <p>
568 swift 1.43 Install <c>nfs-utils</c> since your client will heavily depend on it:
569     </p>
570    
571     <pre caption="Installing nfs-utils">
572     # <i>emerge nfs-utils</i>
573     </pre>
574    
575     <p>
576 neysx 1.32 Bootloader. Don't install another bootloader because we already have one -
577     pxegrub. Simply finish the install and restart the server. Start the services
578     you'll need to boot the new client: DHCP, TFTPD, and NFS.
579     </p>
580 gerrynjr 1.9
581     <pre caption="Starting services">
582     # <i>/etc/init.d/dhcp start</i>
583 swift 1.43 # <i>/etc/init.d/in.tftpd start</i>
584 gerrynjr 1.9 # <i>/etc/init.d/nfs start</i>
585     </pre>
586    
587 neysx 1.32 </body>
588     </section>
589     <section>
590     <title>Booting the new client</title>
591     <body>
592 gerrynjr 1.9
593 neysx 1.32 <p>
594     For the new client to boot properly, you'll need to configure the bios and the
595     network card to use PXE as the first boot method - before CD-ROM or floppy. For
596     help with this consult your hardware manuals or manufacturers website. The
597     network card should get an IP address using DHCP and download the GRUB PXE
598     image using TFTP. Then, you should see a nice black and white GRUB bootmenu
599     where you will select the kernel to boot and press Enter. If everything is ok
600     the kernel should boot, mount the root filesystem using NFS and provide you
601     with a login prompt. Enjoy.
602     </p>
603 gerrynjr 1.9
604 neysx 1.32 </body>
605     </section>
606 gerrynjr 1.9 </chapter>
607 drobbins 1.1
608 neysx 1.32 <chapter>
609     <title>Installing Gentoo from an existing Linux distribution</title>
610     <section>
611     <title>Requirements</title>
612     <body>
613 drobbins 1.1
614 neysx 1.32 <p>
615     In order to install Gentoo from your existing Linux distribution you need to
616 drobbins 1.1 have chroot command installed, and have a copy of the Gentoo installation
617     tarball or ISO you want to install. A network connection would be preferable if
618     you want more than what's supplied in your tarball. (by the way, a tarball is
619     just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the
620 neysx 1.32 "host" operating system, but it is not very important. Let's get started!
621     </p>
622    
623 drobbins 1.1 </body>
624     </section>
625 neysx 1.32 <section>
626     <title>Overview</title>
627     <body>
628    
629     <p>
630     We will first allocate a partition to Gentoo by resizing our existing Linux
631 rane 1.63 partition, mount the partition, untar the tarball to the partition that is mounted, chroot
632 neysx 1.54 inside the pseudo-system and start building. Once the bootstrap process is
633 neysx 1.32 done, we will do some final configuration on the system so as to make sure it
634     boots, then we are ready to reboot and use Gentoo.
635     </p>
636 drobbins 1.1
637     </body>
638     </section>
639 neysx 1.32 <section>
640     <title>How should we make space for Gentoo?</title>
641 drobbins 1.1 <body>
642    
643     <p>
644 neysx 1.32 The root partition is the filesystem mounted under <path>/</path>. A quick run
645 rane 1.64 of <c>mount</c> on my system shows what I am talking about. We well also use <c>df</c> (disk
646 neysx 1.32 free) to see how much space I have left and how I will be resizing. Note that
647     it is not mandatory to resize your root partition! You could be resizing
648     anything else supported by our resizer, but let's talk about that later.
649     </p>
650 drobbins 1.1
651     <pre caption="Filesystem information">
652     # <i>mount</i>
653 vapier 1.41 /dev/hdb2 on / type ext3 (rw)
654     none on /proc type proc (rw)
655     none on /dev/pts type devpts (rw,gid=5,mode=620)
656     none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec)
657 drobbins 1.1 # <i>df -h </i>
658     Filesystem Size Used Avail Use% Mounted on
659     /dev/hdb2 4.0G 1.9G 2.4G 82% /
660 neysx 1.49 none 38M 0 38M 0% /dev/shm
661 drobbins 1.1 </pre>
662    
663 neysx 1.32 <p>
664     As we can see, the partition mounted as <path>/</path> named
665     <path>/dev/hdb2</path> has 2.4 gigabytes free. In my case, I think I will
666     resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes
667 neysx 1.67 for Gentoo. Not bad, I could have quite some stuff installed. However, I think
668 neysx 1.32 that even one gigabyte is enough for most users. So let's partition this thing!
669     </p>
670 drobbins 1.1
671 swift 1.21 </body>
672     </section>
673     <section>
674     <title>Building parted to resize partition</title>
675 drobbins 1.1 <body>
676 swift 1.21
677     <p>
678 neysx 1.32 Parted is an utility supplied by the GNU foundation, an old and respectable
679     huge project whose software you are using in this very moment. There is one
680     tool, however, that is extremely useful for us at the moment. It's called
681     parted, partition editor and we can get it from
682     <uri>http://www.gnu.org/software/parted/</uri>
683 drobbins 1.1 </p>
684 swift 1.21
685     <note>
686 neysx 1.67 There are other tools for doing resize of partitions as well, but the author is
687 neysx 1.32 unsure/uninterested whether PartitionMagic(tm) or other software of the kind do
688     the job. It's the reader's job to check them out
689 swift 1.21 </note>
690 drobbins 1.1
691     <p>
692 neysx 1.32 Look up on that page the type of filesystem you want to resize and see if
693     parted can do it. If not, you're out of luck, you will have to destroy some
694     partition to make space for Gentoo, and reinstall back. Go ahead by downloading
695     the software, install it. Here we have a problem. We want to resize our Linux
696     root partition, therefore we must boot from a floppy disk a minimal linux
697     system and use previously-compiled parted copied to a diskette in order to
698     resize <path>/</path>. However, if you can unmount the partition while still
699     in Linux you are lucky, you don't need to do what follows. Just compile parted
700     and run it on an unmounted partition you chose to resize. Here's how I did it
701     for my system.
702 drobbins 1.1 </p>
703    
704 swift 1.21 <impo>
705 neysx 1.32 Make sure that the operations you want to do on your partition are supported by
706     parted!
707 swift 1.21 </impo>
708 drobbins 1.1
709 swift 1.21 <p>
710 neysx 1.49 Get the mininux boot/root disk (a 2.4-powered mini Linux distribution on a
711     floppy - free of charge) from <uri>http://mininux.free.fr/uk/</uri>, create a
712     floppy as suggested in the Documentation that accompanies the software package
713     and insert a new floppy in the drive for the next step.
714 swift 1.21 </p>
715 drobbins 1.1
716 swift 1.21 <note>
717     Note again that Linux is synonym of "There's one more way to do it". Your
718 drobbins 1.1 objective is to run parted on an unmounted partition so it can do its work. You
719 neysx 1.67 might use some boot/root diskset other than mininux. You might not even
720     need to do this step at all, ie. you might only have umount the filesystem you want to
721 swift 1.21 repartition in your Linux session and run parted on it.
722     </note>
723 drobbins 1.1
724     <pre caption="Utility disk creation">
725     # <i>mkfs.minix /dev/fd0</i>
726     480 inodes
727     1440 blocks
728     Firstdatazone=19 (19)
729     Zonesize=1024
730     Maxsize=268966912
731     </pre>
732    
733 swift 1.21 <p>
734 neysx 1.32 We will now proceed with the build of parted. If it's not already downloaded
735 rane 1.64 and untarred, do so now and <c>cd</c> into the corresponding directory. Now run the
736 neysx 1.32 following set of commands to build the utility and copy it to your floppy disk.
737 swift 1.21 </p>
738 drobbins 1.1
739     <pre caption="Building the utility floppy">
740     # <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp;
741     export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure
742     &amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i>
743     </pre>
744    
745     <p>
746 neysx 1.32 Congratulations, you are ready to reboot and resize your partition. Do this
747     only after taking a quick look at the parted documentation on the GNU website.
748     The resize should take under 30 minutes for the largest hard-drives, be
749 swift 1.48 patient. Reboot your system with the mininux boot disk (just pop it inside),
750 neysx 1.32 and once you are logged in, switch the disk in the drive with your utility disk
751 rane 1.64 we have created above and type <c>mount /dev/fd0 /floppy</c> to have parted under
752     <path>/floppy</path>. There you go. Run parted and you will be able to resize your
753 neysx 1.32 partition. Once this lenghty process done, we are ready to have the real fun,
754 neysx 1.67 by installing Gentoo. Reboot back into your old Linux system for now. The drive you
755 neysx 1.32 wish to operate on is the drive containing the partition we want to resize. For
756 swift 1.8 example, if we want to resize /dev/hda3, the drive is /dev/hda
757     </p>
758 drobbins 1.1
759 swift 1.48 <pre caption="Commands to run once logged into mininux system">
760 drobbins 1.1 # <i>mount /dev/fd0 /floppy </i>
761     # <i>cd /floppy; ./parted [drive you wish to operate on]</i>
762     (parted) <i> print </i>
763     Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
764     Disk label type: msdos
765     Minor Start End Type Filesystem Flags
766     1 0.031 2953.125 primary ntfs
767     3 2953.125 3133.265 primary linux-swap
768     2 3133.266 5633.085 primary ext3
769     4 5633.086 9787.148 extended
770     5 5633.117 6633.210 logical
771     6 6633.242 9787.148 logical ext3
772     (parted) <i> help resize </i>
773     resize MINOR START END resize filesystem on partition MINOR
774    
775     MINOR is the partition number used by Linux. On msdos disk labels, the
776     primary partitions number from 1-4, and logical partitions are 5
777     onwards.
778     START and END are in megabytes
779     (parted) <i> resize 2 3133.266 4000.000 </i>
780     </pre>
781    
782 neysx 1.32 <impo>
783 neysx 1.67 Be patient! The computer is working! Just look at the harddrive LED on your case
784 neysx 1.32 to see that it is really working. This should take between 2 and 30 minutes.
785     </impo>
786 drobbins 1.1
787 neysx 1.32 <p>
788     Once you have resized, boot back into your old linux as described. Then go to
789     <uri link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">The Gentoo
790     Handbook: Preparing the Disks</uri> and follow the instructions. When
791     chrooting, use the following command to flush your environment:
792 swift 1.17 </p>
793 drobbins 1.1
794 neysx 1.32 <pre caption="Flushing the environment during chroot">
795 swift 1.39 # <i>env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash</i>
796 swift 1.42 # <i>/usr/sbin/env-update</i>
797 swift 1.40 # <i>source /etc/profile</i>
798 swift 1.17 </pre>
799 drobbins 1.1
800 swift 1.17 <p>
801 drobbins 1.1 Enjoy!
802     </p>
803 neysx 1.32
804 drobbins 1.1 </body>
805     </section>
806     </chapter>
807     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20