EETH - Blog

Artix Refind Clear Booster - most optmized setup

· hkcfs

Arch Linux – BTW

AAA, one of the most loved (cough, cough) OS, is not minimal anymore—or so I would say if I cared about systemd and all its nonsense. But I don’t see any issue with it. Yes, you’re right that systemd is more than just an init system, and with more unused code, more bugs may arise. Still, it’s the most popular init system and has been for the last 5 years or so.

But today, we’re not going to talk about systemd or Arch. Today is optimization day, where we optimize our Linux setup. One of the Linux distros we love to use is Arch, but what if Arch was made by the suckless team? We’d get something like KISS Linux. However, for a somewhat cohesive experience, we should look at Artix Linux. You can use any init system you wish; I went with dinit as it is still the fastest, of course, after sinit and many others like tini, busybox init, toybox init, and so on.

After a clean install with your favorite filesystem, XFS, or Btrfs for some crazy people, or even F2FS, we will continue with its optimization.

FIRST: Basic Optimization

In this section, I would like to focus on another more detailed resource: ARU, the official Arch Linux guide on Improving Performance, and the official Arch Linux boot process improvements on Improving Performance/Boot Process. These are just a few examples.

For my own Intel Pentium N-series processor on a Dell system, I used the following udev rules:

/etc/udev/rules.d/60-ioschedulers.rules
# HDD
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"

# SSD
ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"

# NVMe SSD
ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"

Setup irqbalance

Next, we’ll set up irqbalance. irqbalance is a daemon that distributes hardware interrupts across CPU cores to improve performance, especially on multi-core systems.

Let’s install irqbalance either from the main repo or from the AUR

1pacman -S irqbalance

Now, just enable irqbalance, and here you go:

1sudo systemctl enable irqbalance

A zram Setup

Now for a zram setup. zram creates a compressed block device in RAM, which can be used for swap. This is faster than using a traditional swap partition or file, especially on systems with limited storage, though it uses RAM.

We will use zram-generator to setup zram thought you can use other methords like udev or zramd

Let’s install zram-generator first

1pacman -S zram-generator

Using zram-generator

zram-generator provides systemd-zram-setup@zramN.service units to automatically initialize zram devices without users needing to enable or start the template or its instances.

To use it, install zram-generator and create /etc/systemd/zram-generator.conf with the following content:

[zram0]
zram-size = min(ram / 2, 4096)
compression-algorithm = zstd

zram-size is the size (in MiB) of the zram device. You can use ram to represent the total memory.

compression-algorithm specifies the algorithm used to compress data in the zram device. Running cat /sys/block/zram0/comp_algorithm gives the available compression algorithms (as well as the current one included in brackets).

Then, run daemon-reload and start your configured systemd-zram-setup@zramN.service instance (with N matching the numerical instance-ID; in the example, it is systemd-zram-setup@zram0.service).

You can check the swap status of your configured /dev/zramN device(s) by reading the unit status of your systemd-zram-setup@zramN.service instance(s), using zramctl, or using swapon.

These are some general settings.

Let’s get into Arch. First, stop NetworkManager-wait-online.service if you don’t want to wait until your system get’s network, or you cam set up iwd instead of NetworkManager if possible.

Basics only, no extra tools considered as bloat.

Configuring pacman.conf

#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
Color
ILoveCandy
#NoProgressBar
CheckSpace
VerbosePkgLists
ParallelDownloads = 8

# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel    = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Artix Linux
# packagers with `pacman-key --populate artix`.

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#   - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# The gremlins repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[system-gremlins]
#Include = /etc/pacman.d/mirrorlist

[system]
Include = /etc/pacman.d/mirrorlist

#[world-gremlins]
#Include = /etc/pacman.d/mirrorlist

[world]
Include = /etc/pacman.d/mirrorlist

#[galaxy-gremlins]
#Include = /etc/pacman.d/mirrorlist

[galaxy]
Include = /etc/pacman.d/mirrorlist

