/[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.58 - (hide annotations) (download) (as text)
Fri Jun 24 02:20:45 2005 UTC (9 years, 5 months ago) by smithj
Branch: MAIN
Changes since 1.57: +11 -11 lines
File MIME type: application/xml
changed livecd to install cd

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

  ViewVC Help
Powered by ViewVC 1.1.20