lima-vm/lima · error
disk shrinking is not supported
Error message
disk shrinking is not supported
What it means
prepareDisk resizes the instance disk to the newly requested size but refuses to shrink: reducing disk size is not supported by the underlying disk utilities and risks data loss. Note the code first sets inst.Disk back to the current size (preventing the shrink from being persisted) and then returns this error.
Source
Thrown at pkg/instance/start.go:554
return err
}
diskSize := img.Size()
if img.Type() == vhdx.Type {
logrus.Warn("Skip resizing the instance because go-qcow2reader cannot read vhdx type image")
return nil
}
if inst.Disk == diskSize {
return nil
}
logrus.Infof("Resize instance %s's disk from %s to %s", inst.Name, units.BytesSize(float64(diskSize)), units.BytesSize(float64(inst.Disk)))
if inst.Disk < diskSize {
inst.Disk = diskSize
return errors.New("disk shrinking is not supported")
}
diskUtil := proxyimgutil.NewDiskUtil(ctx)
return diskUtil.ResizeDisk(ctx, disk, inst.Disk)
}
View on GitHub (pinned to dd909d0973)
Solutions
- Restore the disk value in lima.yaml to a size >= the current disk (`limactl list` shows current disk)
- If a smaller disk is truly needed, create a new instance and copy data over
- Manually shrink the filesystem/disk outside lima if you accept the risk (not supported)
Example fix
# before (in lima.yaml) disk: 50GiB # was 100GiB -> error # after disk: 100GiB # keep >= current size, or grow
Defensive patterns
Strategy: validation
Validate before calling
cur := getCurrentDiskSize(instName) // from `limactl list --json` .disk
if requestedDisk < cur {
return fmt.Errorf("cannot shrink disk from %d to %d; keep disk >= current", cur, requestedDisk)
} Prevention
- Never lower the `disk` field in lima.yaml of an existing instance
- Compare requested disk against `limactl list` before applying config changes
- Keep config files under version control to spot accidental reverts
- To shrink, create a fresh instance and migrate data
When it happens
Trigger: Calling `limactl start` (or the Prepare path) on an instance whose lima.yaml `disk` value is now SMALLER than the previously applied disk size stored in the instance state.
Common situations: Editing lima.yaml to lower the disk value and re-running start, copying a config from a smaller instance, or reverting a config file to an older version.
Related errors
- disk format %#q not supported, use `qcow2` or `raw` instead
- disk %#q already exists (%#q)
- failed to remove a directory %#q: %w
- failed to create %s disk in %#q: %w
- cannot delete disk %#q in use by instance %#q
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/b566b8f03b1a60ed.
Report an issue: GitHub.