add qcow manipulation docs to arch workstation

This commit is contained in:
2023-10-29 09:43:19 -04:00
parent dd14000317
commit 4a2e9d08b3

View File

@@ -7,6 +7,8 @@
- [Docker](#docker)
- [QEMU/KVM](#qemukvm)
- [Arch Guests](#arch-guests)
- [Restore qcow snapshots](#restore-qcow-snapshots)
- [Convert qcow to bootable drive](#convert-qcow-to-bootable-drive)
- [Kubernetes](#kubernetes)
- [VSCode](#vscode)
- [Shell](#shell)
@@ -127,6 +129,29 @@ In order to get drivers for spice you'll need the guest spice drivers:
sudo pacman -S qemu-guest-agent spice-vdagent
```
### Restore qcow snapshots
```bash
# Create a snapshot
qemu-img snapshot -c snapshot-name /var/lib/libvirt/images/vm-image.qcow2
# List snapshots for a given image
qemu-img snapshot -l /var/lib/libvirt/images/vm-image.qcow2
# Restore snapshot
qemu-img snapshot -a snapshot-name /var/lib/libvirt/images/vm-image.qcow2
```
### Convert qcow to bootable drive
```bash
qemu-img convert -f qcow2 -O raw /var/lib/libvirt/images/vm-image.qcow2 /dev/sdb
```
If you need to resize a windows partition to non-continuous space simply grow the
last partition, shrink it to the end of the drive, then grow the windows partition
with gparted.
## Kubernetes
```bash