{"record":{"id":"6a892664c26de52c","repo":"lima-vm/lima","slug":"failed-to-convert-extra-disk-q-to-a-raw-disk-w","errorCode":null,"errorMessage":"failed to convert extra disk %#q to a raw disk: %w","messagePattern":"failed to convert extra disk %#q to a raw disk: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/vm_darwin.go","lineNumber":600,"sourceCode":"\tdiskUtil := proxyimgutil.NewDiskUtil(ctx)\n\n\tfor _, d := range inst.Config.AdditionalDisks {\n\t\tdiskName := d.Name\n\t\tdisk, err := store.InspectDisk(diskName, d.FSType)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to run load disk %#q: %w\", diskName, err)\n\t\t}\n\n\t\tlogrus.Infof(\"Mounting disk %#q on %#q\", diskName, disk.MountPoint)\n\t\tif err = disk.LockForInstance(inst.Dir); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to attach disk %#q: %w\", diskName, err)\n\t\t}\n\t\textraDiskPath := filepath.Join(disk.Dir, filenames.DataDisk)\n\t\t// ConvertToRaw is a NOP if no conversion is needed\n\t\tlogrus.Debugf(\"Converting extra disk %#q to a raw disk (if it is not a raw)\", extraDiskPath)\n\n\t\tif err = diskUtil.Convert(ctx, raw.Type, extraDiskPath, extraDiskPath, nil, true); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to convert extra disk %#q to a raw disk: %w\", extraDiskPath, err)\n\t\t}\n\t\textraDiskPathAttachment, err := vz.NewDiskImageStorageDeviceAttachmentWithCacheAndSync(extraDiskPath, false, diskImageCachingMode, vz.DiskImageSynchronizationModeFsync)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create disk attachment for extra disk %#q: %w\", extraDiskPath, err)\n\t\t}\n\t\textraDisk, err := vz.NewVirtioBlockDeviceConfiguration(extraDiskPathAttachment)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create new virtio block device config for extra disk %#q: %w\", extraDiskPath, err)\n\t\t}\n\t\tconfigurations = append(configurations, extraDisk)\n\t}\n\n\tif err := validateDiskFormat(ciDataPath); err != nil {\n\t\treturn err\n\t}\n\tciDataAttachment, err := vz.NewDiskImageStorageDeviceAttachment(ciDataPath, true)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/vm_darwin.go#L582-L618","documentation":"attachDisks converts the extra disk's data image to raw via DiskUtil.Convert before vz can attach it; failure of the conversion step is wrapped here. Convert is a NOP when the image is already raw, so the error indicates the actual conversion (or its I/O) failed.","triggerScenarios":"diskUtil.Convert(ctx, raw.Type, extraDiskPath, extraDiskPath, nil, true) returns an error — corrupt source image, insufficient free space for the raw conversion, or I/O error writing in place.","commonSituations":"Disk full on the host volume holding ${LIMA_HOME}; source data disk corrupted after a crash; a very large qcow2 disk exhausting space during in-place conversion.","solutions":["Free disk space on the volume containing the instance/disk directories and retry","Manually convert/inspect the image (`qemu-img convert -O raw`) to reveal the underlying problem","Delete and recreate the disk (`limactl disk delete` / `create`) if the data disk is corrupt"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"st, _ := os.Stat(diskPath)\nif st.Size() > availableSpaceOnVolume(diskDir) {\n    return fmt.Errorf(\"insufficient space to convert %s to raw\", diskPath)\n}","typeGuard":null,"tryCatchPattern":"if err := startInstance(cfg); err != nil {\n    if strings.Contains(err.Error(), \"to a raw disk\") {\n        // free space or manually convert the image, then retry\n    }\n}","preventionTips":["Monitor free space on the volume holding ${LIMA_HOME}","Keep disks in raw format to make conversion a NOP","Shut down VMs cleanly to avoid corrupt data disks"],"tags":["disk","conversion","vz-driver"],"backgroundTag":"disk-conversion-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}