{"record":{"id":"9d966e9570cfeb21","repo":"abiosoft/colima","slug":"unable-to-resize-disk-w","errorCode":null,"errorMessage":"unable to resize disk: %w","messagePattern":"unable to resize disk: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"environment/vm/lima/disk.go","lineNumber":226,"sourceCode":"\tif err != nil {\n\t\t// instance config missing, ignore\n\t\treturn conf\n\t}\n\n\tresized := func() bool {\n\t\tif instance.Disk == conf.Disk {\n\t\t\t// nothing to do\n\t\t\treturn false\n\t\t}\n\n\t\tsize := conf.Disk - instance.Disk\n\t\tif size < 0 {\n\t\t\tlog.Warnln(\"disk size cannot be reduced, ignoring...\")\n\t\t\treturn false\n\t\t}\n\n\t\tif err := limautil.ResizeDisk(conf.Disk); err != nil {\n\t\t\tlog.Warnln(fmt.Errorf(\"unable to resize disk: %w\", err))\n\t\t\treturn false\n\t\t}\n\n\t\tlog.Printf(\"resizing disk to %dGiB...\", conf.Disk)\n\t\treturn true\n\t}()\n\n\tif !resized {\n\t\tconf.Disk = instance.Disk\n\t}\n\n\treturn conf\n}\n","sourceCodeStart":208,"sourceCodeEnd":240,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/disk.go#L208-L240","documentation":"During start, Colima compares the Lima instance's current disk size to conf.Disk and attempts limautil.ResizeDisk when the config asks for a larger disk. If resizing fails, it is only logged as a warning and the flow continues with the existing size (conf.Disk is reset to instance.Disk). Note that shrinking is ignored with a different warning, and this specific message appears only when the resize tooling itself errors.","triggerScenarios":"`colima start --disk <larger>` (or editing disk in config) on an existing profile where the resize helper (qemu-img/vz tooling) fails: missing qemu-img on host, permission issues on the disk file, unsupported VM driver (e.g. vz limitations), or the VM/disk file being locked by a running instance.","commonSituations":"Growing disk after initial creation with a small --disk value; hosts where qemu-img is not in PATH; switching VM drivers (qemu/vz) on an existing profile.","solutions":["Check the wrapped error in the log for the underlying cause (usually qemu-img output) and fix that: install qemu-utils/qemu-img, free the file lock by stopping the VM first.","If resize cannot work in your setup, create a new profile with the desired disk size: `colima start --profile fresh --disk 100` and migrate workloads.","Verify the disk file is writable by the user and resides on a filesystem with enough space for the grown image.","Accept the current size: the warning is non-fatal, Colima continues with instance.Disk."],"exampleFix":"# before\ncolima start --disk 100   # resize fails, stays at old size\n\n# after\nbrew install qemu   # ensure qemu-img present\ncolima stop && colima start --disk 100","handlingStrategy":"fallback","validationCode":"// before requesting a larger disk, ensure the resize tooling exists on the host\nif _, err := exec.LookPath(\"qemu-img\"); err != nil {\n    log.Warn(\"qemu-img missing; disk resize will be skipped, VM keeps current size\")\n}","typeGuard":null,"tryCatchPattern":"Non-fatal by design (logged as warning; conf.Disk falls back to the instance's current size). No catch needed; verify actual size with `colima ssh -- df -h` after start.","preventionTips":["Set the desired --disk size at initial profile creation","Install qemu/qemu-img before growing disks","Stop the VM before attempting resize on drivers that lock disk files"],"tags":["disk","resize","qemu-img","colima","non-fatal"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}