Doug Swain takes a look at the Gentoo Linux installation and offers a quicker guide than the available online documentation of the distro.
Any Gentoo user knows how great this distro is. Any Gentoo user also knows the amount of time it takes to install this distro, and to damage your partition is just not an affordable option. I’ve managed to take the standard 20-30 hour installation and bring it down to about 2-3 hours of time. This guide will try and lead you into the correct direction of the Gentoo installation. It will NOT give you all the apps, Window Managers and so on you are looking for in the distro, but it will get you to the point where it will be very easy to have an operating computer while getting those things.
In general, this guide will do several things for you:
1. Format your installation partitions
2. Get your stage unpacked, and lead you through a general stage3 installation (possibly stage2, I always just used stage3)
3. CHROOT your enviorment
4. Install: sysklogd, xfree, icewm, grub, kernel (2.6.4), nano, gdm
5. Help configure grub for booting
7. Boot into Gentoo
8. Configure X
9. Add GDM (graphical login) to startup
10. Set a root password
Not too bad for 2-3 hours huh? A few things I am assuming though:
1. You know how to handel internet configuration yourself (and to check)
2. You have partitioned preinstallation, and have no data that may be potentially lossed (I won’t be responcible for that)
3. You have a general idea of the command line.
4. You actually went to www.gentoo.org read some stuff, learned what stages are, and found a working bootable cd
5. Can follow instructions fairly well, and had some Linux expirence.
Now that that’s all cleared up, lets start.
Alright, just in case it wasn’t clear enough before, make sure you have partitioned, or know how to within the installation
and format the partitions if you want beforehand. Also, make sure you know which stage you want to do (I’m assuming 3.)
Put your cd into the drive, and hit enter so you boot into the enviorment. Now, we can start the work.
Next, we are going to format the partition of installation choice. This is where things can get a bit tricky. Command wise:
pretty simple, but knowing the drive you want to format can be confusing. Here’s what I would do to identify them:
First, type in fdisk /dev/hda then from there hit p. That will list the hard drives on your first hard disk (assuming that your hard disk is hda)
My setup is usually like this:
1. hda1 (windows partition)
2. hda5 (1st Linux Part)
3. hda6 (2nd Linux Part)
4. hda7 (swap partition)
I install Gentoo onto hda5. So go ahead and hit q and leave fdisk. Now, there are a few commands you can use for different types of partitions.
my choice usually is reiserfs, so I’ll list ext3 and reiserfs for you:
1. Reiserfs= “mkreiserfs /dev/hdx#”
2. EXT3- “mke2fs -j /dev/hdx#”
3. SWAP- “mkswap /dev/hdx#”
The quoted are the commands to format the partitions. to verify: the X in hdx# is a variable, replace it with whichever letter your partition is.
the same goes for the number sign, enter the number of the partition onto there.
After this, you need to mount the installation partition into a folder. I follow the default directory /mnt/gentoo and I’ve never tried anything else.
If you wish, attempt another directory, otherwise, continue reading.
and then type
“mount /dev/hdx# gentoo”
What this does is mounts your partition you formatted into the folder within the directory of /mnt so it can be accessed. Once that is done, you type
This lists the files located on the CD-ROM of stages on the Live-CD. From there, you type
“tar -xvjpf stage#-more-text-bignumber.tar.bz2 /mnt/gentoo/”
this unpacks your stage onto the mounted partition which will take a few minutes.
Once that has finished, type in
and then begin the next part.
Now that you have untarred all the files you needed onto the primary install part, we now want to switch your
root directory to the install directory, or /mnt/gentoo. To do this, simply enter
“chroot /mnt/gentoo /bin/bash”
And you’ve now finished the chroot of things.
Now you’ve done pretty good for yourself. From here, it is a major matter of time, lots of emerging, and some config changes.
The first thing to do is:
What this does is updates all the files for your tarball assuring they are all up to date. Releases are common, so emerge sync should be done for every install.
Next, I recommend typing:
Nano is a simple text editor, which I prefer over things like VI, as it is easier to operate. Once you have merged nano, type in:
This will open up the make.conf file. In this file, it allows you to modify the CFlags, and compiling options for emerge. CFlags help optimise the source to your cpu standards, making it faster than other stock code.
For help on CFLAGS, check out this website for your cpu. I also recommend modifying the USE flags under make.conf, as they will also help build the code better for your
computer. For information on USE Flags, look here for the entries you can use.
After this, we need to emerge the kernel for the system. I prefer using the 2.6.x kernel as of now, so I use:
Which in turn downloads the kernel and then installs it to /usr/src/linux-2.6.4 it should be. So from there you do:
Read the directories, and look for something like “linux-2.6.#” within there. Then cd into the directory, and type:
Follow the configuration tool, and save your editing. From there do the standard kernel compiling things, such as make modules, make modules install, make bzImage, and so on. Then copy System.map and bzImage to /boot for later.
Emerge Some More!
Once you have completed that, you should begin emerging packages. The packages I would emerge would be as followed:
XFREE, IceWM, sysklogd, dcron, grub
Those should get you off the ground and moving. Also, emerge any additional packages that you know nessisary to have to get started. This is all I need, and you shouldn’t need much more.
Now you will need to do some hard drive configuration, with a bootloader and fstab. after emerging grub, type in:
Which runs the grub console. First, you need to set a root directory. The root directory will be your Gentoo installation, and it will look for the configuration files here. To do this, you type:
Now this setup will first say the root is located on the Gentoo installation partition. As for setup (hd0) this will tell it to install into the MBR so if you have an alternative configuration, modify it accordingly. Check the offical Gentoo Docs for help also if needbe.
Bare in mind also that in grub, all the disks are set back one, as 0 qualifies as a disk. So, if you want it installed to the mbr, you must have zero on there, and if the Gentoo partition is say hda5, make it hda4 instead.
After this, you type in:
“nano -w /boot/grub/grub.conf”
This will create a new grub configuration file for it to follow. Though it is an annoyance to do yourself, it is not very difficult. First, you set your timeout, which I set to 30 (30 seconds that means). The default I leave to 0 (zero).
Now if you’re like me, you’re also dualbooting another Linux/BSD/Windows installation, so you’ll probably want to setup these in the config too. For this example, I leave it easy with the Gentoo and the Windows entries. Mine looks something like this:
kernel (hd0,#)/boot/bzImage root=/dev/hdx#
And this should generally get your grub working. From there, either type:
Otherwise just hit the reboot button on the case. From there, if all went over well, you should see grub popup with your entries in it. Check both to make sure they’re working correctly.
Assuming they are, you can boot into Gentoo, and begin working! Make sure that X has a configuration file, and everything is working. Don’t forget, since you emerged gdm, you should be able to run it (with a proper XF86Config) and login to IceWM right away.
Thanks for taking a look at my guide. If you need any help, feel free to email me for help.