User talk:Xerxeslins/Simplified Installation of Gento
This article is a summary for reference, which removes much of the information from the Handbook to meet a specific case: installing Gentoo using ext4 file system, Systemd, GRUB, GPT/UFI, no encryption, all system directories on a single partition (except for efi partition). It serves as a superficial guide and reminder of the installation process that can perhaps help you in some way. But if you want "generic" content that adapts to all situations, the best option would be to read the Handbook.
Article tested on a modest personal computer:
- AMD Ryzen 7 3700X
- 32 GB RAM SSD4
- 128 GB NVMe SSD
- GPU RADEON R5220 2 GB
Download a ISO
To get started, download the minimal Gentoo installation ISO or use another distro like SystemRescue:
The advantage of SystemRescue is that you will have a graphical environment, browser and several tools.
Burn the ISO to a USB device and boot from it.
Partitions
Create two partitions:
- 300 MB for UEFI ESP
- And the rest to the root
For that, use "gdisk".
root #
gdisk /dev/nvme0n1
Create the GPT partition table: Command: o ↵ This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): y ↵ Create partition 1 (UEFI ESP): Command: n ↵ Partition Number: 1 ↵ First sector: ↵ Last sector: +300M ↵ Hex Code: ef00 ↵ Create partition 2 (root): Command: n ↵ Partition Number: 2 ↵ First sector: ↵ Last sector: ↵ Hex Code: ↵ Write the partition table on the disk: Command: w ↵ Do you want to proceed? (Y/N): Y ↵
We will not create a swap partition. It can be created in a file later.
Format partitions:
root #
mkfs.ext4 /dev/nvme0n1p2
root #
mkfs.vfat -F 32 /dev/nvme0n1p1
Mount partitions:
root #
mkdir -p /mnt/gentoo
root #
mount /dev/nvme0n1p2 /mnt/gentoo
root #
mkdir -p /mnt/gentoo/boot/efi
root #
mount /dev/nvme0n1p1 /mnt/gentoo/boot/efi
Stage 3
To download and extract stage3 proceed with:
root #
cd /mnt/gentoo
Visit: https://www.gentoo.org/downloads/
Copy the link from Stage3: desktop profile with systemd. This article was designed for Systemd.
root #
wget -c <copied link>
If you are in text mode, you can use the browser links to download the file.
Extract with the correct permissions:
root #
tar --xattrs-include='*.*' --numeric-owner -xpf stage3*
Chroot
Now let's chroot:
root #
cd /mnt/gentoo
root #
mount --types proc /proc /mnt/gentoo/proc
root #
mount --rbind /sys /mnt/gentoo/sys
root #
mount --make-rslave /mnt/gentoo/sys
root #
mount --rbind /dev /mnt/gentoo/dev
root #
mount --make-rslave /mnt/gentoo/dev
root #
mount --bind /run /mnt/gentoo/run
root #
mount --make-slave /mnt/gentoo/run
root #
cp /etc/resolv.conf etc && chroot . /bin/bash
root #
source /etc/profile
One line:
root #
cd /mnt/gentoo; mount --types proc /proc /mnt/gentoo/proc; mount --rbind /sys /mnt/gentoo/sys; mount --make-rslave /mnt/gentoo/sys; mount --rbind /dev /mnt/gentoo/dev; mount --make-rslave /mnt/gentoo/dev; mount --bind /run /mnt/gentoo/run; mount --make-slave /mnt/gentoo/run; cp /etc/resolv.conf etc && chroot . /bin/bash; source /etc/profile
Sync and User Creation
Sync with Gentoo repository:
root #
emerge-webrsync
Create the root password and a new user.
The line below is optional and is for Gentoo to accept weak passwords.
root #
sed -i s/everyone/none/ /etc/security/passwdqc.conf
Root password:
root #
passwd
Creating your user:
root #
useradd -g users -G wheel,portage,audio,video,usb,cdrom -m <user>
root #
passwd <user>
Fstab Configuration
Check the UUID of the root partition.
root #
blkid
root #
grep nvme0n1p2
Edit fstab:
root #
nano /etc/fstab
Add the line referring to the root partition, based on the UUID. Example:
/etc/fstab
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / ext4 noatime 0 1