1

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.

2
  • What operating system? Commented Sep 20, 2021 at 21:56
  • @MichaelHampton I need a command for linux operating system. I am using centos currently. Commented Sep 21, 2021 at 2:52

1 Answer 1

2

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.