Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gentoo:installation [2024/02/01 15:36] – willy | gentoo:installation [2025/03/13 14:49] (current) – [The fast&quick Gentoo Installation checklist] willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | For reference, always follow: | + | Why [[https://www.gwntoo.org|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 // | ||
+ | This is not meant to be an exustive guide, as there are plenty of good resources on the topic, specially the amazing [[https:// | ||
- | Why Gentoo Linux? Because its lightweight, gives you full control on your server and can be much more secure than others bloated Linux distributions. | + | When installing |
- | Installing | + | Installing Gentoo Linux is less difficult than you might think. The great [[https:// |
- | 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 | + | ===== The fast& |
- | ===== Specific | + | This is **NOT** a comprehensive |
- | You will need to create a special group called | + | **Prerequisite**: you already know //where// (on which disk/ |
- | <code bash> | + | 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. |
- | > groupadd | + | |
- | </ | + | |
- | this will create a new group called **media**. You will need it later. | + | Please do not configure that RAID array now, but read the [[gentoo: |
- | There are also a few specific tools we need to install | + | === Get Ready for First Boot === |
- | <code bash> | + | |
- | > emerge -v sys-fs/ | + | |
- | </ | + | |
- | //mdadm// are the software RAID tools. | + | Burn Gentoo [[https://www.gentoo.org/downloads/|installation ISO]] to a CD or a [[https:// |
+ | Setup internet access from your booted installation ISO. | ||
- | Once you have Gentoo installed | + | Format your **root** partition |
- | + | ||
+ | Mount your root folder: | ||
+ | <code bash> | ||
+ | mount /dev/sda2 /mnt/gentoo | ||
+ | </ | ||
+ | Download the [[https:// | ||
- | ===== Boot on Linux ===== | + | Decompress |
- | + | ||
- | Access | + | |
- | * Existing Linux distribution | + | |
- | * Burn Gentoo [[https:// | + | |
- | + | ||
- | Once inside, you will need to be root for all the subsequent steps. | + | |
- | + | ||
- | Create a folder /mnt/gentoo: | + | |
<code bash> | <code bash> | ||
- | > mkdir /mnt/gentoo | + | cd /mnt/gentoo |
+ | tar xvfp stage3.blah-blah.tar.zy | ||
</ | </ | ||
- | Download Gentoo Stage 3 tarball from same link as installation ISO, then decompress it: | + | Prepare and enter the chroot environment: |
- | * From Gentoo boot ISO, you can use < | + | |
- | * You will need to setup network, if not available. See the handbook above. | + | |
<code bash> | <code bash> | ||
- | > cd / | + | cp / |
- | > | + | modprobe efivarfs |
- | > tar xvfp stage3.blah-blah.tar.zy <-- note that the " | + | for i in dev dev/pts sys run proc sys/ |
+ | chroot /mnt/gentoo /bin/bash | ||
+ | source / | ||
</ | </ | ||
- | Prepare | + | You are now **inside** your brand new Gentoo Linux installation... But there is still a lot of work to be able to boot it. |
+ | |||
+ | You also need, now, to mount the boot/efi partition in side the chroot | ||
<code bash> | <code bash> | ||
- | > cp / | + | mkdir /boot |
- | > modprobe efivarfs | + | mount /dev/sda1 /boot |
- | > for i in dev dev/pts sys run proc sys/ | + | </ |
- | > chroot /mnt/gentoo /bin/bash | + | |
- | > | + | You need now to setup // |
- | > mount /dev/sda1 /boot | + | |
- | </ | + | |
Accept licenses, put this into < | Accept licenses, put this into < | ||
Line 77: | Line 67: | ||
</ | </ | ||
+ | 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 pci-utils usbutils mdadm | + | <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. | ||
- | ====== Docker ====== | ||
- | Refer to: [[https:// | + | === Additional settings after first boot === |
- | emerge --ask --verbose app-containers/ | + | 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. | ||
- | rc-update add docker default | + | A few notes to follow: |
- | rc-service docker start | + | * 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) | ||
- | user $sudo sysctl net.ipv4.ip_forward=1 | + | 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. | ||
+ | |||
- | A more permanent change can be made with: | ||
- | FILE / | ||
- | net.ipv4.ip_forward=1 | ||
- | docker run --rm hello-world | ||