Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gentoo:installation [2023/12/13 10:44] – sailor | gentoo:installation [2025/03/13 14:49] (current) – [The fast&quick Gentoo Installation checklist] willy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Access the PC in any way, with a linux. | + | ====== A) Gentoo Linux Installation ====== |
| - | Create a folder | + | Why [[https:// |
| - | cd /GENTOO | + | These instructions are aimed at supporting you during the installation of your home server, the one on which most, or all, your self-hosted home services will run. This same page can be referred to when installing your //external// server(s), provided they don't already come pre-installed with some other flavour of Linux. |
| - | download stage 3 (links www.gentoo.org) | + | |
| - | tar xvfp stage3.tar.zy | + | This is not meant to be an exustive guide, as there are plenty of good resources on the topic, specially the amazing [[https:// |
| - | cp / | + | When installing Gentoo Linux you have the total freedom to choose any single piece of the system, including whether to install or not a Cron Daemon and even a logger daemon. No other distro gives you so much freedom. Moreover, while you can use SystemD and NetworkManager with Gentoo, you are **not** forced to use them, and in fact specially for small servers, they might both be unneeded. |
| + | |||
| + | Installing Gentoo Linux is less difficult than you might think. The great [[https:// | ||
| + | |||
| + | |||
| + | ===== The fast& | ||
| + | |||
| + | This is **NOT** a comprehensive installation guide rather a list of quick points to keep in mind while following the already mentioned Gentoo Handbook above. | ||
| + | |||
| + | **Prerequisite**: | ||
| + | |||
| + | I will assume your home server has one drive dedicated to the Gentoo installation. Data, media, and other files will be stored on a separate RAID array of some kind. | ||
| + | |||
| + | Please do not configure that RAID array now, but read the [[gentoo: | ||
| + | |||
| + | === Get Ready for First Boot === | ||
| + | |||
| + | Burn Gentoo [[https:// | ||
| + | |||
| + | Setup internet access from your booted installation ISO. | ||
| + | |||
| + | Format your **root** partition on your PC harddrive as EXT4: i recomend EXT4 for the root partition (that' | ||
| + | |||
| + | Mount your root folder: | ||
| + | <code bash> | ||
| + | mount /dev/sda2 / | ||
| + | </ | ||
| + | |||
| + | Download the [[https:// | ||
| + | |||
| + | Decompress the Stage 3, be careful to specify the following options (the ' | ||
| + | <code bash> | ||
| + | cd / | ||
| + | tar xvfp stage3.blah-blah.tar.zy | ||
| + | </ | ||
| + | |||
| + | Prepare and enter the chroot environment: | ||
| + | <code bash> | ||
| + | cp / | ||
| modprobe efivarfs | modprobe efivarfs | ||
| + | for i in dev dev/pts sys run proc sys/ | ||
| + | chroot /mnt/gentoo /bin/bash | ||
| + | source / | ||
| + | </ | ||
| - | mount stuff: | + | You are now **inside** your brand new Gentoo Linux installation... But there is still a lot of work to be able to boot it. |
| - | for i in dev dev/pts sys run proc sys/ | + | |
| - | chroot | + | You also need, now, to mount the boot/efi partition in side the chroot |
| - | mkdir /efi | + | < |
| - | mount /dev/sda1 /efi | + | mkdir /boot |
| + | mount /dev/sda1 /boot | ||
| + | </ | ||
| + | You need now to setup // | ||
| + | |||
| + | Accept licenses, put this into < | ||
| + | < | ||
| ACCEPT_LICENSE=" | ACCEPT_LICENSE=" | ||
| + | </ | ||
| + | |||
| + | It's time to populate the portage tree: | ||
| + | <code bash> | ||
| + | emerge --sync | ||
| + | </ | ||
| + | Configure your timezone (choose the correct one): | ||
| + | <code bash> | ||
| echo " | echo " | ||
| emerge --config sys-libs/ | emerge --config sys-libs/ | ||
| - | / | + | </ |
| + | |||
| + | Configure your locales by editing the file **/ | ||
| + | <code bash> | ||
| locale-gen | locale-gen | ||
| + | </ | ||
| - | emerge --sync | + | And select your preferred profile. I would choose a plain basic profile like **default/ |
| + | <code bash> | ||
| eselect profile list | eselect profile list | ||
| + | </ | ||
| + | Install and properly setup your CPU flags: | ||
| + | <code bash> | ||
| + | emerge -vp cpuid2cpuflags | ||
| + | echo "*/* $(cpuid2cpuflags)" | ||
| + | </ | ||
| + | |||
| + | Now reinstall/ | ||
| + | <code bash> | ||
| emerge -uv --deep --newuse @world | emerge -uv --deep --newuse @world | ||
| + | </ | ||
| - | emerge -vp vim tmux cronie | + | And it's time to install some basic stuff (pick your own! there are also many choices): |
| - | emerge -vp genkernel gentoo-sources | + | <code bash> |
| + | > | ||
| + | </ | ||
| + | Research each one and pick yours. | ||
| + | Now it's time to build the kernel: | ||
| + | <code bash> | ||
| eselect kernel set 1 | eselect kernel set 1 | ||
| - | |||
| genkernel --mountboot --install all | genkernel --mountboot --install all | ||
| + | </ | ||
| + | Then create a user and set root password: | ||
| + | <code bash> | ||
| passwd | passwd | ||
| useradd user | useradd user | ||
| passwd user | passwd user | ||
| + | </ | ||
| - | edit /etC/conf/net | + | Setup network and ensure SSH starts by default on boot (i assume your ethernet device is called xxx, you can check in /sys/ |
| + | <code bash> | ||
| + | vi /etc/conf/net | ||
| rc-update add sshd default | rc-update add sshd default | ||
| - | ln -s /etC/ | + | ln -s /et/ |
| rc-update add net.xxx default | rc-update add net.xxx default | ||
| + | </ | ||
| + | |||
| + | Last, setup boot loader (Grub2 here): | ||
| + | <code bash> | ||
| + | grub-install --target=x86_64-efi --efi-directory=/ | ||
| + | </ | ||
| + | |||
| + | and then reboot. | ||
| + | |||
| + | |||
| + | === Additional settings after first boot === | ||
| + | |||
| + | Now, you are of course free to install whatever you want, even a fully fledged **Plasma Workspace**, | ||
| + | |||
| + | A few more notes and suggestion that will be important in the future. | ||
| + | |||
| + | A few notes to follow: | ||
| + | * don't bother with setting up the external data disks, you will do it later | ||
| + | * don't install any graphical user interface, you will not need it | ||
| + | * don't install SystemD as all commands are not for SystemD (or install it and adapt the commands) | ||
| + | |||
| + | Note: i don't care for SystemD. It does fix a problem i don't have and never had. It's a complication i never had a need for, and Gentoo gives me the choice to not use it. Please use it yourself if you prefer, just adapt the commands where it is involved accordingly. | ||
| + | |||
| + | ===== Specific installation finalization ===== | ||
| + | |||
| + | (not needed for the **external** server) | ||
| + | |||
| + | You will need to create a special group called **media** which will be used to allow the different tools to access the respective data folders without compromising the security of your installation and media collection: | ||
| + | |||
| + | <code bash> | ||
| + | groupadd media | ||
| + | </ | ||
| + | |||
| + | this will create a new group called **media**. You will need it later. | ||
| + | |||
| + | There are also a few specific tools we need to install for what comes ahead, let's do it: | ||
| + | <code bash> | ||
| + | emerge -v sys-fs/ | ||
| + | </ | ||
| + | |||
| + | //mdadm// are the software RAID tools. | ||
| + | |||
| + | |||
| + | Once you have Gentoo installed on your hardware, keep reading. | ||
| + | |||
| + | |||
| + | |||