LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 08-25-2018, 03:18 AM   #1
kerbeross81
LQ Newbie
 
Registered: Aug 2018
Posts: 1

Rep: Reputation: Disabled
KVM: How can I see what kind of preallocation uses a qcow2 file?


Hi,
How can I see what kind of preallocation uses a qcow2 file? I tried with this command:
Code:
qemu-img info filename.qcow2
but the type of pre-allocation (off; full; metadata; falloc; etc) is not shown. Thank you.
 
Old 08-26-2018, 08:39 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Preallocation affects only how the QCOW2 file is created, not how it is later used, and that detail is not recorded in the QCOW2 header. I don't know of any easy way to discover it later. For the data clusters, you can look at the "qemu-img map --output=json" output and see if there are any clusters that have a non-zero offset field but show "false" in the data field. If there are any such clusters, then the preallocation was not "falloc" or "full".

For the metadata area, the only way I can think of is to use "hdparm --fibmap" and look for holes in the metadata area. The presence of holes wpuld indicate that the metadata was not preallocated.

I don't know of any way to distinguish between "falloc" and "full", nor can I think of any reason you would need to know that.

Last edited by rknichols; 08-26-2018 at 08:41 AM.
 
Old 08-27-2018, 01:56 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
I don't get the question. You asked "what kind"?

The info option only has this.

info [-f fmt] filename
Give information about the disk image filename. Use it in particular to know the size reserved on disk which can be different from the displayed size. If VM snapshots are stored in the disk image, they are displayed too.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Image files on qcow2 format with KVM benelux.j Linux - Virtualization and Cloud 4 12-03-2012 11:18 AM
Why can't I just copy a .qcow2 file in KVM, while the VM is stopped, as a backup? rylan76 Linux - Virtualization and Cloud 2 11-05-2012 02:32 PM
kvm-qemu-img: qcow2 disk image format changes to raw format in RHEL-KVM 5.6 rajivdp Linux - Virtualization and Cloud 2 09-19-2011 11:23 AM
How to resize the qcow2 image in the KVM? rajivdp Linux - Virtualization and Cloud 1 03-23-2011 05:36 PM
How to resize the qcow2 image in the KVM? rajivdp Linux - Virtualization and Cloud 2 03-23-2011 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration