<?xml version='1.0' encoding="UTF-8"?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/altinstall.xml,v 1.54 2005/05/03 16:59:43 neysx Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">

<guide link="/doc/en/altinstall.xml">

<title>The Gentoo Linux alternative installation method HOWTO</title>

<author title="Contributor">
  <mail link="gerrynjr@gentoo.org">Gerald Normandin Jr.</mail>
</author>
<author title="Contributor">
  <mail link="lordviram@rebelpacket.net">Travis Tilley</mail>
</author>
<author title="Contributor">
  <mail link="volontir@yahoo.com">Oleg Raisky</mail>
</author>
<author title="Contributor">
  <mail link="luminousit@hotmail.com">Alex Garbutt</mail>
</author>
<author title="Contributor">
  <mail link="alex@openvs.com">Alexandre Georges</mail>
</author>
<author title="Contributor">
  <mail link="vargen@b0d.org">Magnus Backanda</mail>
</author>
<author title="Contributor">
  <mail link="davoid@gentoo.org">Faust A. Tanasescu</mail>
</author>
<author title="Contributor">
  <mail link="aliz@gentoo.org">Daniel Ahlberg</mail>
</author>
<author title="Editor">
  <mail link="swift@gentoo.org">Sven Vermeulen</mail>
</author>
<author title="Reviewer">
  Ken Nowack <!-- antifa@gentoo.org seems out -->
</author>
<author title="Editor">
  <mail link="blubber@gentoo.org">Tiemo Kieft</mail>
</author>
<author title="Editor">
  <mail link="bennyc@gentoo.org">Benny Chuang</mail>
</author>
<author title="Editor">
  <mail link="smith.jonathan@gmail.com">Jonathan Smith</mail>
</author>


<abstract>
This HOWTO is meant to be a repository of alternative Gentoo installation
methods, for those with special installation needs such as lack of a cdrom
or a computer that can't boot cds.
</abstract>

<license/>

<version>0.60</version>
<date>2005-03-30</date>

<chapter>
<title>About this document</title>
<section>
<body>

<p>
If the standard boot-from-CD install method doesn't work for you (or you just
don't like it), help is now here. This document serves to provide a repository
of alternative Gentoo Linux installation techniques to those who need them.
Or, if you prefer, it serves as a place to put your wacky installation methods.
If you have an installation method that you yourself find useful, or you have
devised an amusing way of installing Gentoo, please don't hesitate to write
something up and post it on <uri link="http://bugs.gentoo.org">Bugzilla</uri>.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Booting the LiveCD with Smart BootManager</title>
<section>
<body>

<p>
Download Smart BootManager available from 
<uri>http://btmgr.sourceforge.net/download.html</uri>.
Linux source or binary format and windows .exe versions are available as well
as many language packs. However, at this time, the preferred method would be to
use the binary format, as the source will not compile with newer versions of
NASM.
</p>

<p>
Either compile the package from source or just grab the binary. There are
several options that can be utilized while creating your boot floppy, as seen
below.
</p>

<pre caption="Smart BootManager Options">
sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file]

   -t theme       select the theme to be used, in which the theme could be:
                    us = English theme       de = German theme 
                    hu = Hungarian theme     zh = Chinese theme 
                    ru = Russian theme       cz = Czech theme
                    es = Spanish theme       fr = French theme 
                    pt = Portuguese theme 

                 
   -d drv         set the drive that you want to install Smart BootManager on;
                  for Linux:
                    /dev/fd0 is the first floppy driver, 
                    /dev/hda is the first IDE harddisk driver.
                    /dev/sda is the first SCSI harddisk driver.
                  for DOS:
                    0   is the first floppy drive
                    128 is the first hard drive;

   -c             disable CD-ROM booting feature;

   -b backup_file backup the data that will be overwritten for
                  future uninstallation;

   -u backup_file uninstall Smart BootManager, should be used alone;

   -y             do not ask any question or warning.
</pre>

<pre caption="Using sbminst to build the boot floppy">
# <i>sbminst -t us  -d /dev/fd0</i>
</pre>

<note>
Replace fd0 with your respective floppy device name if yours is different.
</note>