[omniverse]
Server = https://artix.sakamoto.pl/omniverse/$arch
Server = https://eu-mirror.artixlinux.org/omniverse/$arch
Server = https://omniverse.artixlinux.org/$arch

# If you want to run 32-bit applications on your x86_64 system,
# enable the lib32 repositories as required here.

#[lib32-gremlins]
#Include = /etc/pacman.d/mirrorlist

[lib32]
Include = /etc/pacman.d/mirrorlist

# custom cf kernel repo
[repo-ck]
#Server = https://mirror.lesviallon.fr/$repo/os/$arch
Server = http://repo-ck.com/$arch

# Arch
[extra]
Include = /etc/pacman.d/mirrorlist-arch

[multilib]
Include = /etc/pacman.d/mirrorlist-arch

# enabling chaotic-aur
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist

# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

Okay, what was added? Custom repo like the official Arch repo. Some people believe it may cause issues, but after 2 years of using this system, I haven’t encountered any problems.

Here is what was added:

Color
ILoveCandy
CheckSpace
VerbosePkgLists
ParallelDownloads = 8 # very important; configure according to your network speed

Now, the makepkg.conf:

#!/hint/bash
#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
          'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#-- The package required by makepkg to download VCS sources
#  Format: 'protocol::package'
VCSCLIENTS=('bzr::breezy'
            'fossil::fossil'
            'git::git'
            'hg::mercurial'
            'svn::subversion')

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"

#-- Compiler and Linker Flags
#CPPFLAGS=""
CFLAGS="-march=native -mtune=native -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS="-flto=auto"
RUSTFLAGS="-C opt-level=2 -C target-cpu=native"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN) --quiet"
#-- Debugging flags
DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
#DEBUG_RUSTFLAGS="-C debuginfo=2"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:     Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
#  A negated option will do the opposite of the comments below.
#
#-- strip:      Strip symbols from binaries/libraries
#-- docs:       Save doc directories specified by DOC_DIRS
#-- libtool:    Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs:  Leave empty directories in packages
#-- zipman:     Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:      Remove files specified by PURGE_TARGETS
#-- debug:      Add debugging flags as specified in DEBUG_* variables
#-- lto:        Add compile flags for building with link time optimization
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)

#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(sha256)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#-- Directory to store source code in for debug packages
DBGSRCDIR="/usr/src/debug"

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/makepkglogs
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"
#-- Specify a key to use for package signing
#GPGKEY=""

#########################################################################
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(pigz -c -f -n)
COMPRESSBZ2=(pbzip2 -c -f)
COMPRESSXZ=(xz -T "$(getconf _NPROCESSORS_ONLN)" -c -z --best -)
COMPRESSZST=(zstd -c -z -q --ultra -T0 -22 -)
COMPRESSLRZ=(lrzip -9 -q)
COMPRESSLZO=(lzop -q --best)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q --best)
COMPRESSLZ=(lzip -c -f)

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
PKGEXT='.pkg.tar.zst'
SRCEXT='.src.tar.gz'

#########################################################################
# OTHER
#########################################################################
#
#-- Command used to run pacman as root, instead of trying sudo and su
#PACMAN_AUTH=()

Explanation of CFLAGS Options:

Yes, compression has been increased, and that is that, but it may significantly improve disk storage requirements.

Now, let’s talk about the filesystem. Here, I am using Btrfs, but before that, XFS was the way to go. I still remember snapshots and other things, so Btrfs is the only option for me, until bcachefs is good. Here are my custom options; no new features were added, but IDR (I DON’T REMEMBER).

Here is my fstab:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2 UUID=c386b909-59af-42d1-93a0-1d25fd117c87
LABEL=ROOT          	/         	btrfs     	rw,noatime,compress=zstd:5,nossd,space_cache=v2,autodefrag,commit=120,subvol=/artix/@	0 0

# /dev/sda2 UUID=c386b909-59af-42d1-93a0-1d25fd117c87
LABEL=ROOT          	/var      	btrfs     	rw,noatime,compress=zstd:5,nossd,space_cache=v2,autodefrag,commit=120,subvol=/artix/@var	0 0

