abiosoft/colima · error

error deleting lima disk: %w, output: %s

Error message

error deleting lima disk: %w, output: %s

What it means

Returned by limautil.DeleteDisk when 'limactl disk delete <profileID>' fails, with limactl's combined output attached. It runs during teardown when the profile's additional/data disk must be removed.

Source

Thrown at environment/vm/lima/limautil/disk.go:78

	if err := cmd.Run(); err != nil {
		return fmt.Errorf("error resizing disk: %w, output: %s", err, buf.String())
	}

	return nil
}

// DeleteDisk deletes lima disk for the current instance.
func DeleteDisk() error {
	name := config.CurrentProfile().ID

	var buf bytes.Buffer
	cmd := Limactl("disk", "delete", name)
	cmd.Stderr = &buf
	cmd.Stdout = &buf

	if err := cmd.Run(); err != nil {
		return fmt.Errorf("error deleting lima disk: %w, output: %s", err, buf.String())
	}

	return nil
}

// MountPoint returns the lima disk mount point for the current instance.
func MountPoint() string { return fmt.Sprintf("/mnt/lima-%s", config.CurrentProfile().ID) }

// DiskPrivisioned returns if the disk exists and has been provisioned for the specified runtime.
func DiskProvisioned(runtime string) bool {
	if !HasDisk() {
		return false
	}

	s, _ := store.Load()
	return s.DiskFormatted && s.DiskRuntime == runtime
}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Stop the VM first ('colima stop') and wait for 'colima status' to report stopped, then retry the delete
  2. If the disk is already gone, treat as success — verify with 'limactl disk list'
  3. As a last resort remove Lima's disk assets manually from the lima disks directory, then retry

Example fix

# before: delete while running -> 'in use' error
colima delete --force
# after
colima stop && sleep 5 && colima delete
Defensive patterns

Strategy: fallback

Validate before calling

// delete only when present
if !limautil.HasDisk() {
    return nil // nothing to delete
}
return limautil.DeleteDisk()

Try / catch

In Go: if err := limautil.DeleteDisk(); err != nil { if strings.Contains(err.Error(), "not found") || strings.Contains(err.Error(), "does not exist") { return nil }; return err } — treat already-gone as success.

Prevention

When it happens

Trigger: Deleting a disk that is still attached to a running (or not fully stopped) Lima instance, a disk that no longer exists, or limactl being unable to reach its config directory.

Common situations: 'colima delete' or 'colima stop --disk' while the VM is still shutting down; deleting twice in a row (second pass finds no disk); corrupted ~/.lima state confusing limactl.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/e8a2b90959bb4f9b. Report an issue: GitHub.