<p>
Now simply place the floppy in the floppy drive of the computer you'd like to
boot the LiveCD on, as well as placing the LiveCD in the CD-ROM and boot the
computer.
</p>

<p>
You'll be greeted with the Smart BootManager dialog. Select your CD-ROM and
press ENTER to boot the LiveCD. Once booted proceed with the standard
installation instructions.
</p>

<p>
Further information on Smart BootManager may be found at
<uri>http://btmgr.sourceforge.net/</uri>
</p>

</body>
</section>
</chapter>

<chapter>
<title>Knoppix Installation</title>
<section>
<body>

<note>
Knoppix is only available for x86 users. 
</note>

<!-- this works with knoppix 3.6, 3.77 and gentoo 2004.3, 2005.0-->

<p>
Booting from the <uri link="http://www.knoppix.org/">Knoppix</uri> LiveCD is a
way to have a fully functional linux system while you're compiling Gentoo. Tux
Racer will help you pass the time while you wait for bootstrap.
</p>

<p>
Boot from the Knoppix CD. For a 2004.3+ install, you will need to specify
<c>knoppix26</c> as a boot option to load a 2.6 kernel. If you miss this step,
when you <c>chroot</c>, you will recieve an error saying that your kernel is
too old.
</p>

<p>
By default Knoppix boots into a KDE 3.3 desktop. Open a konsole and <c>su -</c>
so you can change your password. This lets you set the root password for
Knoppix. You can now configure <c>sshd</c> for remote login, at your
preference.
</p>

<pre caption="Creating the /mnt/gentoo mountpoint">
# <i>mkdir /mnt/gentoo</i>
</pre>

<p>
At this point, you can pick up with the standard install documentation at <uri
link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">part 4</uri>.
However, when you are asked to mount the proc system, issue the following
command instead:
</p>

<pre caption="Bind-mounting the proc pseudo filesystem">
# <i>mount -o bind /proc /mnt/gentoo/proc</i>
</pre>

<!-- 
  Commenting out due to #78716. If it needs to be restated again, note
  that some will require to bind-mount it, others don't, and that you have
  a 50-50 chance of winning the gold strike.
  

<p>
You will also need to bind-mount the device tree to resolve permission issues
with various device files.
</p>

< ! - -
  If this doesn't seem to work, #71901 mentions the following command:
    mount -o remount,rw,nosuid /dev/hd* /mnt/hd*
  before all. Looks weird to me, but if this doesn't work, we might want to try
  that.
- - >

<pre caption="Bind-mounting the device tree">
# <i>mount -o bind /dev /mnt/gentoo/dev</i>
</pre>
-->

</body>
</section>
</chapter>

<chapter>
<title>Installing from Stage 1 without network access</title>
<section>
<body>

<p>
Burn a LiveCD iso.
</p>

<p>
Get the latest portage snapshot from
<uri>http://distro.ibiblio.org/pub/linux/distributions/gentoo/snapshots/</uri>
(or your favorite <uri
link="http://www.gentoo.org/main/en/mirrors.xml">mirror</uri>). Either place
this tarball on an existing partition on the computer your are installing to,
or burn it to a CD.
</p>

<p>
Follow all instructions of the Gentoo Installation Handbook up to <c>chroot
/mnt/gentoo</c> in Chapter 6. If you only have one CD-ROM remember to use the
<c>docache</c> option while booting so you can unmount the LiveCD and mount
your portage snapshot CD.
</p>

<p>
Open a new console (Alt-F2), we will continue with the Install Doc up to
running the bootstrap.sh script.
</p>

<warn>
Older realeases of the livecd required you to change the password using the
<c>passwd</c> command, before logging in manually.
</warn>

<p>
Go back to the first console (Alt-F1, without chroot) and mount a second CD on
<path>/mnt/gentoo/mnt/cdrom2</path>. Copy the portage tarball from cdrom2 and
unpack it to <path>/mnt/gentoo/usr</path>.
</p>

