如何确定磁盘映像文件格式:VMDK、VHD 还是原始文件格式?

如何确定磁盘映像文件格式:VMDK、VHD 还是原始文件格式?

是否有任何 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

相关内容