/[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.76 - (hide annotations) (download) (as text)
Wed Sep 10 23:04:29 2008 UTC (5 years, 11 months ago) by nightmorph
Branch: MAIN
Changes since 1.75: +16 -14 lines
File MIME type: application/xml
patch from bug 232410

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

  ViewVC Help
Powered by ViewVC 1.1.20