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

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

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

Revision 1.4 Revision 1.57
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.57 2005/06/20 18:10:46 swift Exp $ -->
3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 4
6<guide link="/doc/en/altinstall.xml"> 5<guide link="/doc/en/altinstall.xml">
6
7<title>The Gentoo Linux alternative installation method HOWTO</title> 7<title>The Gentoo Linux alternative installation method HOWTO</title>
8
9<author title="Contributor">
10 <mail link="gerrynjr@gentoo.org">Gerald Normandin Jr.</mail>
11</author>
12<author title="Contributor">
8<author title="Author"><mail link="lordviram@rebelpacket.net">Travis Tilley</mail></author> 13 <mail link="lordviram@rebelpacket.net">Travis Tilley</mail>
9<author title="Contributor"><mail link="davoid@gentoo.org">Faust A. 14</author>
10Tanasescu</mail></author> 15<author title="Contributor">
11<author title="Contributor"><mail link="aliz@gentoo.org">Daniel Ahlberg</mail></author> 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 Ken Nowack <!-- antifa@gentoo.org seems out -->
38</author>
39<author title="Editor">
40 <mail link="blubber@gentoo.org">Tiemo Kieft</mail>
41</author>
42<author title="Editor">
43 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
44</author>
45<author title="Editor">
46 <mail link="smithj@gentoo.org">Jonathan Smith</mail>
47</author>
48
49
12<abstract> 50<abstract>
13This HOWTO is meant to be a repository of alternative Gentoo installation 51This HOWTO is meant to be a repository of alternative Gentoo installation
14methods, for those with special installation needs such as lack of a cdrom 52methods, for those with special installation needs such as lack of a cdrom
15or a computer that cant boot cds. 53or a computer that can't boot cds.
16</abstract> 54</abstract>
17 55
56<license/>
57
18<version>0.3</version> 58<version>0.63</version>
19<date>10 September 2002</date> 59<date>2005-06-19</date>
20 60
21<chapter> 61<chapter>
22<title>About this document</title> 62<title>About this document</title>
23<section> 63<section>
24<body> 64<body>
25 65
66<p>
26<p>If the standard boot-from-CD install method doesn't work for you 67If the standard boot-from-CD install method doesn't work for you (or you just
27(or you just don't like it), 68don't like it), help is now here. This document serves to provide a repository
28help is now here. This document serves to 69of alternative Gentoo Linux installation techniques to those who need them.
29provide a repository of alternative Gentoo Linux installation techniques 70Or, if you prefer, it serves as a place to put your wacky installation methods.
30to those who need them.
31Or, if you prefer, it serves as
32a place to put your wacky installation methods. If you have an
33installation method that you yourself find useful, or you have devised an 71If you have an installation method that you yourself find useful, or you have
34amusing way of installing gentoo, please dont hesitate to write something 72devised an amusing way of installing Gentoo, please don't hesitate to write
35up and <mail link="lordviram@rebelpacket.net">send it to me.</mail></p> 73something up and post it on <uri link="http://bugs.gentoo.org">Bugzilla</uri>.
36 74</p>
37 75
38</body> 76</body>
39</section> 77</section>
40</chapter> 78</chapter>
41 79
42<chapter> 80<chapter>
43<title>Netboot install</title> 81<title>Booting the LiveCD with Smart BootManager</title>
82<section>
83<body>
84
85<p>
86Download Smart BootManager available from
87<uri>http://btmgr.sourceforge.net/download.html</uri>.
88Linux source or binary format and windows .exe versions are available as well
89as many language packs. However, at this time, the preferred method would be to
90use the binary format, as the source will not compile with newer versions of
91NASM.
92</p>
93
94<p>
95Either compile the package from source or just grab the binary. There are
96several options that can be utilized while creating your boot floppy, as seen
97below.
98</p>
99
100<pre caption="Smart BootManager Options">
101sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file]
102
103 -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
110
111 -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
120 -c disable CD-ROM booting feature;
121
122 -b backup_file backup the data that will be overwritten for
123 future uninstallation;
124
125 -u backup_file uninstall Smart BootManager, should be used alone;
126
127 -y do not ask any question or warning.
128</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<note>
135Replace fd0 with your respective floppy device name if yours is different.
136</note>
137
138<p>
139Now simply place the floppy in the floppy drive of the computer you'd like to
140boot the LiveCD on, as well as placing the LiveCD in the CD-ROM and boot the
141computer.
142</p>
143
144<p>
145You'll be greeted with the Smart BootManager dialog. Select your CD-ROM and
146press ENTER to boot the LiveCD. Once booted proceed with the standard
147installation instructions.
148</p>
149
150<p>
151Further information on Smart BootManager may be found at
152<uri>http://btmgr.sourceforge.net/</uri>
153</p>
154
155</body>
156</section>
157</chapter>
158
159<chapter>
160<title>Knoppix Installation</title>
161<section>
162<body>
163
164<note>
165Knoppix is only available for x86 users.
166</note>
167
168<!-- this works with knoppix 3.6+ and gentoo 2004.3, 2005.0-->
169
170<p>
171Booting from the <uri link="http://www.knoppix.org/">Knoppix</uri> LiveCD is a
172way to have a fully functional system while you're compiling Gentoo. Tux Racer
173will help you pass the time while you wait, and you can use OpenOffice for
174work.
175</p>
176
177<warn>
178Be aware that if you save anything in Knoppix's home directory while waiting
179for your Gentoo system to install, it will not be available when you reboot
180into Gentoo. Be sure to save important files on the hard disk or on some other
181computer!
182</warn>
183
184<p>
185Boot from the Knoppix CD. If you have Knoppix 3.6-3.8.2, you will need to
186specify <c>knoppix26</c> as a boot option to load a 2.6 kernel. If you miss
187this step, when you <c>chroot</c>, you will recieve an error saying that your
188kernel is too old. If, however, you have Knoppix 3.9+, this step is
189unnecessary, since the 2.6 kernel is default.
190</p>
191
192<p>
193By default Knoppix boots into a KDE desktop. Open a konsole and <c>su -</c>
194so you can change your password. This lets you set the root password for
195Knoppix. You can now configure <c>sshd</c> for remote login, at your
196preference.
197</p>
198
199<pre caption="Creating the /mnt/gentoo mountpoint">
200# <i>mkdir /mnt/gentoo</i>
201</pre>
202
203<p>
204At this point, you can pick up with the standard install documentation at <uri
205link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">part 4</uri>.
206However, when you are asked to mount the proc system, issue the following
207command instead:
208</p>
209
210<pre caption="Bind-mounting the proc pseudo filesystem">
211# <i>mount -o bind /proc /mnt/gentoo/proc</i>
212</pre>
213
214<!--
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<p>
221You will also need to bind-mount the device tree to resolve permission issues
222with various device files.
223</p>
224
225< ! - -
226 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- - >
231
232<pre caption="Bind-mounting the device tree">
233# <i>mount -o bind /dev /mnt/gentoo/dev</i>
234</pre>
235-->
236
237</body>
238</section>
239</chapter>
240
241<chapter>
242<title>Installing from Stage 1 without network access</title>
243<section>
244<body>
245
246<p>
247Burn a LiveCD iso.
248</p>
249
250<p>
251Get the latest portage snapshot from
252<uri>http://distro.ibiblio.org/pub/linux/distributions/gentoo/snapshots/</uri>
253(or your favorite <uri
254link="http://www.gentoo.org/main/en/mirrors.xml">mirror</uri>). Either place
255this tarball on an existing partition on the computer your are installing to,
256or burn it to a CD.
257</p>
258
259<p>
260Follow 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<c>docache</c> option while booting so you can unmount the LiveCD and mount
263your portage snapshot CD.
264</p>
265
266<p>
267Open a new console (Alt-F2), we will continue with the Install Doc up to
268running the bootstrap.sh script.
269</p>
270
271<warn>
272Older realeases of the livecd required you to change the password using the
273<c>passwd</c> command, before logging in manually.
274</warn>
275
276<p>
277Go 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
279unpack it to <path>/mnt/gentoo/usr</path>.
280</p>
281
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# <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</pre>
290
291<p>
292Switch back to the F2 console. Now if you try to run bootstrap.sh it will fail
293because it won't be able to download any files. We will fetch these files
294somewhere else and put them in /usr/portage/distfiles (on F2 console).
295</p>
296
297<p>
298You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib,
299binutils, gcc, ncurses plus their dependencies.
300</p>
301
302<note>
303Note that you need the versions of each package synced with your portage tree.
304</note>
305
306<pre caption="Getting the download listing">
307<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# <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<p>
315Take the floppy to the computer that has fast access. If you take a look at the
316<path>stage1.list</path> file, you'll see that it provides you with several
317URLs to download. Sadly, it lists several possible URLs for each package as
318well, which isn't what you want. Strip all but one of the URLs first:
319</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>
328Now use <c>wget</c> to fetch all the listed sources:
329</p>
330
331<pre caption="Use wget to grab your source packages">
332# <i>wget -N -i stage1.download</i>
333</pre>
334
335<p>
336Once you have obtained all the files, take them to the computer and copy them
337to <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
339and 3.
340</p>
341
342</body>
343</section>
344</chapter>
345
346<chapter>
347<title>Diskless install using PXE boot</title>
44<section> 348<section>
45<title>Requirements</title> 349<title>Requirements</title>
46<body> 350<body>
47<p>The requirements for a netboot install are a host computer than can
48provide a tftp server and a computer
49that can netboot itself via either bios or a floppy drive used to boot GRUB
50or another network bootloader. A dhcp server might also be necessary. Of
51course, you will also need the latest build ISO, which can be found at
52<uri>http://www.ibiblio.org/gentoo/releases/build/</uri></p>
53</body>
54</section>
55 351
352<p>
353You will need a network card on the diskless client that uses the PXE protocol
354to boot, like many 3com cards. You will also need a BIOS that supports booting
355from PXE.
356</p>
357
358</body>
56<section> 359</section>
57<title>Overview</title>
58<body>
59
60<p>In order to load images off the network, the first thing a netboot machine
61must do is obtain an IP address. There are multiple ways of obtaining
62an IP address, and any
63one of them will do. Personally, I prefer to use GRUB for everything, but if
64your computer supports booting from a network already then grub might not
65be necessary, even if it might be easier to just use GRUB's <c>ifconfig</c> command
66instead of setting up a bootp or dhcp server.</p>
67
68<p>Once your computer has obtained an IP address, the next logical step is to find
69out what you are going to be booting and where it might be held. Once again,
70it would be easiest to do this with GRUB commands as opposed to setting up
71a bootp or dhcp server. You will also need to specify how to obtain an initrd
72and tell the kernel that it will be using this as it's root filesystem.</p>
73
74<p>With your kernel loaded and root filesystem mounted, you may proceed
75with installation as normal. The build image could be loaded from a cd, or it
76can be downloaded from the network via tftp.</p>
77
78</body>
79</section> 360<section>
80<section> 361<title>Server base setup</title>
81<title>Using GRUB</title>
82<body> 362<body>
83 363
84<p>To use GRUB for network booting purposes, you must first have GRUB 364<p>
85compiled with support for your network card. It doesn't matter if you install 365Create directories: The first thing to do is to create the directories where
86to floppy, or to the hard drive of the computer you wish to install Gentoo 366your diskless system will be stored. Create a directory called
87on. If your install target already has GRUB with network support installed, 367<path>/diskless</path> which houses a directory for each diskless client. For
88then you are one step ahead. GRUB can be downloaded from 368the rest of this howto we'll be working on the client 'eta'.
89<uri>ftp://alpha.gnu.org/gnu/grub/</uri></p>
90
91<p>A configure example for enabling tulip support, the network card in my
92box:</p>
93
94<pre caption="Manual GRUB installation">
95# <i>./configure --enable-tulip --prefix=/usr</i>
96# <i>make &amp;&amp; make install</i>
97</pre> 369</p>
98 370
99<p>If you are currently in Gentoo and wish to install GRUB using Gentoo 371<pre caption="directory setup">
100tools, then you need to install step by step in order to configure in support 372# <i>mkdir /diskless</i>
101for your network card. An example for using ebuild to install GRUB with 373# <i>mkdir /diskless/eta</i>
102tulip support:</p> 374# <i>mkdir /diskless/eta/boot</i>
375</pre>
103 376
104<pre caption="Installing and configuring GRUB on Gentoo Linux"> 377<p>
105# <i>ebuild /usr/portage/sys-apps/grub/grub-0.91.ebuild clean fetch unpack</i> 378DHCP and TFTP setup: The client will get boot informations using DHCP and
106# <i>cd /var/tmp/portage/grub-0.91/work/grub-0.91/</i> 379download all the required files using TFTP. Just emerge DHCP and configure it
107# <i>./configure --prefix=/usr --sbindir=/sbin --mandir=/usr/share/man \ </i> 380for your basic needs. Then, add the following on
108> <i>--infodir=/usr/share/info --enable-tulip</i> 381<path>/etc/dhcp/dhcpd.conf</path>.
382</p>
383
384<note>
385This provide a static IP address for the client and the path of a PXE boot
386image, here pxegrub. You have to replace the MAC address of the Ethernet card
387of the client and the directory where you will put the client files with the
388one you use.
389</note>
390
391<p>
392For DHCPd, run <c>emerge dhcp</c> (or any other DHCP server of your choice).
393Make sure that the correct interface is selected in
394<path>/etc/conf.d/dhcp</path>.
395</p>
396
397<pre caption="dhcp.conf">
398option option-150 code 150 = text ;
399ddns-update-style none ;
400host eta {
401hardware ethernet 00:00:00:00:00:00;
402fixed-address <i>ip.add.re.ss</i>;
403option option-150 "/eta/boot/grub.lst";
404filename "/eta/boot/pxegrub";
405}
406</pre>
407
408<p>
409For TFTP, emerge <c>app-admin/tftp-hpa</c>. In
410<path>/etc/conf.d/in.tftpd</path>, put the following :
411</p>
412
413<pre caption="in.tftpd">
414INTFTPD_PATH="/diskless"
415INTFTPD_USER="nobody"
416INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"
417</pre>
418
419<p>
420Setup GRUB: To provide PXE booting I use GRUB. You have to compile it by
421yourself to enable the PXE image compilation ... but that's quite easy. First,
422get the latest version of the GRUB source code (<c>emerge -f grub</c> will
423place 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
425the binary is built, copy it to the diskless client's boot directory. Then edit
426it's grub.lst config file.
427</p>
428
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<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# <i>./configure --enable-diskless --enable-$nic</i>
109# <i>make</i> 437# <i>make</i>
110# <i>touch /var/tmp/portage/grub-0.91/.compiled</i>
111# <i>cd /usr/portage/</i> 438# <i>cd stage2</i>
112# <i>ebuild sys-apps/grub/grub-0.91.ebuild install merge</i> 439# <i>cp pxegrub /diskless/eta/boot/pxegrub</i>
113</pre> 440# <i>nano -w /diskless/eta/boot/grub.lst</i>
114
115<p>Now that we have the GRUB shell itself installed, we need to install to
116a boot sector. Although you could install GRUB to the boot sector of your
117install computer's hard drive, here we will assume that you are installing
118GRUB on a boot floppy. There are two ways of doing this. You can use the GRUB
119shell itself, or you can use a provided script called <c>grub-install</c>. It is
120preferable to use <c>grub-install</c> when installing GRUB to a floppy.</p>
121
122<pre caption="grub-install example">
123# <i>mkfs.ext2 /dev/fd0</i>
124# <i>mount /dev/fd0 /mnt/floppy/</i>
125# <i>grub-install --root-directory=/mnt/floppy/ '(fd0)'</i>
126# <i>umount /mnt/floppy/</i>
127</pre>
128
129<p><c>grub-install</c> does not always work... and isn't always the best way to install
130GRUB. And since the GRUB shell works exactly like GRUB would when booted
131via the boot sector, it might be more desirable just to use the GRUB shell. Here
132is an example of how to use the GRUB shell to install GRUB to a floppy:</p>
133
134<pre caption="Using the GRUB shell instead">
135# <i>mkfs.ext2 /dev/fd0</i>
136# <i>mount /dev/fd0 /mnt/floppy/</i>
137# <i>mkdir -p /mnt/floppy/boot/grub/</i>
138# <i>cp -v /usr/share/grub/i386-pc/* /mnt/floppy/boot/grub/</i>
139# <i>grub</i>
140grub> <i>root (fd0)</i>
141grub> <i>setup (fd0)</i>
142grub> <i>quit</i>
143# <i>umount /mnt/floppy/</i>
144</pre>
145
146<p>Now that we have a bootable GRUB floppy, we need to set up the host tftp server
147(I suggest netkit's tftp server)
148for loading our kernel and initrd. If you use inetd then you will need
149a line in your <path>/etc/inetd.conf</path> that looks
150like this:</p>
151
152<pre caption="/etc/inetd.conf">
153tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd
154</pre>
155
156<p>To install the netkit tftp server under gentoo linux, emerge net-misc/netkit-tftp</p>
157
158<note>There is an ebuild for xinetd... if you prefer to use this than feel free to do
159so. However I do not use xinetd, and do not know how to set up tftp with it. If you
160use it and such, please send me info on how to get xinetd working and I will include
161them in this howto.</note>
162
163<p>Now that we have our tftp server ready, we need a kernel and a root initrd to
164put in it. You can compile a custom kernel yourself, but make sure it has all the
165things necessary for running gentoo (like devfs) and for netbooting (like initrd
166support). The root initrd will be the rescue.gz included in the gentoo ISO.</p>
167
168<impo>Mounting an ISO file without burning it to cd requires loopback filesystem
169support.</impo>
170
171<pre> 441</pre>
172# <i>mkdir /tftpboot</i>
173# <i>mount -o loop /path/to/gentoo-ix86-1.1a.iso /mnt/cdrom/</i>
174# <i>cp /mnt/cdrom/isolinux/kernel /mnt/cdrom/isolinux/rescue.gz /tftpboot</i>
175# <i>chmod 644 /tftpboot/*</i>
176# <i>umount /mnt/cdrom/</i>
177</pre>
178 442
179<p>Boot the machine you want to install to with your incredibly usefull grub floppy. 443<pre caption="grub.lst">
180Once booted you need to specify a way for the machine to get 444default 0
181its IP address, specify where 445timeout 30
182to get a kernel and it's options, and where to get it's initrd.</p>
183 446
447title=Diskless Gentoo
448root (nd)
449kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=<i>ip.add.re.ss</i>:/diskless/eta
450
451<comment># For the nfsroot option, the IP address is the one of the server and
452the directory is the one where your diskless client files are located (on the server).</comment>
184<pre> 453</pre>
185grub> <i>ifconfig --address=192.168.0.10 --server=192.168.0.2</i> 454
186grub> <i>root (nd)</i> 455<p>
187grub> <i>kernel /tftpboot/kernel devfs=nomount vga=normal load_ramdisk=1 </i> 456Setup NFS: NFS is quite easy to configure. The only thing you have to do is to
188 <i>prompt_ramdisk=0 ramdisk_size=24000 root=/dev/ram0 rw</i> <comment>(all on one line)</comment> 457add a line on the <path>/etc/exports</path> config file :
189grub> <i>initrd /tftpboot/rescue.gz</i>
190grub> <i>boot</i>
191</pre> 458</p>
192 459
193<note>You can also use bootp and dhcp to configure your ip via grub. Use the bootp 460<pre caption="/etc/exports">
194and dhcp commands.</note> 461# <i>nano -w /etc/exports</i>
462# /etc/exports: NFS file systems being exported. See exports(5).
463/diskless/eta eta(rw,sync,no_root_squash)
464</pre>
195 465
196<p>Now that you have your machine booted, you can install as normal. Refer to the 466<p>
197from source cd install howto.</p> 467Update 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
471<pre caption="/etc/hosts">
472127.0.0.1 localhost
473
474192.168.1.10 eta.example.com eta
475192.168.1.20 sigma.example.com sigma
476</pre>
477
478</body>
479</section>
480<section>
481<title>Creating the system on the server</title>
482<body>
483
484<p>
485You might want to reboot the server with a Gentoo LiveCD, although you can
486very well continue immediately if you know how to proceed with the Gentoo
487Installation Instructions from an existing installation. Follow the standard
488install procedure as explained in the Gentoo Install Howto BUT with the
489following differences:
490When you mount the file system, do the following (where hdaX is the partition
491where you created the /diskless directory). You do not need to mount any other
492partitions as all of the files will reside in the <path>/diskless/eta</path>
493directory.
494</p>
495
496<pre caption="mounting the filesystem">
497#<i> mount /dev/hda3 /mnt/gentoo</i>
498</pre>
499
500<p>
501Stage tarballs and chroot: This example uses a stage3 tarball. Mount
502<path>/proc</path> to your diskless directory and chroot into it to continue
503with the install. Then follow the installation manual until kernel
504configuration.
505</p>
506
507<warn>
508Be very careful where you extract your stage tarball. You don't want to end up
509extracting over your existing installation.
510</warn>
511
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<p>
523Kernel configuration: When you do the <c>make menuconfig</c> of your kernel
524configuration, don't forget to enable the following options with the others
525recommended into the install howto.
526</p>
527
528<pre caption="menuconfig options">
529- Your network card device support
530<comment>(In the kernel, *not* as a module!)</comment>
531
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<p>
548Save the kernel in your chrooted <path>/</path> (not in <path>/boot</path>)
549according to the pxegrub setting defined earlier. Next configure your
550diskless client's <path>/etc/fstab</path>.
551</p>
552
553<pre caption="/etc/fstab">
554# <i>nano -w /etc/fstab</i>
555/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
556proc /proc proc defaults 0 0
557tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
558</pre>
559
560<p>
561You 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>
570Install <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>
578Bootloader. Don't install another bootloader because we already have one -
579pxegrub. Simply finish the install and restart the server. Start the services
580you'll need to boot the new client: DHCP, TFTPD, and NFS.
581</p>
582
583<pre caption="Starting services">
584# <i>/etc/init.d/dhcp start</i>
585# <i>/etc/init.d/in.tftpd start</i>
586# <i>/etc/init.d/nfs start</i>
587</pre>
588
589</body>
590</section>
591<section>
592<title>Booting the new client</title>
593<body>
594
595<p>
596For the new client to boot properly, you'll need to configure the bios and the
597network card to use PXE as the first boot method - before CD-ROM or floppy. For
598help with this consult your hardware manuals or manufacturers website. The
599network card should get an IP address using DHCP and download the GRUB PXE
600image using TFTP. Then, you should see a nice black and white GRUB bootmenu
601where you will select the kernel to boot and press Enter. If everything is ok
602the kernel should boot, mount the root filesystem using NFS and provide you
603with a login prompt. Enjoy.
604</p>
198 605
199</body> 606</body>
200</section> 607</section>
201</chapter> 608</chapter>
202 609
203 610<chapter>
204
205
206
207<chapter> <title>Installing Gentoo from an existing Linux distribution </title> 611<title>Installing Gentoo from an existing Linux distribution</title>
612<section>
208<section> <title> Requirements </title> 613<title>Requirements</title>
209<body> 614<body>
615
616<p>
210<p>In order to install Gentoo from your existing Linux distribution you need to 617In order to install Gentoo from your existing Linux distribution you need to
211have chroot command installed, and have a copy of the Gentoo installation 618have chroot command installed, and have a copy of the Gentoo installation
212tarball or ISO you want to install. A network connection would be preferable if 619tarball or ISO you want to install. A network connection would be preferable if
213you want more than what's supplied in your tarball. (by the way, a tarball is 620you want more than what's supplied in your tarball. (by the way, a tarball is
214just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the 621just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the
215"host" operating system, but it is not very important. Let's get started! </p> 622"host" operating system, but it is not very important. Let's get started!
623</p>
624
216</body> 625</body>
626</section>
217</section> 627<section>
218
219<section> <title> Overview </title> 628<title>Overview</title>
220<body>
221<p>We will first allocate a partition to Gentoo by resizing our existing Linux partition, mount the partition, untar the tarball that is mounted, chroot inside the proto-system and start building. Once the bootstrap process is done, we will do some final configuration on the system so as to make sure it boots, then we are ready to reboot and use Gentoo. </p>
222</body> 629<body>
630
631<p>
632We will first allocate a partition to Gentoo by resizing our existing Linux
633partition, mount the partition, untar the tarball that is mounted, chroot
634inside the pseudo-system and start building. Once the bootstrap process is
635done, we will do some final configuration on the system so as to make sure it
636boots, then we are ready to reboot and use Gentoo.
637</p>
638
639</body>
640</section>
223</section> 641<section>
224
225<section> <title> How should we make space for gentoo? </title> 642<title>How should we make space for Gentoo?</title>
226<body> 643<body>
227 644
645<p>
646The root partition is the filesystem mounted under <path>/</path>. A quick run
647of mount on my system shows what I am talking about. We well also use df (disk
648free) to see how much space I have left and how I will be resizing. Note that
649it is not mandatory to resize your root partition! You could be resizing
650anything else supported by our resizer, but let's talk about that later.
228<p> 651</p>
229The root partition is the filesystem mounted under "/". A quick run of mount on my system shows what I am talking about. We well also use df (disk free) to see how much space I have left and how I will be resizing. Note that it is not mandatory to resize your root partition! You could be resizing anything else supported by our resizer, but let's talk about that later.</p>
230
231 652
232<pre caption="Filesystem information"> 653<pre caption="Filesystem information">
233# <i>mount</i> 654# <i>mount</i>
234/dev/hdb2 on / type ext3 (rw) 655/dev/hdb2 on / type ext3 (rw)
235none on /proc type proc (rw) 656none on /proc type proc (rw)
236none on /dev/pts type devpts (rw,gid=5,mode=620) 657none on /dev/pts type devpts (rw,gid=5,mode=620)
237none on /dev/shm type tmpfs (rw) 658none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec)
238# <i>df -h </i> 659# <i>df -h </i>
239Filesystem Size Used Avail Use% Mounted on 660Filesystem Size Used Avail Use% Mounted on
240/dev/hdb2 4.0G 1.9G 2.4G 82% / 661/dev/hdb2 4.0G 1.9G 2.4G 82% /
241none 38M 0 38M 0% /dev/shm 662none 38M 0 38M 0% /dev/shm
663</pre>
664
665<p>
666As 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
668resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes
669for Gentoo. Not bad, I could have quite some stuff installed. However, think
670that even one gigabyte is enough for most users. So let's partition this thing!
242</pre> 671</p>
243 672
244<p>As we can see, the partition mounted as "/" named /dev/hdb2 has 2.4 gigabytes free. In my case, I think I will resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes for Gentoo. Not bad, I could have quite some stuff installed. However, think that even one gigabyte is enough for most users. So let's partition this thing! </p>
245
246</body> </section>
247
248<section> <title> Building parted to resize partition </title>
249<body> 673</body>
250<p>Parted is an utility supplied by the GNU foundation, an old and respectable huge project whose software you are using in this very moment. There is one tool, however, that is extremely useful for us at the moment. It's called parted, partition editor and we can get it from <uri> 674</section>
675<section>
676<title>Building parted to resize partition</title>
677<body>
678
679<p>
680Parted is an utility supplied by the GNU foundation, an old and respectable
681huge project whose software you are using in this very moment. There is one
682tool, however, that is extremely useful for us at the moment. It's called
683parted, partition editor and we can get it from
251http://www.gnu.org/software/parted/ </uri> 684<uri>http://www.gnu.org/software/parted/</uri>
252</p> 685</p>
686
687<note>
253<note> There are other tools for doing resize of partitions as well, but author 688There are other tools for doing resize of partitions as well, but author is
254is unsure/uninterested whether PartitionMagic(tm) or other software of the kind 689unsure/uninterested whether PartitionMagic(tm) or other software of the kind do
255do the job. It's the reader's job to check them out </note> 690the job. It's the reader's job to check them out
691</note>
256 692
257<p> 693<p>
258Look up on that page the type of filesystem you want to resize and see if parted 694Look up on that page the type of filesystem you want to resize and see if
259can do it. If not, you're out of luck, you will have to destroy some partition 695parted can do it. If not, you're out of luck, you will have to destroy some
260to make space for gentoo, and reinstall back. Go ahead by downloading the 696partition to make space for Gentoo, and reinstall back. Go ahead by downloading
261software, install it. Here we have a problem. We want to resize our Linux root 697the software, install it. Here we have a problem. We want to resize our Linux
262partition, therefore we must boot from a floppy disk a minimal linux system and 698root partition, therefore we must boot from a floppy disk a minimal linux
263use previously-compiled parted copied to a diskette in order to resize "/". 699system and use previously-compiled parted copied to a diskette in order to
264However, if you can unmount the partition while still in Linux you are lucky, 700resize <path>/</path>. However, if you can unmount the partition while still
265you don't need to do what follows. Just compile parted and run it on an 701in Linux you are lucky, you don't need to do what follows. Just compile parted
266unmounted partition you chose to resize. Here's how I did it for my system. 702and run it on an unmounted partition you chose to resize. Here's how I did it
703for my system.
267</p> 704</p>
268 705
706<impo>
269<impo> Make sure that the operations you want to do on your partition are 707Make sure that the operations you want to do on your partition are supported by
270supported by parted! </impo> 708parted!
709</impo>
271 710
272<p> Get tomsrtbt boot/root disk (free of charge) from <uri> 711<p>
273http://freshmeat.net/tomsrtbt" </uri>, create a floppy as suggested in the 712Get the mininux boot/root disk (a 2.4-powered mini Linux distribution on a
274Documentation that accompanies the software package and insert a new floppy in 713floppy - free of charge) from <uri>http://mininux.free.fr/uk/</uri>, create a
275the drive for the next step. </p> 714floppy as suggested in the Documentation that accompanies the software package
715and insert a new floppy in the drive for the next step.
716</p>
276 717
718<note>
277<note> Note again that Linux is synonym of "There's one more way to do it". Your 719Note again that Linux is synonym of "There's one more way to do it". Your
278objective is to run parted on an unmounted partition so it can do its work. You 720objective is to run parted on an unmounted partition so it can do its work. You
279might use some other boot/root diskset other than tomsrtbt. You might not even 721might use some other boot/root diskset other than mininux. You might not even
280need to do this step at all, that is only umount the filesystem you want to 722need to do this step at all, that is only umount the filesystem you want to
281repartition in your Linux session and run parted on it. </note> 723repartition in your Linux session and run parted on it.
724</note>
282 725
283<pre caption="Utility disk creation"> 726<pre caption="Utility disk creation">
284# <i>mkfs.minix /dev/fd0</i> 727# <i>mkfs.minix /dev/fd0</i>
285480 inodes 728480 inodes
2861440 blocks 7291440 blocks
287Firstdatazone=19 (19) 730Firstdatazone=19 (19)
288Zonesize=1024 731Zonesize=1024
289Maxsize=268966912 732Maxsize=268966912
290</pre> 733</pre>
291 734
292We will now proceed with the build of parted. If it's not already downloaded and untarred, do so now and cd into the corresponding directory. Now run the following set of commands to build the utility and copy it to your floppy disk. 735<p>
736We will now proceed with the build of parted. If it's not already downloaded
737and untarred, do so now and cd into the corresponding directory. Now run the
738following set of commands to build the utility and copy it to your floppy disk.
739</p>
293 740
294<pre caption="Building the utility floppy"> 741<pre caption="Building the utility floppy">
295# <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp; 742# <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp;
296export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure 743export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure
297&amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i> 744&amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i>
298</pre> 745</pre>
299 746
300<p> 747<p>
301Congratulations, you are ready to reboot and resize your partition. Do this only 748Congratulations, you are ready to reboot and resize your partition. Do this
302after taking a quick look at the parted documentation on the GNU website. The 749only after taking a quick look at the parted documentation on the GNU website.
303resize should take under 30 minutes for the largest hard-drives, be patient. 750The resize should take under 30 minutes for the largest hard-drives, be
304Reboot your system with the tomsrtbt boot disk (just pop it inside), and once 751patient. Reboot your system with the mininux boot disk (just pop it inside),
305you are logged in, switch the disk in the drive with your utility disk we have 752and once you are logged in, switch the disk in the drive with your utility disk
306created above and type mount /dev/fd0 /floppy to have parted under /floppy. 753we have created above and type mount /dev/fd0 /floppy to have parted under
307There you go. Run parted and you will be able to resize your partition. Once 754/floppy. There you go. Run parted and you will be able to resize your
308this lenghty process done, we are ready to have the real fun, by installing 755partition. Once this lenghty process done, we are ready to have the real fun,
309gentoo. Reboot back into your old Linux system for now. Drive youwish to operate 756by installing Gentoo. Reboot back into your old Linux system for now. Drive you
310on is the drive containing the partition we want to resize. For example, if we 757wish to operate on is the drive containing the partition we want to resize. For
311want to resize /dev/hda3, the drive is /dev/hda </p> 758example, if we want to resize /dev/hda3, the drive is /dev/hda
759</p>
312 760
313<pre caption="Commands to run once logged into tomsrtbt system"> 761<pre caption="Commands to run once logged into mininux system">
314# <i>mount /dev/fd0 /floppy </i> 762# <i>mount /dev/fd0 /floppy </i>
315# <i>cd /floppy; ./parted [drive you wish to operate on]</i> 763# <i>cd /floppy; ./parted [drive you wish to operate on]</i>
316(parted) <i> print </i> 764(parted) <i> print </i>
317Disk geometry for /dev/hdb: 0.000-9787.148 megabytes 765Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
318Disk label type: msdos 766Disk label type: msdos
331 onwards. 779 onwards.
332 START and END are in megabytes 780 START and END are in megabytes
333(parted) <i> resize 2 3133.266 4000.000 </i> 781(parted) <i> resize 2 3133.266 4000.000 </i>
334</pre> 782</pre>
335 783
784<impo>
336<impo> Be patient! The computer is working! Just look at the hardware LED on 785Be patient! The computer is working! Just look at the hardware LED on your case
337your case to see that it is really working. This should take between 2 and 30 786to see that it is really working. This should take between 2 and 30 minutes.
338minutes. </impo> 787</impo>
339 788
789<p>
340<p>Once you have resized, boot back into your old linux as described. Then go to 790Once you have resized, boot back into your old linux as described. Then go to
341<uri link="/doc/en/gentoo-x86-install.xml">http://www.gentoo.org/doc/en/gentoo-x86-install.xml</uri> and follow steps 6, 7, 9 through 791<uri link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">The Gentoo
34217. 792Handbook: Preparing the Disks</uri> and follow the instructions. When
793chrooting, use the following command to flush your environment:
794</p>
343 795
796<pre caption="Flushing the environment during chroot">
797# <i>env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash</i>
798# <i>/usr/sbin/env-update</i>
799# <i>source /etc/profile</i>
800</pre>
344 801
802<p>
345Enjoy! 803Enjoy!
346</p> 804</p>
805
347</body> 806</body>
348</section> 807</section>
349</chapter> 808</chapter>
809
350</guide> 810</guide>

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.57

  ViewVC Help
Powered by ViewVC 1.1.20