Btrfs "No space left on device" during mkinitcpio or pacman while df shows free space
The mechanism, the btrfs filesystem usage -T / 'Device unallocated: 0.00B' tell, the reclaim-then-balance order, the staged -dusage=10/50 balance, and the snapper facts are all correct. Omarchy really does ship NUMBER_LIMIT="5" / TIMELINE_CREATE="no" in default/snapper/root, and install/config/snapper.sh at /usr/share/omarchy is the right restore command. Two defects in the commands. (1) sudo pacman -Scc --noconfirm silently does nothing: -Scc's prompt defaults to N and --noconfirm takes the default, so the user believes they emptied the cache when they did not. On a filesystem that is out of allocatable space, that is the difference between fixing it and not. (2) btrfs device add -f is presented as a casual trick with no warning that -f overwrites whatever filesystem is on that partition and that the array then depends on the stick until device remove completes.
Do NOT reboot after an ENOSPC failure until the initramfs/UKI has been regenerated successfully. A truncated image will not boot. Never balance metadata (-musage=): the upstream ENOSPC guidance is data chunks only, and metadata balances make the problem recur sooner. Do not use a ramdisk or zram device as the temporary btrfs device add target. A reboot before you remove it destroys the filesystem. Deleting snapshots is irreversible. Check what you are deleting with snapper list first. A long balance is heavy I/O and should not be interrupted by a hard power-off.
Symptom
An update dies part-way with something like:
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
bsdtar: Write error
==> ERROR: Image generation FAILED: 'zstd' reported an error
or
error: could not commit transaction
error: failed to commit transaction (No space left on device)
but df -h / says there are tens of gigabytes free. Sometimes the filesystem flips read-only mid-write and the journal shows BTRFS: error (device nvme0n1p2) ... No space left on device / BTRFS info: forced readonly. On Omarchy, omarchy update may abort earlier with a free-space warning.
Cause
Btrfs allocates disk in two stages: large chunks are reserved for DATA or METADATA, then blocks are handed out inside them. Once every byte of the device is *allocated* to chunks, a write that needs a new chunk of the other type fails with ENOSPC even though the chunks themselves are half empty. df only reports block-level free space and cannot see this. On snapshot-heavy installs (Omarchy takes a snapper snapshot on every update) old snapshots pin data into chunks that would otherwise be reclaimable, and the pacman cache does the same.
Fix
Same diagnosis, same order of operations (reclaim first, balance second, rebuild the boot image last). Replace the two broken steps.
For cache reclaim, pacman -Scc --noconfirm is a no-op, so use:
sudo paccache -rk1 # keep 1 version of installed packages (pacman-contrib)
sudo paccache -ruk0 # drop every cached package that is no longer installed
# to truly empty the cache non-interactively:
yes | sudo pacman -Scc
Adding a temporary device ERASES the partition you hand it, and the filesystem depends on it until the remove finishes:
truncate -s 0 ~/Downloads/some-big.iso # always try this first; frees blocks with no new metadata
lsblk -f /dev/sdb # confirm the target holds nothing you want
sudo btrfs device add -f /dev/sdb1 / # -f OVERWRITES any filesystem on /dev/sdb1
sudo btrfs balance start -dusage=20 /
sudo btrfs device remove /dev/sdb1 / # must finish before you unplug it or reboot
(A loop file on the same filesystem cannot help, because it needs the space it is trying to free.) If the filesystem went read-only, remount or reboot before any of this, then finish with sudo limine-mkinitcpio (Omarchy 4 / UKI) or sudo mkinitcpio -P on plain Arch, and restore the snapper policy with sudo bash -euo pipefail /usr/share/omarchy/install/config/snapper.sh if it has drifted.
Verify
sudo btrfs filesystem usage -T / shows several GiB of Device unallocated. sudo limine-mkinitcpio (or mkinitcpio -P) completes with Image generation successful and no write errors.