Gentoo Linux: Your Friendly Quick Installation Guide

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

6. Reboot

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.

Booting/Preworking

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.

Formatting/Untarring Stage

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#”

“swapon /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.

First, type


“cd /mnt/”


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


“cd /mnt/cdrom/stages/”
“ls”


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


“cd /mnt/gentoo/”


and then begin the next part.

CHROOT

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”

“env-update”


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.

Emerge Beginning

The first thing to do is:


“emerge sync”


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:


“emerge nano”


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:


“nano /etc/make.conf”


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:


“emerge development-sources”


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:


“cd /usr/src/”

“ls”

Read the directories, and look for something like “linux-2.6.#” within there. Then cd into the directory, and type:


“make menuconfig”


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.

Grub/FSTAB

Now you will need to do some hard drive configuration, with a bootloader and fstab. after emerging grub, type in:


“grub”


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:


“root (hd0,#)”

“setup (hd0)”


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:


“quit”


Then type:


“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:


“#Entry 1
title=Gentoo
root (hd0,#)
kernel (hd0,#)/boot/bzImage root=/dev/hdx#

#Entry 2
title=WinXP
root (hd0,0)
chainloader (hd0,0)+1″


And this should generally get your grub working. From there, either type:


“reboot”


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.

59 Comments

  1. 2004-04-03 11:41 pm
  2. 2004-04-03 11:43 pm
  3. 2004-04-03 11:43 pm
  4. 2004-04-03 11:45 pm
  5. 2004-04-03 11:47 pm
  6. 2004-04-03 11:48 pm
  7. 2004-04-03 11:49 pm
  8. 2004-04-03 11:52 pm
  9. 2004-04-04 12:16 am
  10. 2004-04-04 12:18 am
  11. 2004-04-04 12:49 am
  12. 2004-04-04 12:50 am
  13. 2004-04-04 12:52 am
  14. 2004-04-04 1:27 am
  15. 2004-04-04 1:33 am
  16. 2004-04-04 3:10 am
  17. 2004-04-04 3:32 am
  18. 2004-04-04 3:38 am
  19. 2004-04-04 3:51 am
  20. 2004-04-04 3:05 am
  21. 2004-04-04 4:02 am
  22. 2004-04-04 4:36 am
  23. 2004-04-04 5:11 am
  24. 2004-04-04 5:36 am
  25. 2004-04-04 5:46 am
  26. 2004-04-04 5:48 am
  27. 2004-04-04 8:08 am
  28. 2004-04-04 8:18 am
  29. 2004-04-04 9:00 am
  30. 2004-04-04 9:34 am
  31. 2004-04-04 10:03 am
  32. 2004-04-04 10:14 am
  33. 2004-04-04 11:06 am
  34. 2004-04-04 12:17 pm
  35. 2004-04-04 12:23 pm
  36. 2004-04-04 12:32 pm
  37. 2004-04-04 1:27 pm
  38. 2004-04-04 1:37 pm
  39. 2004-04-04 6:02 pm
  40. 2004-04-04 6:41 pm
  41. 2004-04-04 7:45 pm
  42. 2004-04-04 8:35 pm
  43. 2004-04-04 10:05 pm
  44. 2004-04-04 10:07 pm
  45. 2004-04-04 11:36 pm
  46. 2004-04-05 12:38 am
  47. 2004-04-05 1:04 am
  48. 2004-04-05 2:58 am
  49. 2004-04-05 4:04 am
  50. 2004-04-05 6:37 am
  51. 2004-04-05 3:16 pm
  52. 2004-04-05 9:06 pm
  53. 2004-04-05 9:08 pm
  54. 2004-04-06 11:38 am
  55. 2004-04-06 11:48 am
  56. 2004-04-06 12:04 pm
  57. 2004-04-07 4:31 am
  58. 2004-04-07 12:50 pm
  59. 2004-04-07 8:34 pm