Tag Archives: linux

virsh cheat sheet


Here are a few simple virsh commands I occasionally need when things go wrong.

list active macines
virsh list
list all machines
virsh list --all
start a machine
virsh start name
mark a machine to autostart with the host
virsh autostart name
mark a machine to not autostart with the host
virsh autostart --disable name
gracefully shutdown a machine
virsh shutdown name
force a machine to shutdown
virsh destroy name
reboot a machine
virsh reboot name
suspend and resume a machine
virsh suspend name
virsh resume name

Much more detail is available at in the virsh man page.

LVM Resize

Hard_disk_head_crashThe /tmp volume on my desktop Linux system is too small, causing system updates to fail. The steps to enlarge the underlying LVM volume and file system to 1GB are:

# lvextend -L1G /dev/vg/tmp
# resize2fs /dev/vg/tmp

I could also have used:

# lvextend -L+1G /dev/vg/tmp

followed by resize2fs to add 1GB to the volume.