虛擬磁盤格式轉換:vdi - raw - qcow2

XBox 虛擬磁盤 vdi 格式轉換爲 raw 格式

  • 命令:
VBoxManage clonemedium      [disk|dvd|floppy] <uuid|inputfile> <uuid|outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--existing]

  • 示例:
% vboxmanage clonemedium --format raw Kali\ Rolling\ \(2019.4\)\ x64-disk001.vdi test.img
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'raw'. UUID: 72b79a1e-e37e-44fb-8860-54f930a666e5
  • 轉換結果:
% ls -l
total 187099424
-rwxrwxrwx  1 xufengchao  staff   9888071680  5  9 15:21 Kali Rolling (2019.4) x64-disk001.vdi
-rw-------  1 xufengchao  staff         6554  5 11 16:07 Kali Rolling (2019.4) x64.vbox
-rw-------  1 xufengchao  staff         6554  5  9 15:37 Kali Rolling (2019.4) x64.vbox-prev
drwxrwxrwx  6 xufengchao  staff          192  5  9 15:17 Logs
drwx------  2 xufengchao  staff           64  5  9 15:17 Snapshots
-rw-------  1 xufengchao  staff  85899345920  5 11 16:07 test.img

KVM 虛擬磁盤 raw 格式轉換 qcow2 格式

  • 命令:
qemu-img convert [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_name] [-S sparse_size] filename [filename2 [...]] output_filename
  • 示例:
# qemu-img convert -f raw jenkins.img -O qcow2 jenkins.qcow2
  • 轉換結果:
# ls -l
total 477756480
-rw------- 1 root root  85899345920 May  9 14:13 jenkins.img
-rw-r--r-- 1 root root   9685630976 May 11 12:27 jenkins.qcow2
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章