The following is my notes while reading and the changes I made to the subsequent installation to fit into a Manjaro system installation.
NOTE: Before you dive into btrfs - be sure to read the entire article - including the documentation linked at the end of this document.
You can boot from any Manjaro ISO - open a terminal - and follow this guide.
For a similar guide without LUKS read here
Assuming you know how to identify your disk devices and can replace the example device name /dev/sdy with the device for your system.
All commands written is assuming your are logged in as root. On Manjaro ISOs the root login is root:manjaro
Connect to your network and ensure your system clock is correct
# systemctl start systemd-timesyncd
Set a preferred mirror and branch then download databases
# pacman-mirrors -aU https://manjaro.moson.eu -Sunstable
# pacman -Syy
Clear the disk of any existing file systems using random pattern - as the partition will be encrypted this will disguise the partitions and data held on it. It will take some time to complete - hours if you are having a big storage device.
# dd if=/dev/urandom of=/dev/sdy status=progress bs=10M
Use cdisk to create the boot partition and the main partition which will be encrypted
# cfdisk /dev/sdy
Set up the encryption container
# cryptsetup luksFormat /dev/sdy2
Are you sure? YES
Enter passphrase (twice)
# cryptsetup open /dev/sdy2 luks
Format to FAT32 for the boot and btrfs for the root
# mkfs.vfat -F32 /dev/sdy1
# mkfs.btrfs /dev/mapper/luks
The author of the original guide has some reasonable suggestions which also matches the defaults used by Manjaro Architect.
# mount /dev/mapper/luks /mnt
# btrfs subvolume create /mnt/@
# btrfs subvolume create /mnt/@home
# btrfs subvolume create /mnt/@var
# umount /mnt
# mount -o subvol=@,ssd,compress=zstd,noatime,nodiratime /dev/mapper/luks /mnt
# mkdir /mnt/{boot,home,var}
# mount -o subvol=@home,ssd,compress=zstd,noatime,nodiratime /dev/mapper/luks /mnt/home
# mount -o subvol=@var,ssd,compress=zstd,noatime,nodiratime /dev/mapper/luks /mnt/var
# mount /dev/sdy1 /mnt/boot
# basestrap /mnt base btrfs-progs sudo manjaro-zsh-config intel-ucode networkmanager linux54 nano vim systemd-boot-manager mkinitcpio
Generate fstab and verify the content
# fstabgen -U /mnt >> /mnt/etc/fstab
# cat /mnt/etc/fstab
# manjaro-chroot /mnt /bin/zsh
# echo manjaro > /etc/hostname
# nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 manjaro.localdomain manjaro
# chsh -s /bin/zsh
Example for Denmark
# ln -sf /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime
# hwclock --systohc
Enable network connection
# systemctl enable NetworkManager
# systemctl enable systemd-timesyncd
Locale example for Danish locale
Save file and generate the messages
# nano /etc/locale.gen
# locale-gen
Locale.conf example for Denmark
# echo LANG=en_DK.UTF-8 > /etc/locale.conf
# passwd
Add btrfs and encrypt and save
# nano /etc/mkinitcpio.conf
HOOKS="base udev btrfs encrypt autodetect modconf block filesystems keyboard fsck"
# mkinitcpio -p linux54
Install the boot loader
# bootctl --path=/boot install
# sdboot-manage gen
/boot/loader/entries
and check the configurations sdboot-manage has created (there will be two).information_source: If you create the entries by hand please note
title Manjaro Linux 5.4
linux /vmlinuz-5.4-x86_64
initrd /intel-ucode.img
initrd /initramfs-5.4-x86_64.img
options root=UUID=289ae676-7cbc-43a7-b4b7-e9cf325227c9 rw rootflags=subvol=/@ cryptdevice=UUID=9d336c58-0e8f-434d-b12a-b75663c4ad59
title Manjaro Linux 5.4
linux /vmlinuz-5.4-x86_64
initrd /intel-ucode.img
initrd /initramfs-5.4-x86_64-fallback.img
options root=UUID=289ae676-7cbc-43a7-b4b7-e9cf325227c9 rw rootflags=subvol=/@ cryptdevice=UUID=9d336c58-0e8f-434d-b12a-b75663c4ad59:luks
# exit
# umount -R /mnt
# reboot
You should have a fully functioning Manjaro system. What comes next is your personal preferences. The example is a very basic vanilla Gnome desktop.
# pacman -Syu xorg-server xorg-server-common xorg-xinit xorg-drivers accountsservice gnome-keyring gnome-session gnome-shell gnome-desktop gnome-terminal gdm
# useradd -mUG lp,network,power,sys,wheel -s /bin/zsh newuser
# passwd newuser
Add user to wheel group
# visudo
%wheel ALL=(ALL) ALL
# systemctl enable gdm
# reboot
If something went wrong and you need to get back in from the live image:
# cryptsetup open /dev/sdy2 luks
# mount -o subvol=@,ssd /dev/mapper/luks /mnt
# mount -o subvol=@home,ssd /dev/mapper/luks /mnt/home
# mount -o subvol=@var,ssd /dev/mapper/luks /mnt/var
# mount /dev/sdy1 /mnt/boot
# manjaro-chroot /mnt /bin/zsh
Credits in original source