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

  1. Restore the disk value in lima.yaml to a size >= the current disk (`limactl list` shows current disk)
  2. If a smaller disk is truly needed, create a new instance and copy data over
  3. 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

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


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/b566b8f03b1a60ed. Report an issue: GitHub.