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