# /dev/sda2 UUID=c386b909-59af-42d1-93a0-1d25fd117c87
LABEL=ROOT          	/home     	btrfs     	rw,noatime,compress=zstd:5,nossd,space_cache=v2,autodefrag,commit=120,subvol=/artix/@home	0 0

# /dev/sda2 UUID=c386b909-59af-42d1-93a0-1d25fd117c87
LABEL=ROOT          	/.snapshots	btrfs     	rw,noatime,compress=zstd:5,nossd,space_cache=v2,autodefrag,commit=120,subvol=/artix/@snapshots	0 0

# /dev/sda1 UUID=4089-8087
LABEL=EFIBOOT       	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 0

Explanation of Btrfs Options in fstab:

Yes, I have cleanly divided into subvolumes, and there is another subvolume named backup which is not mounted by default. It is used to make a complete snapshot of the artix subvolume. This kind of fstab with the label is inspired by Chris Titus (archtitus).

And how can I forget about Booster, an init system? If you are not sure what I am talking about, check out this Arch Linux documentation for initramfs, which not only explains it very well but also provides you with other options to test. It’s pretty good, but not as good as the Gentoo wiki, which is on another level.

Here is my booster.yaml config:

#universal: false
modules: btrfs,i915
compression: zstd
# zstd -9 -T0
#mount_timeout: 30s
#strip: true
#extra_files: fsck,fsck.btrfs #,vim,/usr/share/vim/vim82/
#vconsole: true

It is not very complex, but it works. Here, I am not using booster-um to make a custom UKI image for reasons, but the entire Booster initramfs works fine and has never caused issues like mkinitcpio or dracut in Arch Linux with the Clear Linux kernel. I am using chaotic-aur to pull the kernel. Yes, I am not a neckbeard man waiting to compile the Linux kernel on an underpowered netbook-type laptop from the 2010s. But hey, it works. I have two kernels just as a safety measure, and I think everyone should too: my main Clear Linux kernel and the linux-lts. Before you mention it, I am on an Intel setup and have used custom kernels like Liquorix and tkg, but they were never that very stable and did not improve performance that much. The same cannot be said about the Clear Linux kernel, which did improve my system performance by 10-12%. Not massive, but still noticeable.

But the kernel is not the end-all-be-all; the options passed to the kernel are just as important. Here are my custom options:

root=LABEL=ROOT rootflags=subvol=/artix/@,noatime,compress=zstd:5,nossd,space_cache=v2,autodefrag,commit=120 rw loglevel=0 console=tty2 udev.log_level=0 vt.global_cursor_default=0 mitigations=off nowatchdog msr.allow_writes=on pcie_aspm=force module.sig_unenforce intel_idle.max_cstate=1 cryptomgr.notests initcall_debug intel_iommu=igfx_off no_timer_check noreplace-smp page_alloc.shuffle=1 rcupdate.rcu_expedited=1 tsc=reliable tpm_tis.interrupts=0

Explanation of Kernel Options:

There is a controversial option, mitigations=off, which is very dangerous. For my old system, it hampers performance a lot, so I keep it disabled.

More Info on Mitigations:

Mitigations are security features introduced to protect against various CPU vulnerabilities, such as Spectre and Meltdown. Disabling mitigations can improve performance but also exposes the system to these vulnerabilities. There are two main types of mitigations:

  1. Spectre Mitigations: These protect against speculative execution side-channel attacks.
  2. Meltdown Mitigations: These protect against out-of-order execution side-channel attacks.

Disabling mitigations is generally not recommended unless you are aware of the risks and have a specific reason to do so.

How can we forget about rEFInd, a bootloader? If you want to know more about bootloaders, refer to the Gentoo article for great detail, but the Arch wiki is also great.

Though a bootloader is not important and does slow down the system, as I am not using the UKI image of the kernel, we will use a bootloader. I have installed the bootloader to /ESP/BOOT/, which is the default place where any UEFI system looks for it.

Some more miscellaneous configurations:

Changing the Journal’s Size

