![如何确定磁盘映像文件格式:VMDK、VHD 还是原始文件格式?](https://linux22.com/image/770628/%E5%A6%82%E4%BD%95%E7%A1%AE%E5%AE%9A%E7%A3%81%E7%9B%98%E6%98%A0%E5%83%8F%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F%EF%BC%9AVMDK%E3%80%81VHD%20%E8%BF%98%E6%98%AF%E5%8E%9F%E5%A7%8B%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F%EF%BC%9F.png)
是否有任何 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