<pre caption="Mount the snapshot cd">
# <i>umount /mnt/cdrom</i>
# <i>mkdir /mnt/gentoo/mnt/cdrom2</i>
# <i>mount /dev/cdroms/cdrom0 /mnt/gentoo/mnt/cdrom2</i>
# <i>cp /mnt/gentoo/mnt/cdrom2/portage-$date.tar.bz2 /mnt/gentoo/usr</i>
# <i>cd /mnt/gentoo/usr</i>
# <i>tar -xvjpf portage-$date.tar.bz2</i>
</pre>

<p>
Switch back to the F2 console. Now if you try to run bootstrap.sh it will fail
because it won't be able to download any files. We will fetch these files
somewhere else and put them in /usr/portage/distfiles (on F2 console).
</p>

<p>
You need a list of Stage1 packages: glibc, baselayout, texinfo, gettext, zlib,
binutils, gcc, ncurses plus their dependencies.
</p>

<note>
Note that you need the versions of each package synced with your portage tree.
</note>

<pre caption="Getting the download listing">
<comment>(Don't forget the 2 in front of the &gt;)</comment>
# <i>emerge -fp glibc baselayout texinfo gettext zlib binutils gcc ncurses 2&gt; stage1.list</i>
# <i>mount -t vfat /dev/fd0 /mnt/floppy</i>
# <i>cp /mnt/gentoo/stage1.list /mnt/floppy</i>
# <i>umount /mnt/floppy</i>
</pre>

<p>
Take the floppy to the computer that has fast access. If you take a look at the
<path>stage1.list</path> file, you'll see that it provides you with several
URLs to download. Sadly, it lists several possible URLs for each package as
well, which isn't what you want. Strip all but one of the URLs first:
</p>

<pre caption="Stripping URLs">
<comment>(This script is depending on the output format given by emerge which
 might change in the future without further notice - use with caution!)</comment>
# <i>cut -f 1 -d ' ' stage1.list > stage1.download</i>
</pre>

<p>
Now use <c>wget</c> to fetch all the listed sources:
</p>

<pre caption="Use wget to grab your source packages">
# <i>wget -N -i stage1.download</i>
</pre>

<p>
Once you have obtained all the files, take them to the computer and copy them
to <path>/mnt/gentoo/usr/portage/distfiles</path>. You will then be able to run
<c>bootstrap.sh</c>. Repeat this same wget fetch and place procedure for stage2
and 3.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Diskless install using PXE boot</title>
<section>
<title>Requirements</title>
<body>

<p>
You will need a network card on the diskless client that uses the PXE protocol
to boot, like many 3com cards. You will also need a BIOS that supports booting
from PXE.
</p>

</body>
</section>
<section>
<title>Server base setup</title>
<body>

<p>
Create directories: The first thing to do is to create the directories where
your diskless system will be stored. Create a directory called
<path>/diskless</path> which houses a directory for each diskless client. For
the rest of this howto we'll be working on the client 'eta'.
</p>

<pre caption="directory setup">
# <i>mkdir /diskless</i>
# <i>mkdir /diskless/eta</i>
# <i>mkdir /diskless/eta/boot</i>
</pre>

<p>
DHCP and TFTP setup: The client will get boot informations using DHCP and
download all the required files using TFTP. Just emerge DHCP and configure it
for your basic needs. Then, add the following on
<path>/etc/dhcp/dhcpd.conf</path>.
</p>

<note>
This provide a static IP address for the client and the path of a PXE boot
image, here pxegrub. You have to replace the MAC address of the Ethernet card
of the client and the directory where you will put the client files with the
one you use.
</note>

<p>
For DHCPd, run <c>emerge dhcp</c> (or any other DHCP server of your choice).
Make sure that the correct interface is selected in
<path>/etc/conf.d/dhcp</path>.
</p>

<pre caption="dhcp.conf">
option option-150 code 150 = text ;
ddns-update-style none ;
host eta {
hardware ethernet 00:00:00:00:00:00;
fixed-address <i>ip.add.re.ss</i>;
option option-150 "/eta/boot/grub.lst";
filename "/eta/boot/pxegrub";
}
</pre>

<p>
For TFTP, emerge <c>app-admin/tftp-hpa</c>. In
<path>/etc/conf.d/in.tftpd</path>, put the following :
</p>

<pre caption="in.tftpd">
INTFTPD_PATH="/diskless"
INTFTPD_USER="nobody"
INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"
</pre>

<p>
Setup GRUB: To provide PXE booting I use GRUB. You have to compile it by
yourself to enable the PXE image compilation ... but that's quite easy. First,
get the latest version of the GRUB source code (<c>emerge -f grub</c> will
place the tarball in <path>/usr/portage/distfiles</path>). Copy the tarball to
<path>/diskless</path> and then build it to make the pxe capable binary. Once
the binary is built, copy it to the diskless client's boot directory. Then edit
it's grub.lst config file.
</p>

<pre caption="grub setup">
# <i>tar zxvf grub-0.92.tar.gz</i>
# <i>cd grub-0.92</i>
# <i>./configure --help</i>
<comment>(In the options you will see a list of supported network interface drivers.
 Select the driver compatible with your client's network card. Herein referenced
 as $nic)</comment>
# <i>./configure --enable-diskless --enable-$nic</i>
# <i>make</i>
# <i>cd stage2</i>
# <i>cp pxegrub /diskless/eta/boot/pxegrub</i>
# <i>nano -w /diskless/eta/boot/grub.lst</i>
</pre>

<pre caption="grub.lst">
default 0
timeout 30

title=Diskless Gentoo
root (nd)
kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=<i>ip.add.re.ss</i>:/diskless/eta

<comment># For the nfsroot option, the IP address is the one of the server and
the directory is the one where your diskless client files are located (on the server).</comment>
</pre>

<p>
Setup NFS: NFS is quite easy to configure. The only thing you have to do is to
add a line on the <path>/etc/exports</path> config file :
</p>

<pre caption="/etc/exports">
# <i>nano -w /etc/exports</i>
# /etc/exports: NFS file systems being exported.  See exports(5).
/diskless/eta eta(rw,sync,no_root_squash)
</pre>

<p>
Update your hosts:  One important thing to do now is to modify your
<path>/etc/hosts</path> file to fit your needs.
</p>

<pre caption="/etc/hosts">
127.0.0.1 localhost

192.168.1.10 eta.example.com eta
192.168.1.20 sigma.example.com sigma
</pre>

</body>
</section>
<section>
<title>Creating the system on the server</title>
<body>

<p>
You might want to reboot the server with a Gentoo LiveCD, although you can 
very well continue immediately if you know how to proceed with the Gentoo 
Installation Instructions from an existing installation. Follow the standard 
install procedure as explained in the Gentoo Install Howto BUT with the 
following differences:
When you mount the file system, do the following (where hdaX is the partition 
where you created the /diskless directory). You do not need to mount any other
partitions as all of the files will reside in the <path>/diskless/eta</path>
directory.
</p>

<pre caption="mounting the filesystem">
#<i> mount /dev/hda3 /mnt/gentoo</i>
</pre>

<p>
Stage tarballs and chroot: This example uses a stage3 tarball. Mount
<path>/proc</path> to your diskless directory and chroot into it to continue
with the install. Then follow the installation manual until kernel
configuration.
</p>

<warn>
Be very careful where you extract your stage tarball. You don't want to end up
extracting over your existing installation.
</warn>

<pre caption="extracting the stage tarball">
# <i>cd /mnt/gentoo/diskless/eta/</i>
# <i>tar -xvjpf  /mnt/cdrom/gentoo/stage3-*.tar.bz2</i>
# <i>mount -t proc /proc /mnt/gentoo/diskless/eta/proc</i>
# <i>cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf</i>
# <i>chroot /mnt/gentoo/diskless/eta/ /bin/bash</i>
# <i>env-update</i>
# <i>source /etc/profile</i>
</pre>

<p>
Kernel configuration: When you do the <c>make menuconfig</c> of your kernel
configuration, don't forget to enable the following options with the others
recommended into the install howto.
</p>

<pre caption="menuconfig options">
- Your network card device support
<comment>(In the kernel, *not* as a module!)</comment>

- Under "Networking options" :

[*] TCP/IP networking
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support


- Under "File systems --> Network File Systems" :

&lt;*&gt; NFS file system support
[*] Provide NFSv3 client support
[*] Root file system on NFS
</pre>

<p>
Save the kernel in your chrooted <path>/</path> (not in <path>/boot</path>)
according to the pxegrub setting defined earlier. Next configure your 
diskless client's <path>/etc/fstab</path>.
</p>

<pre caption="/etc/fstab">
# <i>nano -w /etc/fstab</i>
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
</pre>

<p>
You also need to prevent the client to run a filesystem check:
</p>

<pre caption="Preventing the client to run a filesystem check">
# <i>touch /fastboot</i>
# <i>echo "touch /fastboot" &gt;&gt; /etc/conf.d/local.start</i>
</pre>

<p>
Install <c>nfs-utils</c> since your client will heavily depend on it:
</p>

<pre caption="Installing nfs-utils">
# <i>emerge nfs-utils</i>
</pre>

<p>
Bootloader. Don't install another bootloader because we already have one -
pxegrub. Simply finish the install and restart the server. Start the services
you'll need to boot the new client: DHCP, TFTPD, and NFS.
</p>

<pre caption="Starting services">
# <i>/etc/init.d/dhcp start</i>
# <i>/etc/init.d/in.tftpd start</i>
# <i>/etc/init.d/nfs start</i>
</pre>

</body>
</section>
<section>
<title>Booting the new client</title>
<body>

<p>
For the new client to boot properly, you'll need to configure the bios and the
network card to use PXE as the first boot method - before CD-ROM or floppy. For
help with this consult your hardware manuals or manufacturers website. The
network card should get an IP address using DHCP and download the GRUB PXE
image using TFTP. Then, you should see a nice black and white GRUB bootmenu
where you will select the kernel to boot and press Enter. If everything is ok
the kernel should boot, mount the root filesystem using NFS and provide you
with a login prompt. Enjoy.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Installing Gentoo from an existing Linux distribution</title> 
<section>
<title>Requirements</title>
<body>

<p>
In order to install Gentoo from your existing Linux distribution you need to
have chroot command installed, and have a copy of the Gentoo installation
tarball or ISO you want to install. A network connection would be preferable if
you want more than what's supplied in your tarball. (by the way, a tarball is
just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the
"host" operating system, but it is not very important.  Let's get started!
</p>

</body>
</section>
<section>
<title>Overview</title>
<body>

<p>
We will first allocate a partition to Gentoo by resizing our existing Linux
partition, mount the partition, untar the tarball that is mounted, chroot
inside the pseudo-system and start building. Once the bootstrap process is
done, we will do some final configuration on the system so as to make sure it
boots, then we are ready to reboot and use Gentoo.
</p>

</body>
</section>
<section>
<title>How should we make space for Gentoo?</title>
<body>

<p>
The root partition is the filesystem mounted under <path>/</path>. A quick run
of mount on my system shows what I am talking about. We well also use df (disk
free) to see how much space I have left and how I will be resizing. Note that
it is not mandatory to resize your root partition! You could be resizing
anything else supported by our resizer, but let's talk about that later.
</p>

<pre caption="Filesystem information">
# <i>mount</i>
/dev/hdb2 on / type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec)
# <i>df -h </i>
Filesystem           Size Used Avail Use% Mounted on 
/dev/hdb2            4.0G 1.9G  2.4G  82% /
none                  38M    0   38M   0% /dev/shm 
</pre>

