/[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.85 - (hide annotations) (download) (as text)
Sun Apr 29 16:52:20 2012 UTC (2 years, 7 months ago) by swift
Branch: MAIN
Changes since 1.84: +3 -5 lines
File MIME type: application/xml
Fix bug #406263 - Removing fstab references to /proc and /dev/shm, these are handled by openrc automatically

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

  ViewVC Help
Powered by ViewVC 1.1.20