[0.4.3] - 2026-05-06
The btrfs Copy-on-Write fragmentation fix. The 0.4.x line's headline storage rework: a per-user bind mount with automatic NoCoW so Windows VM disk image writes (every pagefile / boot / swap byte) stop forking new btrfs extents on every overwrite. On btrfs hosts that means pod recreates that previously took many minutes — and frequently timed out on the 300 s budget — finish in 30 s like they always did on ext4. Reported by @xiyeming in #121, #122 (and indirectly the actual-failure cause behind #126's "Unable to open apps and desktop" cascade on cachyos).
Highlights — five PRs landing the fix end-to-end. The migration design started at "chattr +C the entire podman graph root" (PR #124 — closed without merging because it would have flipped every container/volume/image on the host to NoCoW, which surprises btrfs snapshot users), pivoted to a per-user bind mount with chattr +C applied only to that one directory, and then took four follow-up patches as the smoke tests revealed each successive silent failure:
- PR #125 — bind mount +
chattr +C+ named-volume migration tool. Fresh installs default to~/.local/share/winpodx/storage(chattr'd before compose-up so dockur's first raw-disk write inherits NoCoW). Existing users keep the named volume;winpodx setup --migrate-storage(or auto-trigger viawinpodx migrate) moves it to the bind mount path without reinstalling Windows. - PR #127 — compose-prefixed volume name resolution.
podman-compose upmaterialises named volumes with the project name prefix (winpodx_winpodx-data, notwinpodx-data); the migration's volume probe now tries the prefixed form first and falls back to bare. - PR #128 — chattr +C outcome surfacing + post-rsync NoCoW verification.
print()the apply / already-off / failed outcome so the user sees it during install.sh; re-lsattrboth the dir and a sample.imgafter rsync to catch the silent-no-op case where chattr returned 0 but the flag never persisted. - PR #129 — auto-migration refuses to re-run when the bind-mount target is already populated. Defends against the install.sh-runs-twice destructive scenario where a stale
cfg.pod.storage_pathwould let_maybe_auto_migrate_storagersync 64 GiB over the already-migrated NoCoW disk image with a fresh CoW copy. - PR #130 — the actual root cause for "chattr never applies on fresh installs."
plan_migrationcallsdetect_path_fs(target)BEFORE the dir ismkdir'd. On openSUSE Tumbleweedfindmnt --target <nonexistent_path>returnsrc=1with empty stdout (the docs lie) —detect_path_fsreturned"unknown",chattr_will_runevaluated False, the entire chattr branch silently no-op'd, and PR #128's surfacing print never fired because the branch wasn't entered. Fix walks up to the nearest existing ancestor (max 64 steps;/always exists) before invoking findmnt.
Smoke-tested end-to-end on openSUSE Tumbleweed btrfs: clean wipe → v0.4.2 fresh install (creates winpodx_winpodx-data named volume) → upgrade to main → install.sh prints chattr +C applied to /home/.../winpodx/storage (NoCoW for new files) between Migrating storage... and OK: migrated 71 GiB; afterwards lsattr -d and lsattr data.img both show the C flag, dockur's Warning: COW (copy on write) is not disabled for disk image file /storage/data.img no longer appears in the journal, the named volume is removed, and the next podman-compose up mounts the bind mount and Windows boots without any CoW warning.
Added
- Per-user storage bind mount with automatic btrfs NoCoW.
winpodx setupon a fresh install now mounts the Windows VM disk image from a user-owned host directory (~/.local/share/winpodx/storageby default) instead of the legacywinpodx-datanamed volume. When the path lands on btrfs, setup runschattr +Con the empty directory before compose-up — so dockur's first write of the Windows raw disk image inherits NoCoW from the parent and bypasses Copy-on-Write fragmentation entirely. The flag affects only this specific directory; other podman containers/volumes/images on the host are completely untouched (a deliberate design choice over a graph-root-wide flag, see PR #124's closed comment for the rationale). Existing users keep the named volume and see a one-line note pointing them at the migration command if their volume happens to be on btrfs. Reported by @xiyeming in #121, #122. winpodx setup --migrate-storage. Move an existingwinpodx-datanamed volume to the per-user bind mount path without reinstalling Windows. Pre-flight plan surfaces the source/target paths, source size, target filesystem, whether chattr will run, and free space on the target. Cost: ~5-10 min on NVMe (rsync -aSof ~60 GiB). The Windows install is preserved — no Sysprep redo, no ISO redownload. Idempotent: pod is stopped, btrfschattr +Capplied to the empty target so the copy lands NoCoW, contents rsync'd,cfg.pod.storage_pathpersisted, compose regenerated, old named volume removed only on success, pod restarted. On copy failure the source volume stays intact and the target is wiped so a retry has a clean slate. Override the destination with--migrate-storage-target PATH; skip the confirmation prompt with--yes.- Auto-migrate on upgrade.
winpodx migrate(whichinstall.shcalls on every upgrade) now detects the same condition —winpodx-datanamed volume, mountpoint on btrfs,cfg.pod.storage_pathempty — and runs the migration automatically. Interactive runs prompt for confirmation (default Yes); non-interactive runs (install.sh post-upgrade path) just go ahead because the user is already in the degraded state and the whole point of runningmigrateis to apply fixes. On failure the original named volume is preserved and the user is pointed atwinpodx setup --migrate-storagefor manual retry. cfg.pod.storage_pathconfig field. Empty string preserves the legacy named-volume mode; an absolute path switches compose to a host bind mount at that path.Config.loadvalidates the field and falls back to empty on bad values;_render_storage_blocksdefends against unsafe values (newlines, quotes, brace characters) by reverting to the named volume so a hand-editedwinpodx.tomlcan't corrupt compose YAML.
Fixed
- Auto-migration was silently never running on compose-managed installs.
storage_migration.named_volume_exists("podman", "winpodx-data")always returned False on installs created viapodman-compose upbecause the actual volume on disk iswinpodx_winpodx-data— podman-compose namespaces volumes by the compose project name (we declarename: "winpodx"in the template). Auto-migration inwinpodx migrateand the Case-2 warning inwinpodx setupboth keyed off the bare name and therefore quietly classified every compose-managed btrfs install as "fresh-install" / "nothing to migrate". kernalix7 caught this on opensuse Tumbleweed (2026-05-06): the named volume was sitting atwinpodx_winpodx-data, the auto-migrate hook had been dormant for hours. Newresolve_named_volume(backend)probes the prefixed form first and falls back to the bare form, so both compose-managed and hand-created volumes resolve correctly.MigrationPlan.source_volumecarries the resolved name through so thevolume rmstep at end of migration targets the same volume that was migrated. detect_path_fswalks up to an existing ancestor before invokingfindmnt. kernalix7's 2026-05-06 third smoke test (clean wipe → install v0.4.2 → upgrade to main) revealed the SILENT root cause of "chattr +C never applies":plan_migrationcallsdetect_path_fs(~/.local/share/winpodx/storage)BEFORE the target directory is mkdir'd. On openSUSE Tumbleweedfindmnt --target <nonexistent_path>returnsrc=1with empty stdout (despite docs claiming it falls back to the nearest existing parent), so the helper returned"unknown". That madechattr_will_run = (target_fs == "btrfs")evaluate to False, the entire chattr branch inexecute_migrationsilently no-op'd, the post-rsync NoCoW verification (PR #128) had nothing to flag becausechattr_will_runwas False there too, AND PR #128's surfacingprint()never fired because the branch wasn't entered. Three migrations in a row landed CoW-fragmented disk images while reporting "OK: migrated N GiB" with zero indication that NoCoW had been silently skipped. Fix walks up to 64 steps from the input path to the nearest existing ancestor (terminates at/which always exists) before passing the path tofindmnt, so a not-yet-mkdir'd target still resolves to the fs that will contain it.chattr_will_runis now True for fresh-install migration plans on btrfs targets, which means thechattr +Capply, the inlineprint()of the outcome, and the post-rsynclsattrverification all actually run.- Auto-migration refuses to re-run when the bind-mount target is already populated. kernalix7's 2026-05-06 second smoke test on opensuse Tumbleweed exposed a confusing reproducer: install.sh ran a second time after PR #127 + #128 had merged, found
cfg.pod.storage_pathempty (root cause still under investigation — one possibility is install.sh's git-update step leaving a stale install dir whosePodConfigdataclass lacked thestorage_pathfield, soConfig.loadsilently dropped the value when round-tripping), AND found the named volumewinpodx_winpodx-datarecreated bypodman-compose upwith a 64 GiB raw disk. The auto-migration then ran a SECONDrsync -aSof 64 GiB into~/.local/share/winpodx/storage— which was already populated with the FIRST migration's output (including thechattr +C-applieddata.imgfrom the manual recoverycp --reflink=never). The second rsync silently overwrote the NoCoW disk image with a fresh CoW-fragmented copy, undoing the entire perf benefit AND any data divergence between the named volume and the bind mount that had accumulated since the first migration. New defence:_maybe_auto_migrate_storagenow checksdefault_target_path()(~/.local/share/winpodx/storage) BEFORE the named-volume probe; if that path exists and is non-empty, the hook bails out with a notice telling the user how to either restorestorage_pathinwinpodx.tomlor move the populated dir aside before retrying. The bind-mount data on disk is the source of truth — if a migration already happened, re-running cannot be safe. chattr +Coutcome is now visible inline AND verified post-migration. kernalix7's 2026-05-06 smoke test on opensuse Tumbleweed succeeded the auto-migration ("OK: migrated 64 GiB"), butlsattr -dafterwards showed noCflag on either the bind-mount directory or the freshly rsync'd 64 GiBdata.img— the entire NoCoW benefit of the migration was silently missing because the chattr outcome only flowed throughlog.warning(filtered out of the install.sh foreground) and there was no post-rsync sanity check.execute_migrationnow (a)print()s every chattr outcome —disabled/already_off/failed— so the user sees inline whether NoCoW was applied, and (b) re-runsis_cow_disabledafter rsync against both the target directory AND a sample*.imgfile from inside it; any discrepancy ("dir has +C but new file did not inherit", "chattr returned 0 but flag never persisted") is surfaced as a warning inMigrationResult.detailwith a recovery recipe (cp --reflink=neverof the affected file with the pod stopped).cp --reflink=neverreads + rewrites the file inside the now-+Cparent, so the new file is born NoCoW from inception and inherits the flag — the only safe way to retroactively fix a 64 GiB CoW disk image without reinstalling Windows.