Systemd’s system journal’s size can go out of control. There are some things you can do to keep it in control. If you wish to, you can also completely disable this, but I like to keep some just for emergency purposes:

1journalctl --vacuum-size=10M
2journalctl --vacuum-time=2weeks

Never forget to install your CPU’s microcode.

For Intel:

1pacman -S intel-ucode

For AMD:

1pacman -S amd-ucode

For other systems, I am not aware of, but you can look around. I do not believe there are any, but do quote me on that.

It is not all about your system. If you have slow internet or badly configured mirrors, it may cause issues on your system. Change the default mirror of Artix Linux to your specific country in the /etc/pacman.d/mirrorlist, and if you are on Arch or have the Arch mirror, run this:

1iso=$(curl -4 ifconfig.co/country-iso) && reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist

Explanation of the Command:

Setup Swap in Arch Linux on /opt/swap

To set up a swap file on /opt/swap, follow these steps:

  1. Create the swap file:
1sudo fallocate -l 2G /opt/swap
  1. Set the correct permissions:
1sudo chmod 600 /opt/swap
  1. Set up the swap space:
1sudo mkswap /opt/swap
  1. Enable the swap file:
1sudo swapon /opt/swap
  1. Verify that the swap file is active:
1sudo swapon --show
  1. Make the change permanent by adding the following line to /etc/fstab:
/opt/swap none swap sw 0 0

Setup Swap in Arch Linux with Btrfs Using the Btrfs Command to Make a Swap File at /opt/swaps

To set up a swap file on /opt/swaps using Btrfs, follow these steps:

  1. Create the swap file:
1sudo btrfs filesystem mkswapfile --size 2G --uuid clear /opt/swaps
  1. Enable the swap file:
1sudo swapon /opt/swaps
  1. Verify that the swap file is active:
1sudo swapon --show
  1. Make the change permanent by adding the following line to /etc/fstab:
/opt/swaps none swap sw 0 0

For people who do not have an SSD or are not running a system from a USB flash drive, if you are, then stop using it as it may kill your USB drive faster. But what can I say? I have used a Linux install from my USB drive for 5 years, after which it failed. Your mileage may vary, but if you are using F2FS, trust me, the options in this are on another level. But if you are using a mini USB flash drive which has a very simple controller and does not have features like wear leveling, then use something else. Something like YAFFS or UBIFS is great. Just have a look at the flash file system article on Wikipedia.

But on topic, then use these options and commands in Btrfs will help you a lot:

1btrfs filesystem defragment -r -czstd /

Explanation of the Command:

Also, add this to your fstab:

autodefrag

Btrfs Scrub:

The Btrfs Wiki Glossary says that Btrfs scrub is “[a]n online file system checking tool. Reads all the data and metadata on the file system and uses checksums and the duplicate copies from RAID storage to identify and repair any corrupt data.”

Try to run this per week to check for any errors in Btrfs:

1btrfs scrub start /

Deduplication:

Not only for HDDs, but Btrfs deduplication can also be used.

Using copy-on-write, Btrfs is able to copy files or whole subvolumes without actually copying the data. However, whenever a file is altered, a new proper copy is created. Deduplication takes this a step further by actively identifying blocks of data that share common sequences and combining them into an extent with the same copy-on-write semantics.

Tools dedicated to deduplicating a Btrfs-formatted partition include duperemove and bees. One may also want to merely deduplicate data on a file-based level instead, using tools like rmlint, rdfind, jdupes, or dduper. For an overview of available features of those programs and additional information, have a look at the upstream Wiki entry.

Difference Between Bees and Duperemove:

Duperemove can store the hashes it computes in a ‘hashfile’. If given an existing hashfile, duperemove will only compute hashes for those files that have changed since the last run. Thus, you can run duperemove repeatedly on your data as it changes without having to re-checksum unchanged data.

Duperemove can also take input from the fdupes program.

See the duperemove man page for further details about running duperemove.

Deduplication:

