Partitioning
This guide assumes an LVM + Btrfs setup. We are not going to create SWAP on disk but are rather going to employ Zram later on.
- List disks with
fdisk -l
- Run
cfdisk /dev/nvme0n1
(it's a little bit easier to use) Make sure that/dev/nvme0n1
is actually your desired device! - Partition with the following scheme
FS Type Size Mount Point Comment vfat 1G /boot EFI System LVM (remaining) Linux LVM - Run
cfdisk /dev/sda
Make sure that/dev/sda
is actually your desired device! - Partition with the following scheme
FS Type Size Mount Point Comment LVM (all) Linux LVM - Create LVM physical volumes
pvcreate /dev/nvme0n1p2 # SSD pvcreate /dev/sda1 # HDD
- Create LVM volume group
vgcreate VOL_GROUP_NAME /dev/nvme0n1p2 /dev/sda1
- Create LVM logical volumes
lvcreate -l 100%FREE -n lv_root vg0 /dev/sda1 lvcreate --type cache-pool -n lv_cache -l 100%FREE vg0 /dev/nvme0n1p2 # Link cache devices lvconvert --type cache --cachepool vg0/lv_cache vg0/lv_root
- Create partitions
mkfs.fat -F 32 /dev/nvme0n1p1 # EFI System Partition mkfs.btrfs /dev/mapper/vg0-lv_root # Btrfs root volume
- Create Btrfs subvolumes
# First, mount root file system mount /dev/mapper/vg0-lv_root /mnt # Create subvolumes btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home btrfs subvolume create /mnt/@var_log
- Mount partitions
umount -R /mnt mount /dev/mapper/vg0-lv_root -o noatime,compress-force=zstd,space_cache=v2,subvol=@ /mnt mkdir -p /mnt/{boot,home,var/log} mount /dev/nvme0n1p1 /mnt/boot mount /dev/mapper/vg0-lv_root -o noatime,compress-force=zstd,space_cache=v2,subvol=@home /mnt/home mount /dev/mapper/vg0-lv_root -o noatime,compress-force=zstd,space_cache=v2,subvol=@var_log /mnt/var/log