<p>
As we can see, the partition mounted as <path>/</path> named
<path>/dev/hdb2</path> has 2.4 gigabytes free. In my case, I think I will
resize it as to leave 400Megs free of space, therefore allocating 2 gigabytes
for Gentoo. Not bad, I could have quite some stuff installed. However, think
that even one gigabyte is enough for most users. So let's partition this thing!
</p>

</body>
</section>
<section>
<title>Building parted to resize partition</title> 
<body>

<p>
Parted is an utility supplied by the GNU foundation, an old and respectable
huge project whose software you are using in this very moment. There is one
tool, however, that is extremely useful for us at the moment. It's called
parted, partition editor and we can get it from
<uri>http://www.gnu.org/software/parted/</uri>
</p>

<note>
There are other tools for doing resize of partitions as well, but author is
unsure/uninterested whether PartitionMagic(tm) or other software of the kind do
the job. It's the reader's job to check them out 
</note>

<p> 
Look up on that page the type of filesystem you want to resize and see if
parted can do it. If not, you're out of luck, you will have to destroy some
partition to make space for Gentoo, and reinstall back. Go ahead by downloading
the software, install it. Here we have a problem. We want to resize our Linux
root partition, therefore we must boot from a floppy disk a minimal linux
system and use previously-compiled parted copied to a diskette in order to
resize <path>/</path>.  However, if you can unmount the partition while still
in Linux you are lucky, you don't need to do what follows. Just compile parted
and run it on an unmounted partition you chose to resize. Here's how I did it
for my system.
</p>

