/[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.76
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.76 2008/09/10 23:04:29 nightmorph 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<author title="Editor">
49 <mail link="nightmorph"/>
50</author>
51
12<abstract> 52<abstract>
13This HOWTO is meant to be a repository of alternative Gentoo installation 53This HOWTO is meant to be a repository of alternative Gentoo installation
14methods, for those with special installation needs such as lack of a cdrom 54methods, for those with special installation needs such as lack of a cdrom
15or a computer that cant boot cds. 55or a computer that can't boot cds.
16</abstract> 56</abstract>
17 57
58<!-- The content of this document is licensed under the CC-BY-SA license -->
59<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
60<license/>
61
18<version>0.3</version> 62<version>1</version>
19<date>10 September 2002</date> 63<date>2008-09-10</date>
20 64
21<chapter> 65<chapter>
22<title>About this document</title> 66<title>About this document</title>
23<section> 67<section>
24<body> 68<body>
25 69
70<p>
26<p>If the standard boot-from-CD install method doesn't work for you 71If the standard boot-from-CD install method doesn't work for you (or you just
27(or you just don't like it), 72don't like it), help is now here. This document serves to provide a repository
28help is now here. This document serves to 73of alternative Gentoo Linux installation techniques to those who need them.
29provide a repository of alternative Gentoo Linux installation techniques 74Or, 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 75If you have an installation method that you yourself find useful, or you have
34amusing way of installing gentoo, please dont hesitate to write something 76devised 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> 77something up and post it on <uri link="http://bugs.gentoo.org">Bugzilla</uri>.
36 78</p>
37 79
38</body> 80</body>
39</section> 81</section>
40</chapter> 82</chapter>
41 83
42<chapter> 84<chapter>
43<title>Netboot install</title> 85<title>Booting the Install CD with Smart BootManager</title>
86<section>
87<body>
88
89<p>
90Download Smart BootManager available from
91<uri>http://btmgr.sourceforge.net/download.html</uri>.
92Linux source or binary format and windows .exe versions are available as well
93as many language packs. However, at this time, the preferred method would be to
94use the binary format, as the source will not compile with newer versions of
95NASM.
96</p>
97
98<p>
99Either compile the package from source or just grab the binary. There are
100several options that can be utilized while creating your boot floppy, as seen
101below.
102</p>
103
104<pre caption="Smart BootManager Options">
105sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file]
106
107 -t theme select the theme to be used, in which the theme could be:
108 us = English theme de = German theme
109 hu = Hungarian theme zh = Chinese theme
110 ru = Russian theme cz = Czech theme
111 es = Spanish theme fr = French theme
112 pt = Portuguese theme
113
114
115 -d drv set the drive that you want to install Smart BootManager on;
116 for Linux:
117 /dev/fd0 is the first floppy driver,
118 /dev/hda is the first IDE harddisk driver.
119 /dev/sda is the first SCSI harddisk driver.
120 for DOS:
121 0 is the first floppy drive
122 128 is the first hard drive;
123
124 -c disable CD-ROM booting feature;
125
126 -b backup_file backup the data that will be overwritten for
127 future uninstallation;
128
129 -u backup_file uninstall Smart BootManager, should be used alone;
130
131 -y do not ask any question or warning.
132</pre>
133
134<pre caption="Using sbminst to build the boot floppy">
135# <i>sbminst -t us -d /dev/fd0</i>
136</pre>
137
138<note>
139Replace <path>fd0</path> with your respective floppy device name if yours is
140different.
141</note>
142
143<p>
144Now simply place the floppy in the floppy drive of the computer you'd like to
145boot the Install CD on, as well as placing the Install CD in the CD-ROM and boot
146the computer.
147</p>
148
149<p>
150You'll be greeted with the Smart BootManager dialog. Select your CD-ROM and
151press ENTER to boot the Install CD. Once booted proceed with the standard
152installation instructions.
153</p>
154
155<p>
156Further information on Smart BootManager may be found at
157<uri>http://btmgr.sourceforge.net/</uri>
158</p>
159
160</body>
161</section>
162</chapter>
163
164<chapter>
165<title>Knoppix Installation</title>
166<section>
167<body>
168
169<note>
170Knoppix is only available for x86 users.
171</note>
172
173<!-- this works with knoppix 3.6+ and gentoo 2004.3, 2005.0-->
174
175<p>
176Booting from the <uri link="http://www.knoppix.org/">Knoppix</uri> LiveCD is a
177way to have a fully functional system while you're compiling Gentoo. Tux Racer
178will help you pass the time while you wait, and you can use OpenOffice for
179work.
180</p>
181
182<warn>
183Be aware that if you save anything in Knoppix's home directory while waiting
184for your Gentoo system to install, it will not be available when you reboot
185into Gentoo. Be sure to save important files on the hard disk or on some other
186computer!
187</warn>
188
189<p>
190Boot from the Knoppix CD. If you have Knoppix 3.6-3.8.2, you will need to
191specify <c>knoppix26</c> as a boot option to load a 2.6 kernel. If you miss
192this step, when you <c>chroot</c>, you will recieve an error saying that your
193kernel is too old. If, however, you have Knoppix 3.9+, this step is
194unnecessary, since the 2.6 kernel is default.
195</p>
196
197<p>
198By default Knoppix boots into a KDE desktop. Open a <c>konsole</c> and <c>su
199-</c> so you can change your password. This lets you set the root password for
200Knoppix. You can now configure <c>sshd</c> for remote login, at your
201preference.
202</p>
203
204<pre caption="Creating the /mnt/gentoo mountpoint">
205# <i>mkdir /mnt/gentoo</i>
206</pre>
207
208<p>
209At this point, you can pick up with the standard install documentation at <uri
210link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">part 4</uri>.
211However, when you are asked to mount the proc system, issue the following
212command instead:
213</p>
214
215<pre caption="Bind-mounting the proc pseudo filesystem">
216# <i>mount -o bind /proc /mnt/gentoo/proc</i>
217</pre>
218
219<p>
220Also, know that some of Portage's FEATURES will not work in knoppix. Especially
221watch out for <c>userpriv</c> and <c>usersandbox</c>. If you find yourself
222getting errors, it might be wise to disable some or all of the optional
223features.
224</p>
225
226<!--
227 Commenting out due to #78716. If it needs to be restated again, note
228 that some will require to bind-mount it, others don't, and that you have
229 a 50-50 chance of winning the gold strike.
230
231
232<p>
233You will also need to bind-mount the device tree to resolve permission issues
234with various device files.
235</p>
236
237< ! - -
238 If this doesn't seem to work, #71901 mentions the following command:
239 mount -o remount,rw,nosuid /dev/hd* /mnt/hd*
240 before all. Looks weird to me, but if this doesn't work, we might want to try
241 that.
242- - >
243
244<pre caption="Bind-mounting the device tree">
245# <i>mount -o bind /dev /mnt/gentoo/dev</i>
246</pre>
247-->
248
249</body>
250</section>
251</chapter>
252
253<chapter>
254<title>Diskless install using PXE boot</title>
44<section> 255<section>
45<title>Requirements</title> 256<title>Requirements</title>
46<body> 257<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 258
259<p>
260You will need a network card on the diskless client that uses the PXE protocol
261to boot, like many 3com cards. You will also need a BIOS that supports booting
262from PXE.
263</p>
264
265</body>
56<section> 266</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> 267<section>
268<title>Server base setup</title>
269<body>
270
271<p>
272Create directories: The first thing to do is to create the directories where
273your diskless system will be stored. Create a directory called
274<path>/diskless</path> which houses a directory for each diskless client. For
275the rest of this howto we'll be working on the client 'eta'.
276</p>
277
278<pre caption="Directory setup">
279# <i>mkdir /diskless</i>
280# <i>mkdir /diskless/eta</i>
281# <i>mkdir /diskless/eta/boot</i>
282</pre>
283
284<p>
285DHCP and TFTP setup: The client will get boot informations using DHCP and
286download all the required files using TFTP.
287</p>
288
289<p>
290For dhcpd, just run <c>emerge dhcp</c> (or any other DHCP server of your
291choice). Make sure that the correct interface is selected in
292<path>/etc/conf.d/dhcpd</path>, and configure it for your basic needs. Then, add
293the following on <path>/etc/dhcp/dhcpd.conf</path>.
294</p>
295
296<note>
297This provides a static IP address for the client and the path of a PXE boot
298image, here <path>pxegrub</path>. You have to replace the MAC address of the
299ethernet card of the client and the directory where you will put the client
300files with the one you use.
301</note>
302
303<pre caption="dhcpd.conf">
304option option-150 code 150 = text ;
305ddns-update-style none ;
306host eta {
307hardware ethernet 00:00:00:00:00:00;
308fixed-address <i>ip.add.re.ss</i>;
309option option-150 "/eta/boot/grub.lst";
310filename "/eta/boot/pxegrub";
311}
312</pre>
313
314<p>
315Next you'll need to configure your interface in <path>/etc/conf.d/net</path> so
316that it doesn't get cleared at bootup. See <path>/etc/conf.d/net.example</path>
317for more information.
318</p>
319
320<pre caption="/etc/conf.d/net">
321<comment>(Replace eth0 with the correct interface)</comment>
322config_eth0=( "noop" )
323</pre>
324
325<p>
326For TFTP, emerge <c>app-admin/tftp-hpa</c>. In
327<path>/etc/conf.d/in.tftpd</path>, put the following :
328</p>
329
330<pre caption="in.tftpd">
331INTFTPD_PATH="/diskless"
332INTFTPD_USER="nobody"
333INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"
334</pre>
335
336<p>
337Setup GRUB: To provide PXE booting I use GRUB with the <c>netboot</c> USE flag
338enabled. Once GRUB is compiled, copy the PXE image to the diskless client's
339boot directory. Then edit its <path>grub.lst</path> config file.
340</p>
341
342<pre caption="Grub setup">
343# <i>echo "sys-boot/grub netboot" &gt;&gt; /etc/portage/package.use</i>
344# <i>emerge -av grub</i>
345# <i>cp /usr/lib/grub/pxegrub /diskless/eta/boot/pxegrub</i>
346# <i>nano -w /diskless/eta/boot/grub.lst</i>
347</pre>
348
349<pre caption="grub.lst">
350default 0
351timeout 30
352
353title=Diskless Gentoo
354root (nd)
355kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=<i>ip.add.re.ss</i>:/diskless/eta
356
357<comment># For the nfsroot option, the IP address is the one of the server and
358the directory is the one where your diskless client files are located (on the server).</comment>
359</pre>
360
361<p>
362Setup NFS: NFS is quite easy to configure. The only thing you have to do is to
363add a line on the <path>/etc/exports</path> config file:
364</p>
365
366<pre caption="/etc/exports">
367# <i>nano -w /etc/exports</i>
368# /etc/exports: NFS file systems being exported. See exports(5).
369/diskless/eta eta(rw,sync,no_root_squash)
370</pre>
371
372<p>
373Update your hosts: One important thing to do now is to modify your
374<path>/etc/hosts</path> file to fit your needs.
375</p>
376
377<pre caption="/etc/hosts">
378127.0.0.1 localhost
379
380192.168.1.10 eta.example.com eta
381192.168.1.20 sigma.example.com sigma
382</pre>
383
384</body>
80<section> 385</section>
81<title>Using GRUB</title> 386<section>
387<title>Creating the system on the server</title>
388<body>
389
390<p>
391You might want to reboot the server with a Gentoo Install CD, although you can
392very well continue immediately if you know how to proceed with the Gentoo
393Installation Instructions from an existing installation. Follow the standard
394install procedure as explained in the <uri link="/doc/en/handbook/">Gentoo
395Handbook</uri> BUT with the following differences:
396When you mount the file system, do the following (where <path>hdaX</path> is
397the partition where you created the <path>/diskless</path> directory). You do
398not need to mount any other partitions as all of the files will reside in the
399<path>/diskless/eta</path> directory.
400</p>
401
402<pre caption="Mounting the filesystem">
403#<i> mount /dev/hdaX /mnt/gentoo</i>
404</pre>
405
406<p>
407Stage tarballs and chroot: This example uses a stage3 tarball. Mount
408<path>/proc</path> to your diskless directory and chroot into it to continue
409with the install. Then follow the installation manual until kernel
410configuration.
411</p>
412
413<warn>
414Be very careful where you extract your stage tarball. You don't want to end up
415extracting over your existing installation.
416</warn>
417
418<pre caption="Extracting the stage tarball">
419# <i>cd /mnt/gentoo/diskless/eta/</i>
420# <i>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2</i>
421# <i>mount -t proc /proc /mnt/gentoo/diskless/eta/proc</i>
422# <i>cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf</i>
423# <i>chroot /mnt/gentoo/diskless/eta/ /bin/bash</i>
424# <i>env-update</i>
425# <i>source /etc/profile</i>
426</pre>
427
428<p>
429Kernel configuration: When you do the <c>make menuconfig</c> of your kernel
430configuration, don't forget to enable the following options with the others
431recommended into the install howto.
432</p>
433
434<pre caption="menuconfig options">
435- Your network card device support
436<comment>(In the kernel, *not* as a module!)</comment>
437
438- Under "Networking options" :
439
440[*] TCP/IP networking
441[*] IP: kernel level autoconfiguration
442[*] IP: DHCP support
443[*] IP: BOOTP support
444
445
446- Under "File systems --> Network File Systems" :
447
448&lt;*&gt; NFS file system support
449[*] Provide NFSv3 client support
450[*] Root file system on NFS
451</pre>
452
453<p>
454Save the kernel in your chrooted <path>/</path> (not in <path>/boot</path>)
455according to the pxegrub setting defined earlier. Next configure your
456diskless client's <path>/etc/fstab</path>.
457</p>
458
459<pre caption="/etc/fstab">
460# <i>nano -w /etc/fstab</i>
461/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
462proc /proc proc defaults 0 0
463tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
464</pre>
465
466<p>
467You also need to prevent the client to run a filesystem check:
468</p>
469
470<pre caption="Preventing the client to run a filesystem check">
471# <i>touch /fastboot</i>
472# <i>echo "touch /fastboot" &gt;&gt; /etc/conf.d/local.start</i>
473</pre>
474
475<p>
476Install <c>nfs-utils</c> since your client will heavily depend on it:
477</p>
478
479<pre caption="Installing nfs-utils">
480# <i>emerge nfs-utils</i>
481</pre>
482
483<p>
484Bootloader. Don't install another bootloader because we already have one -
485pxegrub. Simply finish the install and restart the server. Start the services
486you'll need to boot the new client: DHCP, TFTPD, and NFS.
487</p>
488
489<pre caption="Starting services">
490# <i>/etc/init.d/dhcp start</i>
491# <i>/etc/init.d/in.tftpd start</i>
492# <i>/etc/init.d/nfs start</i>
493</pre>
494
82<body> 495</body>
496</section>
497<section>
498<title>Booting the new client</title>
499<body>
83 500
84<p>To use GRUB for network booting purposes, you must first have GRUB 501<p>
85compiled with support for your network card. It doesn't matter if you install 502For the new client to boot properly, you'll need to configure the bios and the
86to floppy, or to the hard drive of the computer you wish to install Gentoo 503network card to use PXE as the first boot method - before CD-ROM or floppy. For
87on. If your install target already has GRUB with network support installed, 504help with this consult your hardware manuals or manufacturers website. The
88then you are one step ahead. GRUB can be downloaded from 505network card should get an IP address using DHCP and download the GRUB PXE
89<uri>ftp://alpha.gnu.org/gnu/grub/</uri></p> 506image using TFTP. Then, you should see a nice black and white GRUB bootmenu
90 507where you will select the kernel to boot and press Enter. If everything is ok
91<p>A configure example for enabling tulip support, the network card in my 508the kernel should boot, mount the root filesystem using NFS and provide you
92box:</p> 509with a login prompt. Enjoy.
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> 510</p>
98
99<p>If you are currently in Gentoo and wish to install GRUB using Gentoo
100tools, then you need to install step by step in order to configure in support
101for your network card. An example for using ebuild to install GRUB with
102tulip support:</p>
103
104<pre caption="Installing and configuring GRUB on Gentoo Linux">
105# <i>ebuild /usr/portage/sys-apps/grub/grub-0.91.ebuild clean fetch unpack</i>
106# <i>cd /var/tmp/portage/grub-0.91/work/grub-0.91/</i>
107# <i>./configure --prefix=/usr --sbindir=/sbin --mandir=/usr/share/man \ </i>
108> <i>--infodir=/usr/share/info --enable-tulip</i>
109# <i>make</i>
110# <i>touch /var/tmp/portage/grub-0.91/.compiled</i>
111# <i>cd /usr/portage/</i>
112# <i>ebuild sys-apps/grub/grub-0.91.ebuild install merge</i>
113</pre>
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>
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
179<p>Boot the machine you want to install to with your incredibly usefull grub floppy.
180Once booted you need to specify a way for the machine to get
181its IP address, specify where
182to get a kernel and it's options, and where to get it's initrd.</p>
183
184<pre>
185grub> <i>ifconfig --address=192.168.0.10 --server=192.168.0.2</i>
186grub> <i>root (nd)</i>
187grub> <i>kernel /tftpboot/kernel devfs=nomount vga=normal load_ramdisk=1 </i>
188 <i>prompt_ramdisk=0 ramdisk_size=24000 root=/dev/ram0 rw</i> <comment>(all on one line)</comment>
189grub> <i>initrd /tftpboot/rescue.gz</i>
190grub> <i>boot</i>
191</pre>
192
193<note>You can also use bootp and dhcp to configure your ip via grub. Use the bootp
194and dhcp commands.</note>
195
196<p>Now that you have your machine booted, you can install as normal. Refer to the
197from source cd install howto.</p>
198 511
199</body> 512</body>
200</section> 513</section>
201</chapter> 514</chapter>
202 515
203 516<chapter>
204
205
206
207<chapter> <title>Installing Gentoo from an existing Linux distribution </title> 517<title>Installing Gentoo from an existing Linux distribution</title>
518<section>
208<section> <title> Requirements </title> 519<title>Requirements</title>
209<body> 520<body>
521
522<p>
210<p>In order to install Gentoo from your existing Linux distribution you need to 523In order to install Gentoo from your existing Linux distribution you need to
211have chroot command installed, and have a copy of the Gentoo installation 524have 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 525tarball 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 526you 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 527just 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> 528"host" operating system, but it is not very important. Let's get started!
529</p>
530
216</body> 531</body>
532</section>
217</section> 533<section>
218
219<section> <title> Overview </title> 534<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> 535<body>
536
537<p>
538We will first allocate a partition to Gentoo by resizing our existing Linux
539partition, mount the partition, untar the tarball to the partition that is
540mounted, chroot inside the pseudo-system and start building. Once the bootstrap
541process is done, we will do some final configuration on the system so as to
542make sure it boots, then we are ready to reboot and use Gentoo.
543</p>
544
545</body>
546</section>
223</section> 547<section>
224
225<section> <title> How should we make space for gentoo? </title> 548<title>How should we make space for Gentoo?</title>
226<body> 549<body>
227 550
551<p>
552The root partition is the filesystem mounted under <path>/</path>. A quick run
553of <c>mount</c> on my system shows what I am talking about. We well also use
554<c>df</c> (disk free) to see how much space I have left and how I will be
555resizing. Note that it is not mandatory to resize your root partition! You
556could be resizing anything else supported by our resizer, but let's talk about
557that later.
228<p> 558</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 559
232<pre caption="Filesystem information"> 560<pre caption="Filesystem information">
233# <i>mount</i> 561# <i>mount</i>
234/dev/hdb2 on / type ext3 (rw) 562/dev/hdb2 on / type ext3 (rw)
235none on /proc type proc (rw) 563none on /proc type proc (rw)
236none on /dev/pts type devpts (rw,gid=5,mode=620) 564none on /dev/pts type devpts (rw,gid=5,mode=620)
237none on /dev/shm type tmpfs (rw) 565none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec)
238# <i>df -h </i> 566# <i>df -h </i>
239Filesystem Size Used Avail Use% Mounted on 567Filesystem Size Used Avail Use% Mounted on
240/dev/hdb2 4.0G 1.9G 2.4G 82% / 568/dev/hdb2 4.0G 1.9G 2.4G 82% /
241none 38M 0 38M 0% /dev/shm 569none 38M 0 38M 0% /dev/shm
570</pre>
571
572<p>
573As we can see, the partition mounted as <path>/</path> named
574<path>/dev/hdb2</path> has 2.4 gigabytes free. In my case, I think I will
575resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes
576for Gentoo. Not bad, I could have quite some stuff installed. However, I think
577that even one gigabyte is enough for most users. So let's partition this thing!
242</pre> 578</p>
243 579
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> 580</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> 581</section>
582<section>
583<title>Building parted to resize partition</title>
584<body>
585
586<p>
587Parted is an utility supplied by the GNU foundation, an old and respectable
588huge project whose software you are using in this very moment. There is one
589tool, however, that is extremely useful for us at the moment. It's called
590parted, partition editor and we can get it from
251http://www.gnu.org/software/parted/ </uri> 591<uri>http://www.gnu.org/software/parted/</uri>
252</p> 592</p>
593
594<note>
253<note> There are other tools for doing resize of partitions as well, but author 595There are other tools for doing resize of partitions as well, but the author is
254is unsure/uninterested whether PartitionMagic(tm) or other software of the kind 596unsure/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> 597the job. It's the reader's job to check them out
598</note>
256 599
257<p> 600<p>
258Look up on that page the type of filesystem you want to resize and see if parted 601Look 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 602parted 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 603partition 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 604the 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 605root partition, therefore we must boot from a floppy disk a minimal linux
263use previously-compiled parted copied to a diskette in order to resize "/". 606system 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, 607resize <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 608in 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. 609and run it on an unmounted partition you chose to resize. Here's how I did it
610for my system.
267</p> 611</p>
268 612
613<impo>
269<impo> Make sure that the operations you want to do on your partition are 614Make sure that the operations you want to do on your partition are supported by
270supported by parted! </impo> 615parted!
616</impo>
271 617
272<p> Get tomsrtbt boot/root disk (free of charge) from <uri> 618<p>
273http://freshmeat.net/tomsrtbt" </uri>, create a floppy as suggested in the 619Get 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 620floppy - free of charge) from <uri>http://mininux.free.fr/uk/</uri>, create a
275the drive for the next step. </p> 621floppy as suggested in the Documentation that accompanies the software package
622and insert a new floppy in the drive for the next step.
623</p>
276 624
625<note>
277<note> Note again that Linux is synonym of "There's one more way to do it". Your 626Note 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 627objective 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 628might use some 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 629need to do this step at all, ie. you might only have umount the filesystem you
281repartition in your Linux session and run parted on it. </note> 630want to repartition in your Linux session and run parted on it.
631</note>
282 632
283<pre caption="Utility disk creation"> 633<pre caption="Utility disk creation">
284# <i>mkfs.minix /dev/fd0</i> 634# <i>mkfs.minix /dev/fd0</i>
285480 inodes 635480 inodes
2861440 blocks 6361440 blocks
287Firstdatazone=19 (19) 637Firstdatazone=19 (19)
288Zonesize=1024 638Zonesize=1024
289Maxsize=268966912 639Maxsize=268966912
290</pre> 640</pre>
291 641
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. 642<p>
643We will now proceed with the build of parted. If it's not already downloaded
644and untarred, do so now and <c>cd</c> into the corresponding directory. Now run
645the following set of commands to build the utility and copy it to your floppy
646disk.
647</p>
293 648
294<pre caption="Building the utility floppy"> 649<pre caption="Building the utility floppy">
295# <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp; 650# <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp;
296export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure 651export 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> 652&amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i>
298</pre> 653</pre>
299 654
300<p> 655<p>
301Congratulations, you are ready to reboot and resize your partition. Do this only 656Congratulations, 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 657only 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. 658The 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 659patient. 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 660and 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. 661we have created above and type <c>mount /dev/fd0 /floppy</c> to have parted
307There you go. Run parted and you will be able to resize your partition. Once 662under <path>/floppy</path>. There you go. Run parted and you will be able to
308this lenghty process done, we are ready to have the real fun, by installing 663resize your partition. Once this lenghty process done, we are ready to have the
309gentoo. Reboot back into your old Linux system for now. Drive youwish to operate 664real fun, by installing Gentoo. Reboot back into your old Linux system for now.
310on is the drive containing the partition we want to resize. For example, if we 665The drive you wish to operate on is the drive containing the partition we want
311want to resize /dev/hda3, the drive is /dev/hda </p> 666to resize. For example, if we want to resize /dev/hda3, the drive is /dev/hda.
667</p>
312 668
313<pre caption="Commands to run once logged into tomsrtbt system"> 669<pre caption="Commands to run once logged into mininux system">
314# <i>mount /dev/fd0 /floppy </i> 670# <i>mount /dev/fd0 /floppy </i>
315# <i>cd /floppy; ./parted [drive you wish to operate on]</i> 671# <i>cd /floppy; ./parted [drive you wish to operate on]</i>
316(parted) <i> print </i> 672(parted) <i> print </i>
317Disk geometry for /dev/hdb: 0.000-9787.148 megabytes 673Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
318Disk label type: msdos 674Disk label type: msdos
319Minor Start End Type Filesystem Flags 675Minor Start End Type Filesystem Flags
3201 0.031 2953.125 primary ntfs 6761 0.031 2953.125 primary ntfs
3213 2953.125 3133.265 primary linux-swap 6773 2953.125 3133.265 primary linux-swap
3222 3133.266 5633.085 primary ext3 6782 3133.266 5633.085 primary ext3
3234 5633.086 9787.148 extended 6794 5633.086 9787.148 extended
3245 5633.117 6633.210 logical 6805 5633.117 6633.210 logical
3256 6633.242 9787.148 logical ext3 6816 6633.242 9787.148 logical ext3
326(parted) <i> help resize </i> 682(parted) <i> help resize </i>
327 resize MINOR START END resize filesystem on partition MINOR 683 resize MINOR START END resize filesystem on partition MINOR
328 684
329 MINOR is the partition number used by Linux. On msdos disk labels, the 685 MINOR is the partition number used by Linux. On msdos disk labels, the
330 primary partitions number from 1-4, and logical partitions are 5 686 primary partitions number from 1-4, and logical partitions are 5
331 onwards. 687 onwards.
332 START and END are in megabytes 688 START and END are in megabytes
333(parted) <i> resize 2 3133.266 4000.000 </i> 689(parted) <i> resize 2 3133.266 4000.000 </i>
334</pre> 690</pre>
335 691
692<impo>
336<impo> Be patient! The computer is working! Just look at the hardware LED on 693Be patient! The computer is working! Just look at the harddrive LED on your case
337your case to see that it is really working. This should take between 2 and 30 694to see that it is really working. This should take between 2 and 30 minutes.
338minutes. </impo> 695</impo>
339 696
697<p>
340<p>Once you have resized, boot back into your old linux as described. Then go to 698Once 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 699<uri link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">The Gentoo
34217. 700Handbook: Preparing the Disks</uri> and follow the instructions. When
701chrooting, use the following command to flush your environment:
702</p>
343 703
704<pre caption="Flushing the environment during chroot">
705# <i>env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash</i>
706# <i>/usr/sbin/env-update</i>
707# <i>source /etc/profile</i>
708</pre>
344 709
710<p>
345Enjoy! 711Enjoy!
346</p> 712</p>
713
347</body> 714</body>
348</section> 715</section>
349</chapter> 716</chapter>
350</guide> 717</guide>

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

  ViewVC Help
Powered by ViewVC 1.1.20