Use this when KVM VMs have storage errors.
KVM Storage Troubleshooting
Troubleshoot KVM storage with virsh pool-info and vol-list, qemu-img info and check for image chains and corruption, file permissions and SELinux or AppArmor labels, and the host's dmesg and libvirt logs.
1. Pool inactive: mount/device missing — virsh pool-start.
2. Permission denied: SELinux/AppArmor labels, ownership.
3. I/O errors: backend.
4. Paused VM: ENOSPC.
5. Check logs.
libvirt pool → backend → QEMU disk
Context & applicabilityCommon mistakes · platform/version boundaries
- Restarting libvirtd during heavy I/O without checking guests.
- Running
qemu-img check -r allon images in use. - Ignoring host
dmesgstorage errors while debugging the guest. - Permission problems on images after copying them as root (
chown qemu:qemuorlibvirt-qemu).
Operational reference
Fast context before you go deeper.
virsh domblklist <vm> --detailsPrimary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Troubleshooting order Narrow the fault
1. Pool and volume: virsh pool-info, virsh vol-list (pool inactive, full).
2. Image: qemu-img info --backing-chain (missing backing file), qemu-img check (corruption).
3. Permissions and labels: file ownership (qemu/libvirt-qemu), SELinux (ls -Z, ausearch -m avc) or AppArmor denials.
4. Locking: "Failed to get write lock" means another QEMU process uses the image.
5. Performance: cache and I/O mode in virsh dumpxml, host iostat -x.
- Permissions and SELinux labels block access.
- Backing chains break if files move.
- Full pools pause VMs.
virsh pool-list --all— inactive poolstail /var/log/libvirt/qemu/<vm>.log— disk errorsausearch -m avc -ts recent— SELinux denials
ReferenceHow it works1 section · depth on demand
Method
| Symptom | Check |
|---|---|
VM paused (virsh domstate = paused, I/O error) | Backing storage full or unreachable; virsh domblkerror vm1 |
| Slow disk I/O | Bus (IDE/SATA vs virtio), cache= mode, host iostat -x |
| Image locked | Another QEMU has it open; qemu-img info -U to read anyway |
| Corrupt qcow2 after crash | qemu-img check -r leaks (backup first) |
| Disk not shrinking | Missing discard='unmap', guest not trimming |
virsh domblkstat vm1 vda --human
virsh dumpxml vm1 | grep -A5 '<disk'
journalctl -u libvirtd | tail
ReferenceConfiguration & state1 section · depth on demand
Useful commands
virsh domblklist vm01
virsh domblkerror vm01
virsh domblkstat vm01 vda
qemu-img check disk.qcow2
journalctl -u libvirtd
A VM paused with I/O error usually means the storage is full or unreachable; fix the storage, then virsh resume vm01.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hypervisor Storage → KVM Storage → KVM Storage Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://pve.proxmox.com/pve-docs/chapter-pvesm.html · confidence 94%