<impo>
Make sure that the operations you want to do on your partition are supported by
parted!
</impo>

<p>
Get the mininux boot/root disk (a 2.4-powered mini Linux distribution on a
floppy - free of charge) from <uri>http://mininux.free.fr/uk/</uri>, create a
floppy as suggested in the Documentation that accompanies the software package
and insert a new floppy in the drive for the next step.
</p>

<note>
Note again that Linux is synonym of "There's one more way to do it". Your
objective is to run parted on an unmounted partition so it can do its work. You
might use some other boot/root diskset other than mininux. You might not even
need to do this step at all, that is only umount the filesystem you want to
repartition in your Linux session and run parted on it. 
</note>

<pre caption="Utility disk creation">
# <i>mkfs.minix /dev/fd0</i>
480 inodes
1440 blocks
Firstdatazone=19 (19)
Zonesize=1024
Maxsize=268966912
</pre>

<p>
We will now proceed with the build of parted. If it's not already downloaded
and untarred, do so now and cd into the corresponding directory. Now run the
following set of commands to build the utility and copy it to your floppy disk.
</p>

<pre caption="Building the utility floppy">
# <i> mkdir /floppy; mount -t minix /dev/fd0 /floppy &amp;&amp; 
export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" &amp;&amp; ./configure 
&amp;&amp; make &amp;&amp; cp parted/parted /floppy &amp;&amp; umount /floppy </i>
</pre>

