是否有任何 shell 命令可以用來確定磁碟映像檔的格式?我想檢查磁碟映像檔採用下列哪種格式:vmdk、原始檔案的 vhd。
答案1
您可以使用該指令確定虛擬磁碟映像的格式qemu-img info
。例如:
# qemu-img info amzn2-kvm-2017.12.0.20171212.2-x86_64.xfs.gpt.qcow2
image: amzn2-kvm-2017.12.0.20171212.2-x86_64.xfs.gpt.qcow2
file format: qcow2
virtual size: 25 GiB (26843545600 bytes)
disk size: 1.61 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false
用於qemu-img -h
查看您的特定版本支援的格式。它們將出現在輸出末尾附近。例如:
Supported formats: blkdebug blklogwrites blkverify bochs cloop compress copy-on-read dmg file ftp ftps gluster host_cdrom host_device http https iscsi iser luks nbd nfs null-aio null-co nvme parallels qcow qcow2 qed quorum raw rbd replication ssh throttle vdi vhdx vmdk vpc vvfat