User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gentoo:installation [2024/02/07 13:01] willygentoo:installation [2025/03/13 14:49] (current) – [The fast&quick Gentoo Installation checklist] willy
Line 1: Line 1:
-====== Quick & Dirty Gentoo Installation ======+====== A) Gentoo Linux Installation ======
  
-Why [[https://www.gwntoo.org|Gentoo Linux]]? Because its lightweight, gives you full control on your server and can be much more secure than others bloated Linux distributions.+Why [[https://www.gwntoo.org|Gentoo Linux]]? In short, because its lightweight, gives you full control on your server and can be much more secure than others bloated Linux distributions. More in detail.
  
-When installing Gentoo Linux you have the total freedom to choose any single piece of the systemincluding whether to install or not a Cron Daemon and even a logger daemonNo 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 uneeded.+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 runThis 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.
  
-For referencealways follow the [[https://wiki.gentoo.org/wiki/Handbook:AMD64|Gentoo Handbook]] which is the Gentoo Bible.+This is not meant to be an exustive guide, as there are plenty of good resources on the topicspecially the amazing [[https://wiki.gentoo.org/wiki/Handbook:AMD64|Gentoo Handbook]] which is the Gentoo Bible for installation. 
 + 
 +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://wiki.gentoo.org/wiki/Handbook:AMD64|Gentoo Handbook]] is very well written and also fairly easy to follow if you don't rush it. I assume you are capable of following it up until you can boot a text-only system. Installing Gentoo Linux is less difficult than you might think. The great [[https://wiki.gentoo.org/wiki/Handbook:AMD64|Gentoo Handbook]] is very well written and also fairly easy to follow if you don't rush it. I assume you are capable of following it up until you can boot a text-only system.
 +
  
 ===== The fast&quick Gentoo Installation checklist ===== ===== The fast&quick Gentoo Installation checklist =====
Line 14: Line 17:
  
 **Prerequisite**: you already know //where// (on which disk/partition) you are going to install Gentoo and which IP address you want to use for your home (internal) network. **Prerequisite**: you already know //where// (on which disk/partition) you are going to install Gentoo and which IP address you want to use for your home (internal) network.
 +
 +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:storage|Storage Setup]] page.
  
 === Get Ready for First Boot === === Get Ready for First Boot ===
Line 25: Line 32:
 Mount your root folder: Mount your root folder:
 <code bash> <code bash>
- > mount /dev/sda2 /mnt/gentoo+mount /dev/sda2 /mnt/gentoo
 </code> </code>
  
Line 32: Line 39:
 Decompress the Stage 3, be careful to specify the following options (the 'p' one is critical!): Decompress the Stage 3, be careful to specify the following options (the 'p' one is critical!):
 <code bash> <code bash>
- > cd /mnt/gentoo +cd /mnt/gentoo 
- tar xvfp stage3.blah-blah.tar.zy +tar xvfp stage3.blah-blah.tar.zy 
 </code> </code>
  
 Prepare and enter the chroot environment: Prepare and enter the chroot environment:
 <code bash> <code bash>
- > cp /etc/resolv.conf /mnt/gentoo/etc +cp /etc/resolv.conf /mnt/gentoo/etc 
- modprobe efivarfs +modprobe efivarfs 
- for i in dev dev/pts sys run proc sys/firmware/efi/efivars; do mount /$i /mnt/gentoo/$i -o bind; done +for i in dev dev/pts sys run proc sys/firmware/efi/efivars; do mount /$i /mnt/gentoo/$i -o bind; done 
- chroot /mnt/gentoo /bin/bash +chroot /mnt/gentoo /bin/bash 
- source /etc/profile+source /etc/profile
 </code> </code>
  
Line 49: Line 56:
 You also need, now, to mount the boot/efi partition in side the chroot (let's assume it's **/dev/sda1**), so something like: You also need, now, to mount the boot/efi partition in side the chroot (let's assume it's **/dev/sda1**), so something like:
 <code bash> <code bash>
-mkdir /boot +mkdir /boot 
- mount /dev/sda1 /boot+mount /dev/sda1 /boot
 </code> </code>
  
Line 60: Line 67:
 </code> </code>
  
-Configure your timezone (choose the correct one):+It's time to populate the portage tree:
 <code bash> <code bash>
- > echo "Europe/Brussels" > /etc/timezone +emerge --sync
- > emerge --config sys-libs/timezone-data+
 </code> </code>
  
-Configure your locales by editing the file **/etc/locale.gen** and running:+Configure your timezone (choose the correct one):
 <code bash> <code bash>
- locale-gen+echo "Europe/Brussels" /etc/timezone 
 +emerge --config sys-libs/timezone-data
 </code> </code>
  
-It's time to populate the portage tree:+Configure your locales by editing the file **/etc/locale.gen** and running:
 <code bash> <code bash>
- > emerge --sync+locale-gen
 </code> </code>
  
 And select your preferred profile. I would choose a plain basic profile like **default/linux/amd64/17.1** or a **selinux/hardened** one if you feel adventurous: And select your preferred profile. I would choose a plain basic profile like **default/linux/amd64/17.1** or a **selinux/hardened** one if you feel adventurous:
 <code bash> <code bash>
- > eselect profile list+eselect profile list
 </code> </code>
  
 Install and properly setup your CPU flags: Install and properly setup your CPU flags:
 <code bash> <code bash>
- > emerge -vp cpuid2cpuflags +emerge -vp cpuid2cpuflags 
- echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags+echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags
 </code> </code>
  
 Now reinstall/recompile the basic system according to your selections: Now reinstall/recompile the basic system according to your selections:
 <code bash> <code bash>
- > emerge -uv --deep --newuse @world+emerge -uv --deep --newuse @world
 </code> </code>
  
 And it's time to install some basic stuff (pick your own! there are also many choices): And it's time to install some basic stuff (pick your own! there are also many choices):
 <code bash> <code bash>
- > emerge -vp genkernel gentoo-sources pci-utils usbutils mdadm vim tmux cronie  syslog-ng bash-completion chrony dosfstools  io-scheduler-udev-rules intel-microcode + > emerge -vp genkernel gentoo-sources pciutils usbutils mdadm vim tmux cronie  syslog-ng bash-completion chrony dosfstools  io-scheduler-udev-rules intel-microcode 
 </code> </code>
 Research each one and pick yours. Research each one and pick yours.
Line 100: Line 107:
 Now it's time to build the kernel: Now it's time to build the kernel:
 <code bash> <code bash>
- > eselect kernel set 1 +eselect kernel set 1 
- genkernel --mountboot --install all+genkernel --mountboot --install all
 </code> </code>
  
 Then create a user and set root password: Then create a user and set root password:
 <code bash> <code bash>
- > passwd +passwd 
- useradd user +useradd user 
- passwd user+passwd user
 </code> </code>
  
 Setup network and ensure SSH starts by default on boot (i assume your ethernet device is called xxx, you can check in /sys/class/net): Setup network and ensure SSH starts by default on boot (i assume your ethernet device is called xxx, you can check in /sys/class/net):
 <code bash> <code bash>
- > vi /etc/conf/net +vi /etc/conf/net 
- rc-update add sshd default +rc-update add sshd default 
- ln -s /et/init.d/net.lo /etc/init.d/net.xxx +ln -s /et/init.d/net.lo /etc/init.d/net.xxx 
- rc-update add net.xxx default+rc-update add net.xxx default
 </code> </code>
  
 Last, setup boot loader (Grub2 here): Last, setup boot loader (Grub2 here):
 <code bash> <code bash>
- > +grub-install --target=x86_64-efi --efi-directory=/boot
 </code> </code>
  
Line 132: Line 139:
  
 A few more notes and suggestion that will be important in the future. A few more notes and suggestion that will be important in the future.
- 
  
 A few notes to follow: A few notes to follow:
Line 142: Line 148:
  
 ===== Specific installation finalization ===== ===== 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: 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> <code bash>
- > groupadd media+groupadd media
 </code> </code>
  
Line 153: Line 161:
 There are also a few specific tools we need to install for what comes ahead, let's do it: There are also a few specific tools we need to install for what comes ahead, let's do it:
 <code bash> <code bash>
- > emerge -v sys-fs/mdadm+emerge -v sys-fs/mdadm
 </code> </code>
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information