Manjaro
Some installation notes for my Manjaro setups.
Grub Settings
I like my Grub menu. So I want it enabled. Beneath that, I want to see what the kernel is doing during startup. So use the following settings:
- Add or change
GRUB_TIMEOUT_STYLE=menuin/etc/default/grub - Reduce
GRUB_TIMEOUTto something like 2 seconds. - Remove
quietfrom theGRUB_CMDLINE_LINUX_DEFAULT - Run
sudo update-grub
Encrypted Swap
Encrypted SWAP doesn't work well together with suspend to disk. So disable suspend to disk:
- Remove
resumeandopenswapfrom/etc/mkinitcpio.conf - Remove
resume=...from the kernel command line in/etc/default/grub - Run
update-grubandmkinitcpio -P
Applications
Via Pamac GUI:
- Enable automatic updates including automatic download and update when turning off.
- Set automatic update to once a day.
- Use mirrors from Germany.
- Enable removing of unnecessary dependencies.
- Enable AUR. Keep Packets. Search for Updates. Necessary for a few applications.
Some applications, that I install every time:
pamac install \
chromium \
difftastic \
diffutils \
element-desktop \
epson-inkjet-printer-escpr2 \
evince \
firefox-i18n-de \
firewall-applet
firewall-config \
firewalld \
freecad \
gimp \
git \
hibiscus \
htop \
hunspell-de \
hyphen-de \
inkscape \
inotify-tools \
keepassxc \
languagetool \
lsof \
meld \
mpv \
neovim \
nextcloud-client \
nmap \
onboard \
openscad \
qcad \
signal-desktop \
sshfs \
syncthing \
syncthingtray-qt6 \
tcpdump \
thunderbird \
thunderbird-i18n-de \
tmux \
tree \
ttf-opensans \
uv \
vim-spell-de \
vim-spell-en \
vlc \
vlc-plugin-all \
yakuake \
yt-dlp
Network services
- Enable firewall
systemctl enable firewalld.service - Enable ssh:
PasswordAuthentication noin/etc/sshd_configsystemctl enable sshd.service
Udev
I want to mount my drives in /media, so that they can be easily typed in a console. For that create /etc/udev/rules.d/99-cm-mount-in-media.rules:
# Mount filesystems in /media
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"
Beneath that, I often want to use dd on a USB stick. To make that simpler from
a user perspective, I allow writing as a user. That has the positive side
effect, that I can't accidentally wipe my internal disk:
# Allow user access to USB storage
SUBSYSTEMS=="usb", DRIVERS=="usb-storage", GROUP="usbdisk", MODE="0660"
Migrating an ext4 Installation to btrfs
I had some bad experiences with btrfs in the past. Therefore I preferred an
ext4 installation on some of my Manjaro machines. I later noted that this is a
bad choice, because if an auto update fails (and it will fail at some point), it
leaves you with a broken installation that needs manual fixes. btrfs is a good
method to avoid these situations. So I decided to migrate these machines. Tricky
part: I don't want to reinstall everything. So these are some notes what has to
be adapted on a live migration.
I always have a separate home partition. So I assume that setup here.
This is intended as a collection of notes so that I can do that multiple times
with some time in between. So it's not an entry level guide but just info for
myself. To make sure, no one copy and pastes commands without knowing anything
about them, I change the drive to /dev/sdz99. That drive should not exist on
most systems. It has to be adapted to the root partition.
- Find the right partition.
lsblk -fis useful for that. Keep that output on a separate console to find the old UUIDs! - Backup: I change the root file system. So a backup of the entire file system
is necessary. I just use
ddfor that to put an image to an external drive. - Boot a live system. I use the Manjaro installer.
- Check file system:
fsck.ext4 /dev/sdz99. Should show no errors. - Convert to btrfs:
btrfs-convert /dev/sdz99. Should finish with aConversion complete. - Mount the converted file system:
mount -t btrfs -o subvol=/ /dev/sdz99 /mnt - Adapt to standard layout that is used after a fresh installation:
- Show subvolumes with
btrfs subvolume list /mnt. Should be only theext2_saved. - Add new subvolumes
@,@logand@cache:btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@log btrfs subvolume create /mnt/@cache - Rename saved file system:
mv /mnt/ext2_saved /mnt/@ext2_saved - Move files to the new subvolumes
mv /mnt/var/cache/* /mnt/@cache mv /mnt/var/cache/.* /mnt/@cache mv /mnt/var/log/* /mnt/@log mv /mnt/var/log/.* /mnt/@log mv /mnt/[a-z]* /mnt/@ mv /mnt/.[a-z]* /mnt/@ - Make sure that only the suvolumes are left (everything starting with @):
ls -la /mnt - Set new default subvolume
btrfs subvolume set-default /mnt/@
- Show subvolumes with
- Adapt
/etc/fstab:vim /mnt/@/etc/fstab- Comment the current line for root file system. Should be something
with
/and the old UUID from the oldlsblkcall. - Add new entries (get new UUID from a new
lsblkcall):UUID=12345678-1234-1234-1234-123456789abc / btrfs subvol=/@,defaults,compress=zstd:1,relatime,discard=sync 0 0 UUID=12345678-1234-1234-1234-123456789abc /var/cache btrfs subvol=/@cache,defaults,compress=zstd:1,relatime,discard=sync 0 0 UUID=12345678-1234-1234-1234-123456789abc /var/log btrfs subvol=/@log,defaults,compress=zstd:1,relatime,discard=sync 0 0
- Comment the current line for root file system. Should be something
with
- Unmount
umount /mntand remount with all subvolumes:umount /mnt mount -t btrfs -o subvol=/@ /dev/sdz99 /mnt mount -t btrfs -o subvol=/@cache /dev/sdz99 /mnt/var/cache mount -t btrfs -o subvol=/@log /dev/sdz99 /mnt/var/log # mount other partitions like EFI here. Check in fstab what is necessary - Chroot into that directory with
manjaro-chroot /mntand do the following- Change
GRUB_SAVEDEFAULTfromtruetofalsein/etc/default/grub - Regenerate grub config with
grub-mkconfig -o /boot/grub/grub.cfg - Reinstall grub with
grub-install - Make sure that
timeshift,timeshift-autosnap-manjaroandgrub-btrfsare installed. - Enable btrfs mode with
timeshift --btrfs - Regenerate initramfs with
mkinitcpio -P - Logout from chroot
- Change
- Unmount everything:
umount -R /mnt - Cleanup new file system:
- Mount again to
/mntwithmount -t btrfs -o subvol=/ /dev/sdz99 /mnt - Delete old filesystem
btrfs subvolume delete /mnt/@ext2_saved - Defrag
btrfs filesystem defrag -v -r -f -t 32M /mnt - Balance (may need long)
btrfs balance start -m /mnt/btrfs
- Mount again to
- Unmount and reboot:
umount /mnt && reboot - Run
sudo timeshift-gtkand run theAssistantonce with default settings.
On the next pamac update, there should be a message about a BTRFS snapshot saved successfully.