/[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.79 - (show annotations) (download) (as text)
Sun Sep 26 21:59:41 2010 UTC (3 years, 11 months ago) by jkt
Branch: MAIN
Changes since 1.78: +4 -5 lines
File MIME type: application/xml
#337836, make chroot instructions more robust

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

  ViewVC Help
Powered by ViewVC 1.1.20