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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download) (as text)
Sun Jun 1 08:25:33 2003 UTC (11 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.7: +5 -4 lines
File MIME type: application/xml
Youwish -> You wish, mentioned by ymedini@actcom.co.il

1 <?xml version='1.0' encoding="UTF-8"?>
2 <?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?>
3
4 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5
6 <guide link="/doc/en/altinstall.xml">
7 <title>The Gentoo Linux alternative installation method HOWTO</title>
8 <author title="Author"><mail link="lordviram@rebelpacket.net">Travis Tilley</mail></author>
9 <author title="Contributor"><mail link="davoid@gentoo.org">Faust A.
10 Tanasescu</mail></author>
11 <author title="Contributor"><mail link="aliz@gentoo.org">Daniel Ahlberg</mail></author>
12 <author title="Editor"><mail link="swift@gentoo.org">Sven Vermeulen</mail></author>
13 <abstract>
14 This HOWTO is meant to be a repository of alternative Gentoo installation
15 methods, for those with special installation needs such as lack of a cdrom
16 or a computer that cant boot cds.
17 </abstract>
18
19 <version>0.3</version>
20 <date>1 June 2003</date>
21
22 <chapter>
23 <title>About this document</title>
24 <section>
25 <body>
26
27 <p>If the standard boot-from-CD install method doesn't work for you
28 (or you just don't like it),
29 help is now here. This document serves to
30 provide a repository of alternative Gentoo Linux installation techniques
31 to those who need them.
32 Or, if you prefer, it serves as
33 a place to put your wacky installation methods. If you have an
34 installation method that you yourself find useful, or you have devised an
35 amusing way of installing gentoo, please dont hesitate to write something
36 up and <mail link="lordviram@rebelpacket.net">send it to me.</mail></p>
37
38
39 </body>
40 </section>
41 </chapter>
42
43 <chapter>
44 <title>Netboot install</title>
45 <section>
46 <title>Requirements</title>
47 <body>
48 <p>The requirements for a netboot install are a host computer than can
49 provide a tftp server and a computer
50 that can netboot itself via either bios or a floppy drive used to boot GRUB
51 or another network bootloader. A dhcp server might also be necessary. Of
52 course, you will also need the latest build ISO, which can be found at
53 <uri>http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/</uri></p>
54 </body>
55 </section>
56
57 <section>
58 <title>Overview</title>
59 <body>
60
61 <p>In order to load images off the network, the first thing a netboot machine
62 must do is obtain an IP address. There are multiple ways of obtaining
63 an IP address, and any
64 one of them will do. Personally, I prefer to use GRUB for everything, but if
65 your computer supports booting from a network already then grub might not
66 be necessary, even if it might be easier to just use GRUB's <c>ifconfig</c> command
67 instead of setting up a bootp or dhcp server.</p>
68
69 <p>Once your computer has obtained an IP address, the next logical step is to find
70 out what you are going to be booting and where it might be held. Once again,
71 it would be easiest to do this with GRUB commands as opposed to setting up
72 a bootp or dhcp server. You will also need to specify how to obtain an initrd
73 and tell the kernel that it will be using this as it's root filesystem.</p>
74
75 <p>With your kernel loaded and root filesystem mounted, you may proceed
76 with installation as normal. The build image could be loaded from a cd, or it
77 can be downloaded from the network via tftp.</p>
78
79 </body>
80 </section>
81 <section>
82 <title>Using GRUB</title>
83 <body>
84
85 <p>To use GRUB for network booting purposes, you must first have GRUB
86 compiled with support for your network card. It doesn't matter if you install
87 to floppy, or to the hard drive of the computer you wish to install Gentoo
88 on. If your install target already has GRUB with network support installed,
89 then you are one step ahead. GRUB can be downloaded from
90 <uri>ftp://alpha.gnu.org/gnu/grub/</uri></p>
91
92 <p>A configure example for enabling tulip support, the network card in my
93 box:</p>
94
95 <pre caption="Manual GRUB installation">
96 # <i>./configure --enable-tulip --prefix=/usr</i>
97 # <i>make &amp;&amp; make install</i>
98 </pre>
99
100 <p>If you are currently in Gentoo and wish to install GRUB using Gentoo
101 tools, then you need to install step by step in order to configure in support
102 for your network card. An example for using ebuild to install GRUB with
103 tulip support:</p>
104
105 <pre caption="Installing and configuring GRUB on Gentoo Linux">
106 # <i>ebuild /usr/portage/sys-apps/grub/grub-0.91.ebuild clean fetch unpack</i>
107 # <i>cd /var/tmp/portage/grub-0.91/work/grub-0.91/</i>
108 # <i>./configure --prefix=/usr --sbindir=/sbin --mandir=/usr/share/man \ </i>
109 > <i>--infodir=/usr/share/info --enable-tulip</i>
110 # <i>make</i>
111 # <i>touch /var/tmp/portage/grub-0.91/.compiled</i>
112 # <i>cd /usr/portage/</i>
113 # <i>ebuild sys-apps/grub/grub-0.91.ebuild install merge</i>
114 </pre>
115
116 <p>Now that we have the GRUB shell itself installed, we need to install to
117 a boot sector. Although you could install GRUB to the boot sector of your
118 install computer's hard drive, here we will assume that you are installing
119 GRUB on a boot floppy. There are two ways of doing this. You can use the GRUB
120 shell itself, or you can use a provided script called <c>grub-install</c>. It is
121 preferable to use <c>grub-install</c> when installing GRUB to a floppy.</p>
122
123 <pre caption="grub-install example">
124 # <i>mkfs.ext2 /dev/fd0</i>
125 # <i>mount /dev/fd0 /mnt/floppy/</i>
126 # <i>grub-install --root-directory=/mnt/floppy/ '(fd0)'</i>
127 # <i>umount /mnt/floppy/</i>
128 </pre>
129
130 <p><c>grub-install</c> does not always work... and isn't always the best way to install
131 GRUB. And since the GRUB shell works exactly like GRUB would when booted
132 via the boot sector, it might be more desirable just to use the GRUB shell. Here
133 is an example of how to use the GRUB shell to install GRUB to a floppy:</p>
134
135 <pre caption="Using the GRUB shell instead">
136 # <i>mkfs.ext2 /dev/fd0</i>
137 # <i>mount /dev/fd0 /mnt/floppy/</i>
138 # <i>mkdir -p /mnt/floppy/boot/grub/</i>
139 # <i>cp -v /usr/share/grub/i386-pc/* /mnt/floppy/boot/grub/</i>
140 # <i>grub</i>
141 grub> <i>root (fd0)</i>
142 grub> <i>setup (fd0)</i>
143 grub> <i>quit</i>
144 # <i>umount /mnt/floppy/</i>
145 </pre>
146
147 <p>Now that we have a bootable GRUB floppy, we need to set up the host tftp server
148 (I suggest netkit's tftp server)
149 for loading our kernel and initrd. If you use inetd then you will need
150 a line in your <path>/etc/inetd.conf</path> that looks
151 like this:</p>
152
153 <pre caption="/etc/inetd.conf">
154 tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd
155 </pre>
156
157 <p>To install the netkit tftp server under gentoo linux, emerge net-misc/netkit-tftp</p>
158
159 <note>There is an ebuild for xinetd... if you prefer to use this than feel free to do
160 so. However I do not use xinetd, and do not know how to set up tftp with it. If you
161 use it and such, please send me info on how to get xinetd working and I will include
162 them in this howto.</note>
163
164 <p>Now that we have our tftp server ready, we need a kernel and a root initrd to
165 put in it. You can compile a custom kernel yourself, but make sure it has all the
166 things necessary for running gentoo (like devfs) and for netbooting (like initrd
167 support). The root initrd will be the rescue.gz included in the gentoo ISO.</p>
168
169 <impo>Mounting an ISO file without burning it to cd requires loopback filesystem
170 support.</impo>
171
172 <pre>
173 # <i>mkdir /tftpboot</i>
174 # <i>mount -o loop /path/to/gentoo-ix86-1.1a.iso /mnt/cdrom/</i>
175 # <i>cp /mnt/cdrom/isolinux/kernel /mnt/cdrom/isolinux/rescue.gz /tftpboot</i>
176 # <i>chmod 644 /tftpboot/*</i>
177 # <i>umount /mnt/cdrom/</i>
178 </pre>
179
180 <p>Boot the machine you want to install to with your incredibly usefull grub floppy.
181 Once booted you need to specify a way for the machine to get
182 its IP address, specify where
183 to get a kernel and it's options, and where to get it's initrd.</p>
184
185 <pre>
186 grub> <i>ifconfig --address=192.168.0.10 --server=192.168.0.2</i>
187 grub> <i>root (nd)</i>
188 grub> <i>kernel /tftpboot/kernel devfs=nomount vga=normal load_ramdisk=1 </i>
189 <i>prompt_ramdisk=0 ramdisk_size=24000 root=/dev/ram0 rw</i> <comment>(all on one line)</comment>
190 grub> <i>initrd /tftpboot/rescue.gz</i>
191 grub> <i>boot</i>
192 </pre>
193
194 <note>You can also use bootp and dhcp to configure your ip via grub. Use the bootp
195 and dhcp commands.</note>
196
197 <p>Now that you have your machine booted, you can install as normal. Refer to the
198 from source cd install howto.</p>
199
200 </body>
201 </section>
202 </chapter>
203
204
205
206
207
208 <chapter> <title>Installing Gentoo from an existing Linux distribution </title>
209 <section> <title> Requirements </title>
210 <body>
211 <p>In order to install Gentoo from your existing Linux distribution you need to
212 have chroot command installed, and have a copy of the Gentoo installation
213 tarball or ISO you want to install. A network connection would be preferable if
214 you want more than what's supplied in your tarball. (by the way, a tarball is
215 just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the
216 "host" operating system, but it is not very important. Let's get started! </p>
217 </body>
218 </section>
219
220 <section> <title> Overview </title>
221 <body>
222 <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>
223 </body>
224 </section>
225
226 <section> <title> How should we make space for gentoo? </title>
227 <body>
228
229 <p>
230 The 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>
231
232
233 <pre caption="Filesystem information">
234 # <i>mount</i>
235 /dev/hdb2 on / type ext3 (rw)
236 none on /proc type proc (rw)
237 none on /dev/pts type devpts (rw,gid=5,mode=620)
238 none on /dev/shm type tmpfs (rw)
239 # <i>df -h </i>
240 Filesystem Size Used Avail Use% Mounted on
241 /dev/hdb2 4.0G 1.9G 2.4G 82% /
242 none 38M 0 38M 0% /dev/shm
243 </pre>
244
245 <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>
246
247 </body> </section>
248
249 <section> <title> Building parted to resize partition </title>
250 <body>
251 <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>
252 http://www.gnu.org/software/parted/</uri>
253 </p>
254 <note> There are other tools for doing resize of partitions as well, but author
255 is unsure/uninterested whether PartitionMagic(tm) or other software of the kind
256 do the job. It's the reader's job to check them out </note>
257
258 <p>
259 Look up on that page the type of filesystem you want to resize and see if parted
260 can do it. If not, you're out of luck, you will have to destroy some partition
261 to make space for gentoo, and reinstall back. Go ahead by downloading the
262 software, install it. Here we have a problem. We want to resize our Linux root
263 partition, therefore we must boot from a floppy disk a minimal linux system and
264 use previously-compiled parted copied to a diskette in order to resize "/".
265 However, if you can unmount the partition while still in Linux you are lucky,
266 you don't need to do what follows. Just compile parted and run it on an
267 unmounted partition you chose to resize. Here's how I did it for my system.
268 </p>
269
270 <impo> Make sure that the operations you want to do on your partition are
271 supported by parted! </impo>
272
273 <p> Get tomsrtbt boot/root disk (free of charge) from <uri>
274 http://freshmeat.net/tomsrtbt" </uri>, create a floppy as suggested in the
275 Documentation that accompanies the software package and insert a new floppy in
276 the drive for the next step. </p>
277
278 <note> Note again that Linux is synonym of "There's one more way to do it". Your
279 objective is to run parted on an unmounted partition so it can do its work. You
280 might use some other boot/root diskset other than tomsrtbt. You might not even
281 need to do this step at all, that is only umount the filesystem you want to
282 repartition in your Linux session and run parted on it. </note>
283
284 <pre caption="Utility disk creation">
285 # <i>mkfs.minix /dev/fd0</i>
286 480 inodes
287 1440 blocks
288 Firstdatazone=19 (19)
289 Zonesize=1024
290 Maxsize=268966912
291 </pre>
292
293 We 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.
294
295 <pre caption="Building the utility floppy">
296 # <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp;
297 export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure
298 &amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i>
299 </pre>
300
301 <p>
302 Congratulations, you are ready to reboot and resize your partition. Do this only
303 after taking a quick look at the parted documentation on the GNU website. The
304 resize should take under 30 minutes for the largest hard-drives, be patient.
305 Reboot your system with the tomsrtbt boot disk (just pop it inside), and once
306 you are logged in, switch the disk in the drive with your utility disk we have
307 created above and type mount /dev/fd0 /floppy to have parted under /floppy.
308 There you go. Run parted and you will be able to resize your partition. Once
309 this lenghty process done, we are ready to have the real fun, by installing
310 gentoo. Reboot back into your old Linux system for now. Drive you wish to
311 operate on is the drive containing the partition we want to resize. For
312 example, if we want to resize /dev/hda3, the drive is /dev/hda
313 </p>
314
315 <pre caption="Commands to run once logged into tomsrtbt system">
316 # <i>mount /dev/fd0 /floppy </i>
317 # <i>cd /floppy; ./parted [drive you wish to operate on]</i>
318 (parted) <i> print </i>
319 Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
320 Disk label type: msdos
321 Minor Start End Type Filesystem Flags
322 1 0.031 2953.125 primary ntfs
323 3 2953.125 3133.265 primary linux-swap
324 2 3133.266 5633.085 primary ext3
325 4 5633.086 9787.148 extended
326 5 5633.117 6633.210 logical
327 6 6633.242 9787.148 logical ext3
328 (parted) <i> help resize </i>
329 resize MINOR START END resize filesystem on partition MINOR
330
331 MINOR is the partition number used by Linux. On msdos disk labels, the
332 primary partitions number from 1-4, and logical partitions are 5
333 onwards.
334 START and END are in megabytes
335 (parted) <i> resize 2 3133.266 4000.000 </i>
336 </pre>
337
338 <impo> Be patient! The computer is working! Just look at the hardware LED on
339 your case to see that it is really working. This should take between 2 and 30
340 minutes. </impo>
341
342 <p>Once you have resized, boot back into your old linux as described. Then go to
343 <uri link="/doc/en/gentoo-x86-install.xml">http://www.gentoo.org/doc/en/gentoo-x86-install.xml</uri> and follow steps 6 through 17. Don't forget to create the <path>/mnt/gentoo</path> directory before proceeding with step 7. In step 8 you have to download the requested stage-tarball as we're not working from a LiveCD.
344
345
346 Enjoy!
347 </p>
348 </body>
349 </section>
350 </chapter>
351 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20