Bug 1169015
Summary: | virt-resize --expand fails on ubuntu-14.04.img image (regression) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Sylvain Pasche <sylvain.pasche> | ||||||
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> | ||||||
Status: | CLOSED UPSTREAM | QA Contact: | |||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | unspecified | CC: | hutao, mbooth, ptoscano, rbalakri | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 1172659 1172660 (view as bug list) | Environment: | |||||||
Last Closed: | 2014-12-10 14:13:10 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1172659, 1172660 | ||||||||
Attachments: |
|
Description
Sylvain Pasche
2014-11-28 22:47:06 UTC
I forgot the "truncate -s10G 10G.img" command just before running virt-resize. I suspect https://github.com/libguestfs/libguestfs/commit/fc34e2d16c2d13d6ae7a381ba931e345ab5ae56d (which I don't think is wrong) which changes the type we use when creating the extended partition. Previously it would create it as "primary", now it is created as "extended". Looks like it is, if I revert that change it succeeds (tried with libguestfs-1.29.11). Created attachment 965681 [details]
the patch tries to fix this bug.
Please try the attached patch and feedback. Thanks! The root cause of the problem is that the size of an extended partition reported by Linux is alwas 1024 bytes, so when you are writing to the device (such as /dev/sdb2) corresponding to the extended partition, you can only write 1024 bytes. Hu Tao's patch has gone upstream, please try it out: https://github.com/libguestfs/libguestfs/commit/9d6f0b6a86d68438b27a3d783677c63f39ec6627 I tried the patch on top of libguestfs-1.29.13 and the resizing succeeds now with ubuntu-14.04.img. Thanks! Closing / upstream. This is likely to be a problem on Fedora 21 & RHEL 7.1 too, so I am going to clone it. |