mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-04 08:55:35 +02:00
qemu-img: add examples (#17109)
Co-authored-by: binertia <bat@binertia.cc> Co-authored-by: Wiktor Perskawiec <wiktor@perskawiec.cc>
This commit is contained in:
parent
cac558ee1d
commit
a384c1e979
1 changed files with 14 additions and 6 deletions
|
@ -5,20 +5,28 @@
|
||||||
|
|
||||||
- Create disk image with a specific size (in gigabytes):
|
- Create disk image with a specific size (in gigabytes):
|
||||||
|
|
||||||
`qemu-img create {{image_name.img}} {{gigabytes}}G`
|
`qemu-img create {{path/to/image_file.img}} {{gigabytes}}G`
|
||||||
|
|
||||||
- Show information about a disk image:
|
- Show information about a disk image:
|
||||||
|
|
||||||
`qemu-img info {{image_name.img}}`
|
`qemu-img info {{path/to/image_file.img}}`
|
||||||
|
|
||||||
- Increase or decrease image size:
|
- Increase or decrease image size:
|
||||||
|
|
||||||
`qemu-img resize {{image_name.img}} {{gigabytes}}G`
|
`qemu-img resize {{path/to/image_file.img}} {{gigabytes}}G`
|
||||||
|
|
||||||
- Dump the allocation state of every sector of the specified disk image:
|
- Dump the allocation state of every sector of the specified disk image:
|
||||||
|
|
||||||
`qemu-img map {{image_name.img}}`
|
`qemu-img map {{path/to/image_file.img}}`
|
||||||
|
|
||||||
- Convert a VMware .vmdk disk image to a KVM .qcow2 disk image:
|
- Convert a VMware `.vmdk` disk image to a KVM `.qcow2` disk image:
|
||||||
|
|
||||||
`qemu-img convert -f {{vmdk}} -O {{qcow2}} {{path/to/file/foo.vmdk}} {{path/to/file/foo.qcow2}}`
|
`qemu-img convert -f vmdk -O qcow2 {{path/to/image_file.vmdk}} {{path/to/image_file.qcow2}}`
|
||||||
|
|
||||||
|
- [c]reate an internal snapshot of a KVM `.qcow2` disk image:
|
||||||
|
|
||||||
|
`qemu-img snapshot -c {{snapshot_tag_name}} {{path/to/image_file.qcow2}}`
|
||||||
|
|
||||||
|
- [a]pply an internal snapshot to a KVM `.qcow2` disk image:
|
||||||
|
|
||||||
|
`qemu-img snapshot -a {{snapshot_tag_name}} {{path/to/image_file.qcow2}}`
|
||||||
|
|
Loading…
Add table
Reference in a new issue