Skip to content

Commit 3a8820f

Browse files
author
linux_name2
committed
docs: add disk space checks, troubleshooting, update GC section
1 parent b9ccc43 commit 3a8820f

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ The system has two layers preventing accidental direct upgrades, controlled by a
192192
- Upgrades via `atomic-upgrade` (env var + lock verification)
193193
- Upgrades via AUR helpers (`yay`, `paru`, `pikaur`, `aura`)
194194

195-
**Pacman wrapper** (`/usr/local/bin/pacman`) — intercepts `pacman -Syu` and suggests `atomic-upgrade` instead. Detects AUR helpers to avoid double prompts. Also warns about `-Sy` without `-u` (partial upgrade risk).
195+
**Pacman wrapper** (`/usr/local/bin/pacman`) — intercepts `pacman -Syu` and suggests `atomic-upgrade` instead. Detects AUR helpers as parent processes to avoid double prompts. Also warns about `-Sy` without `-u` (partial upgrade risk).
196196

197197
Both layers check `UPGRADE_GUARD` at runtime — the change takes effect immediately, no restart or file removal needed.
198198

@@ -238,12 +238,23 @@ sudo atomic-upgrade -- bash -c '/usr/bin/pacman -Syu && sudo -u YOUR_USER yay -S
238238
> upgrade applies to the live system and is **not atomic**. The next
239239
> `atomic-upgrade` will snapshot whatever state the live system is in.
240240
241+
## Disk space checks
242+
243+
Before creating a snapshot, `atomic-upgrade` checks available disk space on both the Btrfs filesystem and the ESP:
244+
245+
- **Btrfs**: blocks only when free space is below the percentage threshold (default 10%) **and** below 2 GB absolute. On large disks where free percentage is low but tens of gigabytes are available, the operation proceeds with a warning.
246+
- **ESP**: requires at least 250 MB free (one UKI is typically 50–150 MB).
247+
248+
If disk space cannot be determined (e.g. `btrfs` and `df` both fail), a warning is shown and the operation proceeds.
249+
241250
## Garbage collection
242251

243252
`atomic-gc` and the GC phase of `atomic-upgrade` keep the last N generations (default 3) plus the currently booted one. After deleting old generations, an orphan sweep removes:
244253
- `root-*` subvolumes that have no matching UKI on the ESP
245254
- UKI files on the ESP that have no matching subvolume
246255

256+
If the ESP is not mounted during the orphan sweep phase, it is skipped with a warning — orphans will be cleaned up on the next run.
257+
247258
## Components
248259

249260
| File | Role |
@@ -258,6 +269,26 @@ sudo atomic-upgrade -- bash -c '/usr/bin/pacman -Syu && sudo -u YOUR_USER yay -S
258269
| `pacman-wrapper` | Optional `/usr/local/bin/pacman` wrapper |
259270
| `completions/` | Zsh and bash tab completions for `atomic-gc` and `atomic-rebuild-uki` |
260271

272+
## Troubleshooting
273+
274+
### fstab uses `subvolid=` without `subvol=`
275+
276+
`atomic-upgrade` requires a `subvol=` option in the root fstab entry to track which generation is active. If your fstab uses only `subvolid=`, add `subvol=/your-current-subvol` to the mount options:
277+
278+
```bash
279+
# Before (won't work):
280+
UUID=xxx / btrfs rw,noatime,subvolid=256 0 0
281+
282+
# After (works):
283+
UUID=xxx / btrfs rw,noatime,subvolid=256,subvol=/root-20260601-120000 0 0
284+
```
285+
286+
> **Note:** When both `subvolid=` and `subvol=` are present, some kernels prioritize `subvolid=`. Consider removing `subvolid=` from fstab to avoid conflicts after generation switches.
287+
288+
### Low disk space warning on large disks
289+
290+
On disks larger than ~200 GB, the free percentage may drop below 10% while absolute free space is still well above 2 GB. In this case, `atomic-upgrade` shows a warning but proceeds normally. The operation is only blocked when both the percentage **and** absolute thresholds are crossed.
291+
261292
## Requirements
262293

263294
### Prerequisites

0 commit comments

Comments
 (0)