abiosoft/colima · warning

cannot recover disk: %w, creating new storage pool

Error message

cannot recover disk: %w, creating new storage pool

What it means

During incus provisioning with an existing data disk, colima checks for the pool disk file with guest.Stat(); the stat failed and colima logs a warning that it cannot recover the disk and will wipe it and create a new storage pool. This is an intentional degrade path, not a hard failure — data on the previous pool is discarded.

Source

Thrown at environment/container/incus/incus.go:128

		return fmt.Errorf("error parsing incus config template: %w", err)
	}

	stdin := bytes.NewReader(buf)
	if err := c.guest.RunWith(stdin, nil, "sudo", "incus", "admin", "init", "--preseed"); err != nil {
		return fmt.Errorf("error setting up incus: %w", err)
	}

	// provision successful
	if emptyDisk {
		return nil
	}

	if !recoverStorage {
		return c.wipeDisk(conf.Disk)
	}

	if _, err := c.guest.Stat(poolDiskFile); err != nil {
		log.Warnln(fmt.Errorf("cannot recover disk: %w, creating new storage pool", err))
		return c.wipeDisk(conf.Disk)
	}

	for {
		if err := c.recoverDisk(ctx); err != nil {
			log.Warnln(err)

			if cli.Prompt("recovery failed for default storage pool, try again") {
				continue
			}

			log.Warnln("discarding disk, creating new storage pool")
			return c.wipeDisk(conf.Disk)
		}
		break
	}

	return nil

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Accept the wipe if the data is disposable — this is the default path
  2. If the data matters, stop colima and verify the disk image exists at the expected path before retrying
  3. Ensure external/data disks are mounted before 'colima start'
  4. If state is inconsistent, reset fully: 'colima delete && colima start'
Defensive patterns

Strategy: fallback

Validate before calling

// data-safe gate: only allow the wipe path when user confirms
if _, err := c.guest.Stat(poolDiskFile); err != nil {
    if !cli.Prompt("pool disk missing, wipe and recreate storage (data will be lost)") {
        return fmt.Errorf("aborted: pool disk file missing: %w", err)
    }
    return c.wipeDisk(conf.Disk)
}

Try / catch

// colima already degrades gracefully; callers only need to surface the warning
if _, err := c.guest.Stat(poolDiskFile); err != nil {
    log.Warnln(fmt.Errorf("cannot recover disk: %w, creating new storage pool", err))
    return c.wipeDisk(conf.Disk)
}

Prevention

When it happens

Trigger: guest.Stat(poolDiskFile) errors: the .img pool disk file is absent (moved/deleted), the /var/lib/incus mount is missing, or permissions changed after a host upgrade.

Common situations: External data disk not mounted, colima VM recreated but an old disk marker (limautil.DiskProvisioned) still present, or manual cleanup that removed the img while leaving metadata.

Related errors


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