/[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.60 - (show annotations) (download) (as text)
Mon Aug 8 00:05:39 2005 UTC (9 years, 11 months ago) by smithj
Branch: MAIN
Changes since 1.59: +10 -3 lines
File MIME type: application/xml
added a paragraph under knoppix install about FEATURES=user{priv,sandbox}

1 <?xml version='1.0' encoding="UTF-8"?>
2 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.59 2005/07/03 10:32:30 cam 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.65</version>
59 <date>2005-08-07</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 bootstrap.sh 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 bootstrap.sh it will fail
300 because it won't be able to download any files. We will fetch these files
301 somewhere else and put them in /usr/portage/distfiles (on F2 console).
302 </p>
303
304 <p>
305 You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib,
306 binutils, gcc, ncurses plus their dependencies.
307 </p>
308
309 <note>
310 Note that you need the versions of each package synced with your portage tree.
311 </note>
312
313 <pre caption="Getting the download listing">
314 <comment>(Don't forget the 2 in front of the &gt;)</comment>
315 # <i>emerge -fp glibc baselayout texinfo gettext zlib binutils gcc ncurses 2&gt; stage1.list</i>
316 # <i>mount -t vfat /dev/fd0 /mnt/floppy</i>
317 # <i>cp /mnt/gentoo/stage1.list /mnt/floppy</i>
318 # <i>umount /mnt/floppy</i>
319 </pre>
320
321 <p>
322 Take the floppy to the computer that has fast access. If you take a look at the
323 <path>stage1.list</path> file, you'll see that it provides you with several
324 URLs to download. Sadly, it lists several possible URLs for each package as
325 well, which isn't what you want. Strip all but one of the URLs first:
326 </p>
327
328 <pre caption="Stripping URLs">
329 <comment>(This script is depending on the output format given by emerge which
330 might change in the future without further notice - use with caution!)</comment>
331 # <i>cut -f 1 -d ' ' stage1.list > stage1.download</i>
332 </pre>
333
334 <p>
335 Now use <c>wget</c> to fetch all the listed sources:
336 </p>
337
338 <pre caption="Use wget to grab your source packages">
339 # <i>wget -N -i stage1.download</i>
340 </pre>
341
342 <p>
343 Once you have obtained all the files, take them to the computer and copy them
344 to <path>/mnt/gentoo/usr/portage/distfiles</path>. You will then be able to run
345 <c>bootstrap.sh</c>. Repeat this same wget fetch and place procedure for stage2
346 and 3.
347 </p>
348
349 </body>
350 </section>
351 </chapter>
352
353 <chapter>
354 <title>Diskless install using PXE boot</title>
355 <section>
356 <title>Requirements</title>
357 <body>
358
359 <p>
360 You will need a network card on the diskless client that uses the PXE protocol
361 to boot, like many 3com cards. You will also need a BIOS that supports booting
362 from PXE.
363 </p>
364
365 </body>
366 </section>
367 <section>
368 <title>Server base setup</title>
369 <body>
370
371 <p>
372 Create directories: The first thing to do is to create the directories where
373 your diskless system will be stored. Create a directory called
374 <path>/diskless</path> which houses a directory for each diskless client. For
375 the rest of this howto we'll be working on the client 'eta'.
376 </p>
377
378 <pre caption="directory setup">
379 # <i>mkdir /diskless</i>
380 # <i>mkdir /diskless/eta</i>
381 # <i>mkdir /diskless/eta/boot</i>
382 </pre>
383
384 <p>
385 DHCP and TFTP setup: The client will get boot informations using DHCP and
386 download all the required files using TFTP. Just emerge DHCP and configure it
387 for your basic needs. Then, add the following on
388 <path>/etc/dhcp/dhcpd.conf</path>.
389 </p>
390
391 <note>
392 This provide a static IP address for the client and the path of a PXE boot
393 image, here pxegrub. You have to replace the MAC address of the Ethernet card
394 of the client and the directory where you will put the client files with the
395 one you use.
396 </note>
397
398 <p>
399 For DHCPd, run <c>emerge dhcp</c> (or any other DHCP server of your choice).
400 Make sure that the correct interface is selected in
401 <path>/etc/conf.d/dhcp</path>.
402 </p>
403
404 <pre caption="dhcp.conf">
405 option option-150 code 150 = text ;
406 ddns-update-style none ;
407 host eta {
408 hardware ethernet 00:00:00:00:00:00;
409 fixed-address <i>ip.add.re.ss</i>;
410 option option-150 "/eta/boot/grub.lst";
411 filename "/eta/boot/pxegrub";
412 }
413 </pre>
414
415 <p>
416 For TFTP, emerge <c>app-admin/tftp-hpa</c>. In
417 <path>/etc/conf.d/in.tftpd</path>, put the following :
418 </p>
419
420 <pre caption="in.tftpd">
421 INTFTPD_PATH="/diskless"
422 INTFTPD_USER="nobody"
423 INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"
424 </pre>
425
426 <p>
427 Setup GRUB: To provide PXE booting I use GRUB. You have to compile it by
428 yourself to enable the PXE image compilation ... but that's quite easy. First,
429 get the latest version of the GRUB source code (<c>emerge -f grub</c> will
430 place the tarball in <path>/usr/portage/distfiles</path>). Copy the tarball to
431 <path>/diskless</path> and then build it to make the pxe capable binary. Once
432 the binary is built, copy it to the diskless client's boot directory. Then edit
433 it's grub.lst config file.
434 </p>
435
436 <pre caption="grub setup">
437 # <i>tar zxvf grub-0.92.tar.gz</i>
438 # <i>cd grub-0.92</i>
439 # <i>./configure --help</i>
440 <comment>(In the options you will see a list of supported network interface drivers.
441 Select the driver compatible with your client's network card. Herein referenced
442 as $nic)</comment>
443 # <i>./configure --enable-diskless --enable-$nic</i>
444 # <i>make</i>
445 # <i>cd stage2</i>
446 # <i>cp pxegrub /diskless/eta/boot/pxegrub</i>
447 # <i>nano -w /diskless/eta/boot/grub.lst</i>
448 </pre>
449
450 <pre caption="grub.lst">
451 default 0
452 timeout 30
453
454 title=Diskless Gentoo
455 root (nd)
456 kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=<i>ip.add.re.ss</i>:/diskless/eta
457
458 <comment># For the nfsroot option, the IP address is the one of the server and
459 the directory is the one where your diskless client files are located (on the server).</comment>
460 </pre>
461
462 <p>
463 Setup NFS: NFS is quite easy to configure. The only thing you have to do is to
464 add a line on the <path>/etc/exports</path> config file :
465 </p>
466
467 <pre caption="/etc/exports">
468 # <i>nano -w /etc/exports</i>
469 # /etc/exports: NFS file systems being exported. See exports(5).
470 /diskless/eta eta(rw,sync,no_root_squash)
471 </pre>
472
473 <p>
474 Update your hosts: One important thing to do now is to modify your
475 <path>/etc/hosts</path> file to fit your needs.
476 </p>
477
478 <pre caption="/etc/hosts">
479 127.0.0.1 localhost
480
481 192.168.1.10 eta.example.com eta
482 192.168.1.20 sigma.example.com sigma
483 </pre>
484
485 </body>
486 </section>
487 <section>
488 <title>Creating the system on the server</title>
489 <body>
490
491 <p>
492 You might want to reboot the server with a Gentoo Install CD, although you can
493 very well continue immediately if you know how to proceed with the Gentoo
494 Installation Instructions from an existing installation. Follow the standard
495 install procedure as explained in the Gentoo Install Howto BUT with the
496 following differences:
497 When you mount the file system, do the following (where hdaX is the partition
498 where you created the /diskless directory). You do not need to mount any other
499 partitions as all of the files will reside in the <path>/diskless/eta</path>
500 directory.
501 </p>
502
503 <pre caption="mounting the filesystem">
504 #<i> mount /dev/hda3 /mnt/gentoo</i>
505 </pre>
506
507 <p>
508 Stage tarballs and chroot: This example uses a stage3 tarball. Mount
509 <path>/proc</path> to your diskless directory and chroot into it to continue
510 with the install. Then follow the installation manual until kernel
511 configuration.
512 </p>
513
514 <warn>
515 Be very careful where you extract your stage tarball. You don't want to end up
516 extracting over your existing installation.
517 </warn>
518
519 <pre caption="extracting the stage tarball">
520 # <i>cd /mnt/gentoo/diskless/eta/</i>
521 # <i>tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2</i>
522 # <i>mount -t proc /proc /mnt/gentoo/diskless/eta/proc</i>
523 # <i>cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf</i>
524 # <i>chroot /mnt/gentoo/diskless/eta/ /bin/bash</i>
525 # <i>env-update</i>
526 # <i>source /etc/profile</i>
527 </pre>
528
529 <p>
530 Kernel configuration: When you do the <c>make menuconfig</c> of your kernel
531 configuration, don't forget to enable the following options with the others
532 recommended into the install howto.
533 </p>
534
535 <pre caption="menuconfig options">
536 - Your network card device support
537 <comment>(In the kernel, *not* as a module!)</comment>
538
539 - Under "Networking options" :
540
541 [*] TCP/IP networking
542 [*] IP: kernel level autoconfiguration
543 [*] IP: DHCP support
544 [*] IP: BOOTP support
545
546
547 - Under "File systems --> Network File Systems" :
548
549 &lt;*&gt; NFS file system support
550 [*] Provide NFSv3 client support
551 [*] Root file system on NFS
552 </pre>
553
554 <p>
555 Save the kernel in your chrooted <path>/</path> (not in <path>/boot</path>)
556 according to the pxegrub setting defined earlier. Next configure your
557 diskless client's <path>/etc/fstab</path>.
558 </p>
559
560 <pre caption="/etc/fstab">
561 # <i>nano -w /etc/fstab</i>
562 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
563 proc /proc proc defaults 0 0
564 tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
565 </pre>
566
567 <p>
568 You also need to prevent the client to run a filesystem check:
569 </p>
570
571 <pre caption="Preventing the client to run a filesystem check">
572 # <i>touch /fastboot</i>
573 # <i>echo "touch /fastboot" &gt;&gt; /etc/conf.d/local.start</i>
574 </pre>
575
576 <p>
577 Install <c>nfs-utils</c> since your client will heavily depend on it:
578 </p>
579
580 <pre caption="Installing nfs-utils">
581 # <i>emerge nfs-utils</i>
582 </pre>
583
584 <p>
585 Bootloader. Don't install another bootloader because we already have one -
586 pxegrub. Simply finish the install and restart the server. Start the services
587 you'll need to boot the new client: DHCP, TFTPD, and NFS.
588 </p>
589
590 <pre caption="Starting services">
591 # <i>/etc/init.d/dhcp start</i>
592 # <i>/etc/init.d/in.tftpd start</i>
593 # <i>/etc/init.d/nfs start</i>
594 </pre>
595
596 </body>
597 </section>
598 <section>
599 <title>Booting the new client</title>
600 <body>
601
602 <p>
603 For the new client to boot properly, you'll need to configure the bios and the
604 network card to use PXE as the first boot method - before CD-ROM or floppy. For
605 help with this consult your hardware manuals or manufacturers website. The
606 network card should get an IP address using DHCP and download the GRUB PXE
607 image using TFTP. Then, you should see a nice black and white GRUB bootmenu
608 where you will select the kernel to boot and press Enter. If everything is ok
609 the kernel should boot, mount the root filesystem using NFS and provide you
610 with a login prompt. Enjoy.
611 </p>
612
613 </body>
614 </section>
615 </chapter>
616
617 <chapter>
618 <title>Installing Gentoo from an existing Linux distribution</title>
619 <section>
620 <title>Requirements</title>
621 <body>
622
623 <p>
624 In order to install Gentoo from your existing Linux distribution you need to
625 have chroot command installed, and have a copy of the Gentoo installation
626 tarball or ISO you want to install. A network connection would be preferable if
627 you want more than what's supplied in your tarball. (by the way, a tarball is
628 just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the
629 "host" operating system, but it is not very important. Let's get started!
630 </p>
631
632 </body>
633 </section>
634 <section>
635 <title>Overview</title>
636 <body>
637
638 <p>
639 We will first allocate a partition to Gentoo by resizing our existing Linux
640 partition, mount the partition, untar the tarball that is mounted, chroot
641 inside the pseudo-system and start building. Once the bootstrap process is
642 done, we will do some final configuration on the system so as to make sure it
643 boots, then we are ready to reboot and use Gentoo.
644 </p>
645
646 </body>
647 </section>
648 <section>
649 <title>How should we make space for Gentoo?</title>
650 <body>
651
652 <p>
653 The root partition is the filesystem mounted under <path>/</path>. A quick run
654 of mount on my system shows what I am talking about. We well also use df (disk
655 free) to see how much space I have left and how I will be resizing. Note that
656 it is not mandatory to resize your root partition! You could be resizing
657 anything else supported by our resizer, but let's talk about that later.
658 </p>
659
660 <pre caption="Filesystem information">
661 # <i>mount</i>
662 /dev/hdb2 on / type ext3 (rw)
663 none on /proc type proc (rw)
664 none on /dev/pts type devpts (rw,gid=5,mode=620)
665 none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec)
666 # <i>df -h </i>
667 Filesystem Size Used Avail Use% Mounted on
668 /dev/hdb2 4.0G 1.9G 2.4G 82% /
669 none 38M 0 38M 0% /dev/shm
670 </pre>
671
672 <p>
673 As we can see, the partition mounted as <path>/</path> named
674 <path>/dev/hdb2</path> has 2.4 gigabytes free. In my case, I think I will
675 resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes
676 for Gentoo. Not bad, I could have quite some stuff installed. However, think
677 that even one gigabyte is enough for most users. So let's partition this thing!
678 </p>
679
680 </body>
681 </section>
682 <section>
683 <title>Building parted to resize partition</title>
684 <body>
685
686 <p>
687 Parted is an utility supplied by the GNU foundation, an old and respectable
688 huge project whose software you are using in this very moment. There is one
689 tool, however, that is extremely useful for us at the moment. It's called
690 parted, partition editor and we can get it from
691 <uri>http://www.gnu.org/software/parted/</uri>
692 </p>
693
694 <note>
695 There are other tools for doing resize of partitions as well, but author is
696 unsure/uninterested whether PartitionMagic(tm) or other software of the kind do
697 the job. It's the reader's job to check them out
698 </note>
699
700 <p>
701 Look up on that page the type of filesystem you want to resize and see if
702 parted can do it. If not, you're out of luck, you will have to destroy some
703 partition to make space for Gentoo, and reinstall back. Go ahead by downloading
704 the software, install it. Here we have a problem. We want to resize our Linux
705 root partition, therefore we must boot from a floppy disk a minimal linux
706 system and use previously-compiled parted copied to a diskette in order to
707 resize <path>/</path>. However, if you can unmount the partition while still
708 in Linux you are lucky, you don't need to do what follows. Just compile parted
709 and run it on an unmounted partition you chose to resize. Here's how I did it
710 for my system.
711 </p>
712
713 <impo>
714 Make sure that the operations you want to do on your partition are supported by
715 parted!
716 </impo>
717
718 <p>
719 Get the mininux boot/root disk (a 2.4-powered mini Linux distribution on a
720 floppy - free of charge) from <uri>http://mininux.free.fr/uk/</uri>, create a
721 floppy as suggested in the Documentation that accompanies the software package
722 and insert a new floppy in the drive for the next step.
723 </p>
724
725 <note>
726 Note again that Linux is synonym of "There's one more way to do it". Your
727 objective is to run parted on an unmounted partition so it can do its work. You
728 might use some other boot/root diskset other than mininux. You might not even
729 need to do this step at all, that is only umount the filesystem you want to
730 repartition in your Linux session and run parted on it.
731 </note>
732
733 <pre caption="Utility disk creation">
734 # <i>mkfs.minix /dev/fd0</i>
735 480 inodes
736 1440 blocks
737 Firstdatazone=19 (19)
738 Zonesize=1024
739 Maxsize=268966912
740 </pre>
741
742 <p>
743 We will now proceed with the build of parted. If it's not already downloaded
744 and untarred, do so now and cd into the corresponding directory. Now run the
745 following set of commands to build the utility and copy it to your floppy disk.
746 </p>
747
748 <pre caption="Building the utility floppy">
749 # <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp;
750 export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure
751 &amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i>
752 </pre>
753
754 <p>
755 Congratulations, you are ready to reboot and resize your partition. Do this
756 only after taking a quick look at the parted documentation on the GNU website.
757 The resize should take under 30 minutes for the largest hard-drives, be
758 patient. Reboot your system with the mininux boot disk (just pop it inside),
759 and once you are logged in, switch the disk in the drive with your utility disk
760 we have created above and type mount /dev/fd0 /floppy to have parted under
761 /floppy. There you go. Run parted and you will be able to resize your
762 partition. Once this lenghty process done, we are ready to have the real fun,
763 by installing Gentoo. Reboot back into your old Linux system for now. Drive you
764 wish to operate on is the drive containing the partition we want to resize. For
765 example, if we want to resize /dev/hda3, the drive is /dev/hda
766 </p>
767
768 <pre caption="Commands to run once logged into mininux system">
769 # <i>mount /dev/fd0 /floppy </i>
770 # <i>cd /floppy; ./parted [drive you wish to operate on]</i>
771 (parted) <i> print </i>
772 Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
773 Disk label type: msdos
774 Minor Start End Type Filesystem Flags
775 1 0.031 2953.125 primary ntfs
776 3 2953.125 3133.265 primary linux-swap
777 2 3133.266 5633.085 primary ext3
778 4 5633.086 9787.148 extended
779 5 5633.117 6633.210 logical
780 6 6633.242 9787.148 logical ext3
781 (parted) <i> help resize </i>
782 resize MINOR START END resize filesystem on partition MINOR
783
784 MINOR is the partition number used by Linux. On msdos disk labels, the
785 primary partitions number from 1-4, and logical partitions are 5
786 onwards.
787 START and END are in megabytes
788 (parted) <i> resize 2 3133.266 4000.000 </i>
789 </pre>
790
791 <impo>
792 Be patient! The computer is working! Just look at the hardware LED on your case
793 to see that it is really working. This should take between 2 and 30 minutes.
794 </impo>
795
796 <p>
797 Once you have resized, boot back into your old linux as described. Then go to
798 <uri link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">The Gentoo
799 Handbook: Preparing the Disks</uri> and follow the instructions. When
800 chrooting, use the following command to flush your environment:
801 </p>
802
803 <pre caption="Flushing the environment during chroot">
804 # <i>env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash</i>
805 # <i>/usr/sbin/env-update</i>
806 # <i>source /etc/profile</i>
807 </pre>
808
809 <p>
810 Enjoy!
811 </p>
812
813 </body>
814 </section>
815 </chapter>
816
817 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20