Hide Forgot
Description of problem: If creating a 'disk' storage pool on a device which has 4k sectors, the size of the partitions reported by libvirt will be x8 too small. This is because libvirt incorrectly hardcoded a 512 byte sector size. Version-Release number of selected component (if applicable): 0.9.4-1.el6 How reproducible: Only with 'disk' storage pool on a device with 4k sectors Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: Upstream fix commit b6263c18013e99bab1938d112fc927f948df3eef Author: Daniel P. Berrange <berrange> Date: Tue Aug 23 15:25:28 2011 +0100 Fix parted sector size assumption Parted does not report disk size in 512 byte units, but rather the disks' logical sector size, which with modern drives might be 4k. * src/storage/parthelper.c: Remove hardcoded 512 byte sector size
# fdisk -l Note: sector size is 4096 (not 512) Disk /dev/sdb: 162.8 GB, 162842222592 bytes 255 heads, 63 sectors/track, 2474 cylinders Units = cylinders of 16065 * 4096 = 65802240 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x000d2129 Device Boot Start End Blocks Id System Steps: 1. define disk pool on /dev/sdb 2. build and start /dev/sdb 3. create a vol in the disk pool using vol.xml: <volume> <name>sdb1</name> <key>/dev/sdb1</key> <source> <device path='/dev/sdb'> </device> </source> <capacity unit='M'>10240</capacity> <target> <path>/dev/sdb1</path> </target> </volume> # virsh vol-create sdb vol.xml 4. check the vol info # virsh vol-info sdb1 --pool sdb Results: Step 3: the vol created successfully. Step 4: libvirt-0.9.4-7.2: # virsh vol-info sdb1 --pool sdb Name: sdb1 Type: block Capacity: 1.25 GB Allocation: 1.25 GB libvirt-0.9.4-21: # virsh vol-info sdb1 --pool sdb Name: sdb1 Type: block Capacity: 10.00 GB Allocation: 10.00 GB So libvirt reports the right size now, no factor x8 defect.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html