Avery's BlogHome Posts Projects Sitemap License
- Assumptions and information ............................................ [000]
- Disk partitioning ...................................................... [010]
- LUKS creation .......................................................... [011]
- LVM volume creation .................................................... [012]
- Formatting partitions .................................................. [013]
- Mounting and installation .............................................. [014]
- Following the Handbook ................................................. [020]
- Footnotes .............................................................. [999]

[000] Assumptions and information ----------------------------------------------
Everything here will assume you are using the Gentoo minimal install disk, but
the live GUI is also fine. Other install media may require slightly different
commands, or installing some packages beforehand. Only UEFI systems are covered
here, but you should be able to use any bootloader of your choosing with minor
tweaks. Your installation disk should have no partitions on it, or you should
already know how to dual boot.

[010] Disk partitioning --------------------------------------------------------
As far as I'm aware, having your rootfs (/) on thin LVM is not supported, so
we'll be making a small thick LVM volume. We're going to use cfdisk to
create the partitions. First identify what disk you want to install to with
lsblk, dmesg, or some combination of the two. Then run
cfdisk /dev/yourdisk. You can navigate the menus with the arrow keys and
enter. Changes are not saved until you select the "Save" option in the bottom
menu. When free space is selected, you will create a "New" partition. When a
partition is selected, you can "Delete", "Resize", or change the "Type".
An ESP (EFI System Partition{000}) is required for UEFI systems. This is where
the kernel, initramfs, and potentially bootloader files will be stored. 1GiB is
a good size, although it can reasonably be made as small as 200MiB if you are
really short on space.
The rest of the free space will be allocated to a single root partition of the
default type.
Now "Write" the partition table.

[011] LUKS creation ------------------------------------------------------------
The keyfile should be created from a cryptographically secure randomness source.
You probably want this stored on a removable USB drive. Unfortunately you can't
use an unformatted partition, but you can make a small (~10MiB) partition and
FAT format it. Do this with cfdisk again. For now we'll leave the keyfile in
the current directory. Create the keyfile now.
dd if=/dev/urandom of=gentoo.luks bs=1M count=8
Create the LUKS container: cryptsetup luksFormat /dev/root_part gentoo.luks.
To add an optional password: cryptsetup luksAddKey /dev/root_part.
Open the LUKS container:
cryptsetup --key-file gentoo.luks /dev/root_part root

[012] LVM volume creation ------------------------------------------------------
# create physical volume
pvcreate /dev/mapper/root
# create a volume group 'vg0'
vgcreate vg0 /dev/mapper/root
# create a thick volume, 20GiB, name 'lv0' in 'vg0'
lvcreate -L 20G lv0 vg0
# create a thin pool 'tp0' for the rest of the volume in 'vg0'
lvcreate --type thin-pool -l 100%FREE vg0/tp0

# now create thin volumes for all of the mountpoints you need. '/usr' should at
# least be created, since that is where all built files go. '/var/tmp' is where
# compilation happens, so that should be large too.
lvcreate -V 80G -n tv0-usr vg0/tp0
lvcreate -V 120G -n tv1-usr-local vg0/tp0
lvcreate -V 120G -n tv2-usr-src vg0/tp0
lvcreate -V 80G -n tv3-var-cache vg0/tp0
lvcreate -V 30G -n tv4-var-cache-binpkgs vg0/tp0
lvcreate -V 10G -n tv5-var-db-repos vg0/tp0
lvcreate -V 100G -n tv6-var-tmp vg0/tp0
lvcreate -V 300G -n tv7-home vg0/tp0
lvcreate -V 80G -n tv8-opt vg0/tp0
lvcreate -V 20G -n tv9-root vg0/tp0
# swap should be double your RAM, so replace 64 with that. There's not really a
# reason to put it on a thin volume, it's just here to keep things in line with
# every other partition
lvcreate -V 64G -n tv10-swap vg0/tp0
[013] Formatting partitions ----------------------------------------------------
# ESP should be FAT32/VFAT
mkfs.vfat /dev/esp_part
# XFS is a very stable filesystem, so we use it on the others
for N in $(seq 0 9); do
  mkfs.xfs /dev/vg0/tv${N}-*
done
# Swap now
mkswap /dev/vg0/tv10-swap
[014] Mounting and installation ------------------------------------------------
# -m creates the mountpoint if it doesn't exist
mount /dev/vg0/lv0 /mnt
mount -m /dev/esp_part /mnt/boot
mount -m /dev/vg0/tv0-usr /mnt/usr
mount -m /dev/vg0/tv1-usr-local /mnt/usr/local
mount -m /dev/vg0/tv2-usr-src /mnt/usr/src
mount -m /dev/vg0/tv3-var-cache /mnt/var/cache
mount -m /dev/vg0/tv4-var-cache-binpkgs /mnt/var/cache/binpkgs
mount -m /dev/vg0/tv5-var-db-repos /mnt/var/db/repos
mount -m /dev/vg0/tv6-var-tmp /mnt/var/tmp
mount -m /dev/vg0/tv7-home /mnt/home
mount -m /dev/vg0/tv8-opt /mnt/opt
mount -m /dev/vg0/tv9-root /mnt/root
swapon /dev/vg0/tv10-swap
[020] Following the Handbook --------------------------------------------------- Now you can continue the installation at #/wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage#Choosing_a_stage_file [999] Footnotes ---------------------------------------------------------------- - {000} EFI System Partition The partition which contains bootable EFI programs, and, optionally files they may need. #/en.wikipedia.org/wiki/EFI_system_partition Written on 31/01/2026 19:00 UTC-6
Anything But Chrome 88x31<HTML> Learn it today!Piracy Now! 88x31powered by estrogen 88x31 spinning estrogen pillmade with MY OWN TWO PAWS 88x31Made with uEMACS (Micro Emacs) 88x31uBlock Origin Now! 88x31Privacy Now! PGP 88x31TRANS RIGHTS NOW! 88x31Xenia Linux NOW! 88x31I need a nap Now! 88x31highly compressed bad apple 88x31Discord Messenger 88x31Choose Mozilla 88x31Monero Now! 88x31you're telling me a queer coded this 88x31