Complete tutorial for installing Chimera Linux with GNOME, Btrfs on NVMe, and Hibernation (Swapfile).
-
Switch to Root:
doas -s
-
Partition the NVMe Drive:
cfdisk /dev/nvme0n1
- Label Type:
gpt - Partition 1:
1G(Type:EFI System) - Partition 2: Remaining space (Type:
Linux Filesystem) - Write and Quit.
- Label Type:
-
Format Partitions:
mkfs.vfat -F32 -n EFI /dev/nvme0n1p1 mkfs.btrfs -L chimera_root /dev/nvme0n1p2
We need a dedicated subvolume for the swapfile to ensure we can easily mount it with the nodatacow (No Copy-on-Write) option, which is mandatory for Btrfs swapfiles.
-
Mount Root to Create Subvolumes:
mount /dev/nvme0n1p2 /mnt btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home btrfs subvolume create /mnt/@swap umount /mnt
-
Mount the Target Hierarchy:
# Mount Root (@) with compression mount -o noatime,compress=zstd,subvol=@ /dev/nvme0n1p2 /media/root # Create Mount Points mkdir -p /media/root/home mkdir -p /media/root/boot/efi mkdir -p /media/root/swap # Mount Home (@home) mount -o noatime,compress=zstd,subvol=@home /dev/nvme0n1p2 /media/root/home # Mount EFI mount /dev/nvme0n1p1 /media/root/boot/efi # Mount Swap (@swap) with NoCOW # Crucial: nodatacow must be set on mount for the swapfile to work reliably mount -o nodatacow,subvol=@swap /dev/nvme0n1p2 /media/root/swap
-
Bootstrap the System:
chimera-bootstrap /media/root
-
Generate Fstab:
genfstab -U /media/root > /media/root/etc/fstab -
Enter Chroot:
chimera-chroot /media/root
Inside the chroot:
-
Update Repositories:
apk update apk upgrade --available
-
Install Base, Kernel, GNOME, and Tools:
# base-full: Standard tools # linux-lts: Kernel # gnome: Desktop Environment (includes GDM) # networkmanager: Network management (standard for GNOME) # btrfs-progs: Required for filesystem management apk add base-full linux-lts gnome networkmanager btrfs-progs
-
User Setup:
# Set Hostname echo "chimera-laptop" > /etc/hostname # Set Root Password passwd root # Create User (Add to wheel for doas) useradd -m -G wheel myuser passwd myuser
Since dinitctl doesn't work in chroot, we manually link the service files from their install location (/usr/lib/dinit.d) to the boot runlevel directory (/etc/dinit.d/boot.d).
-
Enable GDM (Display Manager):
ln -s /usr/lib/dinit.d/gdm /etc/dinit.d/boot.d/gdm
-
Enable NetworkManager:
ln -s /usr/lib/dinit.d/NetworkManager /etc/dinit.d/boot.d/NetworkManager
Note: Other standard services (like udev) are usually enabled by default via the
base-fullpackage links.
You have 32GB RAM. We will create a 34GB swapfile in the @swap subvolume.
-
Create the Swapfile:
# Create an empty file first truncate -s 0 /swap/swapfile # Set NoCOW attribute (redundant if mounted with nodatacow, but good practice) chattr +C /swap/swapfile # Allocate 34GB of space fallocate -l 34G /swap/swapfile # Set permissions chmod 600 /swap/swapfile # Format as swap mkswap /swap/swapfile # Turn it on (temporarily, to test) swapon /swap/swapfile
-
Add to Fstab: We need to ensure this mounts on boot.
echo "/swap/swapfile none swap defaults 0 0" >> /etc/fstab
-
Calculate Resume Offset (Critical): The kernel needs the physical offset of the file on the NVMe drive. Run this command:
btrfs inspect-internal map-swapfile -r /swap/swapfile
Write down the number output by this command. (e.g.,
53600)
-
Install GRUB:
apk add grub-x86_64-efi
-
Get the UUID of the Root Partition:
blkid /dev/nvme0n1p2
Copy the
UUID="..."string (not PARTUUID). -
Edit GRUB Configuration: Open the config file:
vi /etc/default/grub # or install nano with: apk add nano && nano /etc/default/grubFind
GRUB_CMDLINE_LINUX_DEFAULT. You need to addresume(the UUID of the disk) andresume_offset(the number from Phase 6).It should look like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=YOUR-COPIED-UUID resume_offset=YOUR_OFFSET_NUMBER" -
Install and Update GRUB:
# Install to EFI partition grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=CHIMERA # Generate config update-grub
-
Update Initramfs: Ensure the initramfs is aware of the changes.
update-initramfs -c -k all
-
Exit Chroot:
exit -
Unmount:
umount -R /media/root
-
Reboot:
reboot