Misterj05

My Gentoo Install

Jul 9th, 2025 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. cfdisk, 512M Efi System, 2G Extended Boot, Rest of the space into Linux Filesystem
  2. cryptsetup luksFormat on the root partition
  3. cryptsetup open on the root partition
  4. mkfs.vfat -F32 -n EFI on the EFI partition
  5. mkfs.btrfs -L BOOT on the BOOT partition
  6. mkfs.btrfs -L ROOTFS on /dev/mapper/root
  7. Make btrfs subvols, @ @home @var @snapshots...
  8. mount the root subvol with mount subvol=@,compress=zstd /dev/mapper/root /mnt/gentoo
  9. mkdir for each of your subvols on /mnt/gentoo, for example: mkdir /mnt/gentoo/home
  10. mount the other subvols with subvol=@NAMEOFSUBVOL,compress=zstd /dev/mapper/root /mnt/gentoo/NAMEOFFOLDER
  11. cd /mnt/gentoo
  12. download stage3 with links https://www.gentoo.org/downloads
  13. install stage3 with tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner -C /mnt/gentoo
  14. Copy DNS info over to /mnt/gentoo with cp --dereference /etc/resolv.conf /mnt/gentoo/etc/
  15. arch-chroot into /mnt/gentoo
  16. mount efi partition to /efi
  17. mount boot partition to /boot
  18. emerge-webrsync
  19. emerge --sync --quiet
  20. eselect profile list (If unsure go with a desktop profile.)
  21. eselect profile set [number] (Ensure it's the newest version of profile.)
  22. add FEATURES to make.conf, set binpkg-request-signature, and if you want install to go faster set getbinpkg which makes portage prefer binaries, REMOVE GETBINPKG AFTER INSTALL (unless you want all binaries)
  23. (optional because it can take a while) configure USE in make.conf
  24. configure cpuid2cpuflags, emerge -1 cpuid2cpuflags, echo "*/* ${cpuid2cpuflags}" > /etc/portage/package.use/00cpu-flags
  25. add VIDEO_CARDS to make.conf (if nvidia add "nvidia", if amd add "amdgpu radeonsi", if intel add "intel")
  26. add ACCEPT_LICENSE="-* @FREE @BINARY-REDISTRIBUTABLE" to make.conf
  27. add GRUB_PLATFORMS="efi-64" to make.conf
  28. run getuto to setup portage keyring
  29. emerge -av cryptsetup
  30. (optional, will take a while) emerge -avuDN @world
  31. (run if above was ran) emerge --ask --depclean
  32. Setup timezone with ln -sf ../usr/share/zoneinfo/America/New_York /etc/localtime
  33. nano /etc/locale.gen (uncomment locales to use)
  34. locale-gen
  35. eselect locale list
  36. eselect locale set [number]
  37. reload the environment with source /etc/profile
  38. create /etc/portage/package.use/installkernel with grub and dracut use flags (sys-kernel/installkernel grub dracut)
  39. mkdir /etc/dracut.conf.d
  40. add this to /etc/dracut.conf.d/luks.conf, add_dracutmodules+=" crypt " and then on a newline kernel_cmdline+=" rd.luks.uuid=LUKSUUID " (the spacing inside the quotes is critical, it's how dracut works and is not a typo)
  41. enable dist-kernel use flag in make.conf to regen kernel modules on kernel update
  42. emerge installkernel and linux-firmware
  43. make sure efi and boot partitions are mounted
  44. grub-install --efi-directory=/efi
  45. emerge gentoo-kernel-bin
  46. emerge -av1 genfstab
  47. genfstab -U / > /etc/fstab
  48. echo YOURHOSTNAME > /etc/hostname
  49. emerge dhcpcd
  50. rc-update add dhcpcd default
  51. run passwd to set root password
  52. nano /etc/conf.d/hwclock and change to local for correct time in windows dual boot
  53. time to emerge the system tools
  54. emerge sysklogd (system logger)
  55. (optional) emerge cronie (if you don't need cron then you should be fine, if unsure just emerge it)
  56. (if cronie installed) rc-update add cronie default
  57. (optional, faster file indexing) emerge mlocate
  58. (optional but highly recommended, if you use a shell other than bash than this isn't needed) emerge bash-completion (for bash autocomplete when pressing tab)
  59. emerge chrony (NTP for syncing system clock)
  60. rc-update add chronyd default
  61. (if UEFI) emerge dosfstools
  62. emerge btrfs-progs
  63. (if using NTFS drives) emerge ntfs3g
  64. emerge io-scheduler-udev-rules (for correct scheduler behavior with nvme devices)
  65. (if using Wi-Fi) emerge iw or wpa_supplicant
  66. exit
  67. cd
  68. umount -R /mnt/gentoo
  69. reboot
  70. // If you don't have networking on reboot then do this
  71. run "ip a" to grab your network device, ethernet starts with enp or eth
  72. cd /etc/init.d
  73. ln -s net.lo net.YOURNETWORKINTERFACE
  74. rc-update add net.YOURNETWORKINTERFACE default
  75. reboot
  76. // End
Advertisement
Add Comment
Please, Sign In to add comment