btrfs hosts: qcow2/raw disks are created without nocow
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
### Description
On btrfs hosts (Fedora/openSUSE default) Lima creates disk images with CoW. A qcow2 on a datacow btrfs fragments heavily over time.
There is also no mention of it in the docs.
Nocow has trade-offs: on btrfs it implies nodatasum (no checksums/self-heal), and a nocow file can't be reflinked to/from a regular one - so flagging only the disk file would break the reflink copy from the download cache and `limactl clone`. Flagging the directories (instance dir + download cache) at creation keeps reflinks working, since nocow <-> nocow reflink is fine.
Proposal:
1. Docs/FAQ note for btrfs hosts: `chattr +C` on `${LIMA_HOME}` and the download cache before first use, with the trade-offs.
2. Maybe: set `nocow` on newly created instance/cache dirs when on btrfs, as libvirt [>=6.6.0 does for new storage pools](https://libvirt.org/formatstorage.html#features) (it's opt out there) - or maybe opt-in flag?
Apologies if this has already been discussed.
Contributor guide
Research direction
Start by reviewing the documented FAQ area and the creation flow for the instance directory and download cache. Confirm the btrfs nocow trade-offs described in the issue, then resolve whether the behavior is documentation-only or an opt-in/opt-out feature. Done means the chosen policy is documented and tested without breaking reflinks or clone behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- infrastructure, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100