大网数据广告活动
服务器运维问答

How to determine disk image file format: VMDK, VHD or raw file format?

· 52CE 我爱测

Is there any shell command using which I can determine the format of a disk image file? I want to check that disk image file is in which of these formats: vmdk, vhd of raw file.

问题原文

原帖链接 · Abhay Gupta · CC BY-SA 4.0

Is there any shell command using which I can determine the format of a disk image file? I want to check that disk image file is in which of these formats: vmdk, vhd of raw file.

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

You can determine the format of a virtual disk image with the qemu-img info command. For example:

# 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

Use qemu-img -h to see the supported formats for your specific version. They will appear near the end of the output. For example:

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-09-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。