{"record":{"id":"e521b248236fe96f","repo":"abiosoft/colima","slug":"error-creating-lima-disk-w-output-s","errorCode":null,"errorMessage":"error creating lima disk: %w, output: %s","messagePattern":"error creating lima disk: %w, output: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/vm/lima/limautil/disk.go","lineNumber":46,"sourceCode":"\n\tif err := json.NewDecoder(&buf).Decode(&resp); err != nil {\n\t\treturn false\n\t}\n\n\treturn resp.Name == name\n}\n\n// CreateDisk creates a lima disk with size in GiB.\nfunc CreateDisk(size int) error {\n\tname := config.CurrentProfile().ID\n\n\tvar buf bytes.Buffer\n\tcmd := Limactl(\"disk\", \"create\", name, \"--size\", fmt.Sprintf(\"%dGiB\", size))\n\tcmd.Stderr = &buf\n\tcmd.Stdout = &buf\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"error creating lima disk: %w, output: %s\", err, buf.String())\n\t}\n\n\treturn nil\n}\n\n// ResizeDisk resizes disk to new size\nfunc ResizeDisk(size int) error {\n\tname := config.CurrentProfile().ID\n\n\tvar buf bytes.Buffer\n\tcmd := Limactl(\"disk\", \"resize\", name, \"--size\", fmt.Sprintf(\"%dGiB\", size))\n\tcmd.Stderr = &buf\n\tcmd.Stdout = &buf\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"error resizing disk: %w, output: %s\", err, buf.String())\n\t}\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/limautil/disk.go#L28-L64","documentation":"Returned by limautil.CreateDisk when 'limactl disk create <profileID> --size <N>GiB' exits non-zero; the error bundles the captured stdout+stderr of the limactl invocation so the underlying reason is visible in the message.","triggerScenarios":"Calling CreateDisk (mounting an additional disk or using the colima-managed data volume) when a lima disk with the same profile name already exists, the host has insufficient free space for the requested size, or the bundled limactl version does not support the 'disk' subcommand.","commonSituations":"Re-running 'colima start --disk 50' after a failed start left a stale disk behind; requesting a disk larger than free host space; ancient colima/lima versions predating limactl disk support.","solutions":["Delete the stale disk and retry: 'limactl disk delete colima' (or 'colima delete' for a full reset)","Check host free space ('df -h') and request a smaller --disk size","Upgrade colima so a current limactl with disk support is embedded","Read the 'output:' portion of the error — it carries limactl's exact complaint"],"exampleFix":"# before: 'error creating lima disk ... output: disk already exists'\ncolima start --disk 50\n# after\nlimactl disk delete colima && colima start --disk 50","handlingStrategy":"validation","validationCode":"// avoid 'disk already exists'\nif limautil.HasDisk() { // or: limactl disk list | grep -q '^colima'\n    _ = limautil.DeleteDisk()\n}\nerr := limautil.CreateDisk(size)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always surface the 'output:' suffix — it contains limactl's real reason","Check host free space before requesting --disk N","After a failed start, clean up with 'limactl disk delete colima' before retrying"],"tags":["disk","limactl","storage","startup"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}