Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gentoo:installation [2023/12/15 07:39] – sailor | 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 |
- | ===== Boot on Linux ===== | + | 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 // |
- | Access | + | This is not meant to be an exustive guide, as there are plenty of good resources on the topic, specially the amazing |
- | * Existing Linux distribution (mostly anyone will do) | + | |
- | * Burn Gentoo [[https:// | + | |
- | Once inside, you will need to be root for all the subsequent steps. | + | 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 |
- | Create | + | 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> | <code bash> | ||
- | > mkdir /mnt/gentoo | + | mount / |
</ | </ | ||
- | Download Gentoo Stage 3 tarball | + | Download |
- | * From Gentoo boot ISO, you can use <b>links</b> from text mode. | + | |
- | * You will need to setup network, if not available. See the handbook above. | + | Decompress the Stage 3, be careful to specify |
<code bash> | <code bash> | ||
- | > | + | cd / |
- | > | + | tar xvfp stage3.blah-blah.tar.zy |
- | > | + | |
</ | </ | ||
- | Prepare the chroot environment: | + | Prepare |
<code bash> | <code bash> | ||
- | > | + | cp / |
- | > modprobe efivarfs | + | modprobe efivarfs |
- | > for i in dev dev/pts sys run proc sys/ | + | for i in dev dev/pts sys run proc sys/ |
- | > chroot /mnt/gentoo /bin/bash | + | chroot /mnt/gentoo /bin/bash |
- | > mkdir /boot | + | source / |
- | > mount /dev/sda1 /boot | + | </code> |
- | </ | + | |
+ | 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 (let's assume it's **/ | ||
+ | <code bash> | ||
+ | mkdir /boot | ||
+ | mount /dev/sda1 /boot | ||
+ | </ | ||
+ | |||
+ | You need now to setup // | ||
Accept licenses, put this into < | Accept licenses, put this into < | ||
Line 40: | 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/ | ||
- | /etc/ | + | </code> |
- | locale-gen | + | |
- | emerge | + | Configure your locales by editing the file **/ |
+ | <code bash> | ||
+ | locale-gen | ||
+ | </ | ||
+ | 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://wiki.gentoo.org/wiki/Docker|Gentoo Docker]] | + | === 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 | ||
+ | </code> | ||
+ | |||
+ | 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 | ||
+ | </code> | ||
+ | |||
+ | //mdadm// are the software RAID tools. | ||
- | emerge --ask --verbose app-containers/ | ||
+ | Once you have Gentoo installed on your hardware, keep reading. | ||
+ | |||