/[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.63 - (show annotations) (download) (as text)
Fri Jul 21 08:10:19 2006 UTC (8 years ago) by rane
Branch: MAIN
Changes since 1.62: +4 -4 lines
File MIME type: application/xml
rephrasing, no tarball was mounted, thanks to kucrut for reporting

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

  ViewVC Help
Powered by ViewVC 1.1.20