<p>
Congratulations, you are ready to reboot and resize your partition. Do this
only after taking a quick look at the parted documentation on the GNU website.
The resize should take under 30 minutes for the largest hard-drives, be
patient.  Reboot your system with the mininux boot disk (just pop it inside),
and once you are logged in, switch the disk in the drive with your utility disk
we have created above and type mount /dev/fd0 /floppy to have parted under
/floppy.  There you go. Run parted and you will be able to resize your
partition. Once this lenghty process done, we are ready to have the real fun,
by installing Gentoo. Reboot back into your old Linux system for now. Drive you
wish to operate on is the drive containing the partition we want to resize. For
example, if we want to resize /dev/hda3, the drive is /dev/hda
</p>

<pre caption="Commands to run once logged into mininux system">
# <i>mount /dev/fd0 /floppy </i>
# <i>cd /floppy; ./parted [drive you wish to operate on]</i>
(parted) <i> print </i>
Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031   2953.125  primary   ntfs        
3       2953.125   3133.265  primary   linux-swap  
2       3133.266   5633.085  primary   ext3        
4       5633.086   9787.148  extended              
5       5633.117   6633.210  logical               
6       6633.242   9787.148  logical   ext3        
(parted) <i> help resize </i>
  resize MINOR START END        resize filesystem on partition MINOR

        MINOR is the partition number used by Linux.  On msdos disk labels, the
        primary partitions number from 1-4, and logical partitions are 5
        onwards.
        START and END are in megabytes
(parted) <i> resize 2 3133.266 4000.000 </i>
</pre>

<impo>
Be patient! The computer is working! Just look at the hardware LED on your case
to see that it is really working. This should take between 2 and 30 minutes.
</impo>

<p>
Once you have resized, boot back into your old linux as described. Then go to
<uri link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=4">The Gentoo
Handbook: Preparing the Disks</uri> and follow the instructions. When
chrooting, use the following command to flush your environment:
</p>

<pre caption="Flushing the environment during chroot">
# <i>env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash</i>
# <i>/usr/sbin/env-update</i>
# <i>source /etc/profile</i>
</pre>

<p>
Enjoy!
</p>

</body>
</section>
</chapter>

</guide>
