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.
- What operating system?Michael Hampton– Michael Hampton2021-09-20 21:56:31 +00:00Commented Sep 20, 2021 at 21:56
- @MichaelHampton I need a command for linux operating system. I am using centos currently.Abhay Gupta– Abhay Gupta2021-09-21 02:52:26 +00:00Commented Sep 21, 2021 at 2:52
Add a comment |
1 Answer
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