Bug 1285847

Summary: virt-resize does not copy logical partitions
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: lantw44, ptoscano, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.30.5-2.fc23 libguestfs-1.30.5-2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-06 01:22:02 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:

Description Richard W.M. Jones 2015-11-26 16:27:02 UTC
Description of problem:

Either run virt-resize on a disk with logical partitions, or use
this simple reproducer which does the same thing:

$ virt-builder ubuntu-14.04 --size 20G

After that runs, use virt-filesystems to examine the disk:

$ virt-filesystems -a ubuntu-14.04.img --all --long -h
Name       Type        VFS      Label  MBR  Size  Parent
/dev/sda1  filesystem  ext4     -      -    19G   -
/dev/sda2  filesystem  unknown  -      -    1.0K  -
/dev/sda1  partition   -        -      83   19G   /dev/sda
/dev/sda2  partition   -        -      05   1.0K  /dev/sda
/dev/sda   device      -        -      -    20G   -

Compare this to a non-resized Ubuntu image and you can
see that virt-resize has deleted the /dev/sda5 (swap) partition:

Name       Type        VFS      Label  MBR  Size   Parent
/dev/sda1  filesystem  ext4     -      -    3.0G   -
/dev/sda2  filesystem  unknown  -      -    1.0K   -
/dev/sda5  filesystem  swap     -      -    1022M  -
/dev/sda1  partition   -        -      83   3.0G   /dev/sda
/dev/sda2  partition   -        -      05   1.0K   /dev/sda
/dev/sda5  partition   -        -      82   1022M  /dev/sda
/dev/sda   device      -        -      -    4.0G   -

Version-Release number of selected component (if applicable):

libguestfs-1.30.5
libguestfs-1.31.28

How reproducible:

100%

Steps to Reproduce:

See above.

Additional info:

Original bug report from 'mvo' here:
https://bodhi.fedoraproject.org/updates/libguestfs-1.30.5-1.fc23#comment-358003

Comment 1 Richard W.M. Jones 2015-11-27 10:34:04 UTC
It turns out this is actually caused by the recent sfdisk rewrite,
so it probably affects other versions of libguestfs too.

However I have posted a fix:

https://www.redhat.com/archives/libguestfs/2015-November/msg00203.html
https://www.redhat.com/archives/libguestfs/2015-November/msg00204.html

Comment 2 Fedora Update System 2015-11-28 07:15:42 UTC
libguestfs-1.30.5-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-943e9fb63b

Comment 3 Fedora Update System 2015-11-28 07:15:46 UTC
libguestfs-1.30.5-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-1bf4cbf156

Comment 4 Fedora Update System 2015-11-29 00:54:15 UTC
libguestfs-1.30.5-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update libguestfs'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-1bf4cbf156

Comment 5 Fedora Update System 2015-11-29 02:22:54 UTC
libguestfs-1.30.5-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update libguestfs'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-943e9fb63b

Comment 6 Fedora Update System 2015-12-06 01:21:51 UTC
libguestfs-1.30.5-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2015-12-16 09:53:08 UTC
libguestfs-1.30.5-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.