Score:0

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

in flag

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 avatar
cz flag
What operating system?
Abhay Gupta avatar
in flag
@MichaelHampton I need a command for linux operating system. I am using centos currently.
Score:1
cz flag

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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.