My install notes - what's not in the Gentoo Handbook

Gentoo installation Handbook has improved over the years and my notes have been shrinking as a result. Below is my personal Gentoo Handbook addendum, it may or may not be useful for you. This is not a tutorial, I'm merely giving you a few ideas.

For installation I boot some Linux liveCD which is known for good hardware detection. I usually have the latest SystemRescueCd on USB thumbdrive.

After booting from installation media

I install from my desktop over SSH, this way I can sit in my favorite chair, use my favorite keyboard and have the install just in one terminal window, convenient to copy and paste commands from Handbook as they come up. The computer you are installing Gentoo into may be right next to you or far away, my personal record is 5927 miles (straight line distance).

  1. Start SSH server daemon if not started already.
  2. Set root password.
  3. Take note of the IP address.
    ifconfig or ip a (remember, ifconfig prints only active interfaces if executed without -a)
  4. Move over to your favorite computer and log in, installation begins.

Partitioning, swap and bootloader

For a desktop installation I keep it simple, 100-200 MiB ESP partition for UEFI and rest is root partition. So there will be sda1 and sda2, that's all. I'll think about swap size later, it will be one or more swap file(s). Since swapping is slow and RAM is inexpensive nowadays in most cases 500 MiB swap file will do, but having swap file(s) is flexible, can be changed later if need arises. Note, not all filesystems can handle swap files, not a problem with Ext4.
I will use EFI stub kernel and I will use the UEFI firmware boot menu to choose between latest and backup kernel.
For legacy boot I use Syslinux, Grub2 is way too bloated for Gentoo, it is useful for distros which have automatic kernel upgrades, not Gentoo. As seen below my rather small (old) sda is used for boot and root, sdb is mounted as /home and formatted without partitioning (I do not partition for single filesystem).

Before chrooting

After the future root partition is mounted at /mnt/gentoo I run following commands:

First is just in case I need clues for kernel configuration.

lsmod > /mnt/gentoo/modules

Second will be certainly needed for kernel configuration.

lspci -nnk > /mnt/gentoo/lspci

Assuming sound is working with installation media this will tell you which codec chip to enable in kernel for sound.

dmesg | grep snd_hda_codec > /mnt/gentoo/sound

Below is example output of this command and kernel configuration menu enabling it.

dmesg kernel audio configuration

Before rebooting into your Gentoo

I do not emerge any software in chroot. After the base system is installed I reboot into my freshly installed Gentoo, upgrade it to ~amd64, review carefully my dmesg to make sure my kernel is on the level and only then I start emerging software. (Again, everything is done over SSH.) With one exception, my portage and distfiles are not local, I find one copy of everything per LAN is enough. My media server is running 24x7, it shares portage and distfiles for all Gentoo computers on the LAN using NFSv4. Thus, before exiting chroot and rebooting into my new Gentoo I emerge net-fs/nfs-utils, these do not come with stage3 tarball. In case your computer has no wired connection don't forget to emerge everything needed for wireless connection before reboot, including firmware.

The truth some Gentoo users do not want to hear, how to configure the kernel automatically?

Gentoo is do-it-yourself Linux. You build your Gentoo Linux from ground up the way you want, using great tools provided by Gentoo developers. All these tools are for customizing and building the userland. What about the most important part of your Gentoo, the Operating System itself? For a novice Linux user this is the hardest part. Many are willing to skip it and use some generic solution. Gentoo and the term "generic" do not go together. Configuring the kernel has historically been one of basic tasks of any *nix administrator. While decades back it was mostly enabling a feature or a driver and rebuilding the kernel it is not so any more. Nowadays there are options in the kernel which have great impact on the performance and security of your installation. Unfortunately, some of these options are mutually exclusive, there is a trade-off between security and performance. Thus, while we tune our kernel for purpose of box we also have to make some hard choices. Server, gaming rig, router, video workstation, etc., all of these need human made decisions about kernel configuration. There is no miracle automatic setup! Reading Gentoo forums I have seen a new belief spreading among newcomers - use binary kernel, it is made by professionals, it is good. No, it is not. It is made by developers who obviously have no way to know what for your Gentoo will be used, it is generic, it is not tuned for you. Loss of performance for your particular purpose may be in excess of 20%, it is much more than any optimizing of userland can offer. Indeed, practically all home computers are overpowered nowadays and an amateur user can afford such a loss. However, it is very un-Gentoo ...

That's all, folks. :-) In case you have any concerns regarding this page please contact me via PM in the Gentoo forums.

* © Jaglover 2004-2020 *