Going by the definition in the context of filesystems, deduplication is a process of looking up identical data blocks tracked separately and creating a shared logical link while removing one of the copies of the data blocks. This leads to data space savings while increasing metadata consumption.

There are two main deduplication types:

  1. In-band (sometimes also called online): All newly written data are considered for deduplication before writing.
  2. Out-of-band (sometimes also called offline): Data for deduplication have to be actively looked for and deduplicated by the user application.

Both have their pros and cons. Btrfs implements only the out-of-band type.

Btrfs provides the basic building blocks for deduplication, allowing other tools to choose the strategy and scope of the deduplication. There are multiple tools that take different approaches to deduplication, offer additional features, or make trade-offs. The following table lists tools that are known to be up-to-date, maintained, and widely used.

NameFile BasedBlock BasedIncremental
BEESNoYesYes
duperemoveYesNoYes

File-Based Deduplication:

The tool takes a list of files and tries to find duplicates among data only from these files. This is suitable, for example, for files that originated from the same base image or source of a reflinked file. Optionally, the tool could track a database of hashes and allow deduplicating blocks from more files or use that for repeated runs and update the database incrementally.

Block-Based Deduplication:

The tool typically scans the filesystem and builds a database of file block hashes, then finds candidate files and deduplicates the ranges. The hash database is kept as an ordinary file and can be scaled according to the needs.

As the files change, the hash database may get out of sync, and the scan has to be done repeatedly.

Safety of Block Comparison:

The deduplication inside the filesystem is implemented as an ioctl that takes a source file, destination file, and the range. The blocks from both files are compared for an exact match before merging to the same range (i.e., there’s no hash-based comparison). Pages representing the extents in memory are locked prior to deduplication and prevent concurrent modification by buffered writes or mmapped writes. Blocks are compared byte by byte and not using any hash-based approach, i.e., the existing checksums are not used.

Limitations, Compatibility:

Files that are subject to deduplication must have the same status regarding COW, i.e., both regular COW files with checksums, or both NOCOW, or files that are COW but don’t have checksums (NODATASUM attribute is set).

If the deduplication is in progress on any file in the filesystem, the send operation cannot be started as it relies on the extent layout being unchanged.

General Settings in Arch Linux to Improve Performance:

  1. Enable TRIM for SSDs: Ensure that TRIM is enabled for your SSD to maintain performance. You can check if TRIM is enabled with:
1sudo fstrim -v /
  1. Optimize Swappiness: Reduce the swappiness value to make the system less aggressive in using swap space. Edit /etc/sysctl.d/99-sysctl.conf and add:
1vm.swappiness=10

Then apply the changes:

1sudo sysctl --system
  1. Use ZRAM: ZRAM can help improve performance by using compressed RAM as swap space. Install zramswap:
1sudo pacman -S zramswap

Then enable and start the zramswap service:

1sudo systemctl enable zramswap
2sudo systemctl start zramswap
  1. Optimize I/O Scheduler: Choose an appropriate I/O scheduler for your storage device. For SSDs, noop or deadline is recommended. For HDDs, cfq is a good choice. You can set the I/O scheduler with:
1echo cfq | sudo tee /sys/block/sda/queue/scheduler
  1. Enable Lazytime Mount Option: Use the lazytime mount option to reduce write operations. Edit /etc/fstab and add lazytime to the mount options for your filesystems.

  2. Optimize Kernel Parameters: Tune kernel parameters for better performance. Edit /etc/sysctl.d/99-sysctl.conf and add:

1net.core.rmem_max=16777216
2net.core.wmem_max=16777216
3net.ipv4.tcp_rmem=4096 87380 16777216
4net.ipv4.tcp_wmem=4096 16384 16777216
5net.ipv4.tcp_window_scaling=1
6net.ipv4.tcp_timestamps=1
7net.ipv4.tcp_sack=1

Then apply the changes:

1sudo sysctl --system

With some of these options, your own Artix system will be more performant—no guarantees.

These are just a few things, but for more performance information, please look at these resources:

#linux #artix #bootloader #clear #kernel #booster #initramfs #refind #optmization

Reply to this post by email ↪