/[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.75 - (hide annotations) (download) (as text)
Fri May 23 20:29:44 2008 UTC (6 years, 1 month ago) by swift
Branch: MAIN
Changes since 1.74: +62 -59 lines
File MIME type: application/xml
Coding style

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

  ViewVC Help
Powered by ViewVC 1.1.20