Bug 1222231 - virt-builder --size fails on debian-7/8 because of updated sfdisk in util-linux 2.62.2
Summary: virt-builder --size fails on debian-7/8 because of updated sfdisk in util-lin...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-16 18:49 UTC by ed.shornock
Modified: 2015-08-25 12:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-25 10:27:29 UTC
Embargoed:


Attachments (Terms of Use)
debugging output (52.29 KB, text/plain)
2015-05-16 18:49 UTC, ed.shornock
no flags Details
resize.txt (93.22 KB, text/plain)
2015-05-21 13:12 UTC, Richard W.M. Jones
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1248115 0 unspecified CLOSED sfdisk: you cannot change a partition into an extended one or vice versa 2021-02-22 00:41:40 UTC

Internal Links: 1248115

Description ed.shornock 2015-05-16 18:49:11 UTC
Created attachment 1026269 [details]
debugging output

Description of problem:
virt-builder fails if the --size parameter is given


Version-Release number of selected component (if applicable):
Debian package 1:1.29.40-1

How reproducible:

Consistently

Steps to Reproduce:
1. virt-builder $distro --size 8G
2.
3.

Actual results:

You cannot change a partition into an extended one or vice versa. Delete it first.
sfdisk: /dev/sdb: partition 2: failed to set partition type
[   19.396359]  sdb: sdb1 sdb2 < sdb5 >
guestfsd: error: sfdisk --part-type: You cannot change a partition into an extended one or vice versa. Delete it first.
sfdisk: /dev/sdb: partition 2: failed to set partition type
guestfsd: mainvirt-resize: error: libguestfs error: part_set_mbr_id: sfdisk --part-type: 
You cannot change a partition into an extended one or vice versa. Delete it 
first.
sfdisk: /dev/sdb: partition 2: failed to set partition type


Expected results:

This operation completing as it did with a previous version.


Additional info:

Comment 1 ed.shornock 2015-05-16 18:55:02 UTC
Note: /mnt (as seen in the logs) is a scratch space with 32GB free.

Comment 2 Richard W.M. Jones 2015-05-16 20:06:10 UTC
The key to this puzzle is what is $distro?

Anyhow this happens because virt-resize cannot resize logical partitions:
http://libguestfs.org/virt-resize.1.html#logical-partitions
so if you point the 'expand' setting at one it isn't going to work.

There is ongoing work upstream to try to support logical
partitions in virt-resize -- see upstream mailing list passim ad nauseam.

Comment 3 ed.shornock 2015-05-16 20:30:01 UTC
In this case $distro was both debian-7 and debian-8.

I found that the culprit is util-linux 2.26.2-3 from Sid. It works with util-linux 2.25.2-6 from Jessie & Stretch.

Comment 4 Richard W.M. Jones 2015-05-21 13:12:17 UTC
Created attachment 1028171 [details]
resize.txt

I think this is because of the upstream rewrite of sfdisk.
See also: https://www.redhat.com/archives/libguestfs/2015-May/msg00080.html

I can reproduce this with util-linux-2.26.2-1.fc23.x86_64

Full log is attached.

Comment 5 Pino Toscano 2015-08-25 10:27:29 UTC
This is a known regression in util-linux 2.26.x, see also 
https://bugzilla.redhat.com/show_bug.cgi?id=1248115#c7

Regarding Debian, either you ask the Debian maintainer of util-linux to backport the upstream commit to the 2.26.2 currently in testing & unstable, or simply wait for util-linux 2.27 to be released and packaged in Debian unstable.

Comment 6 ed.shornock 2015-08-25 12:52:44 UTC
OK. I'm still having the problem with 2.27-rc2 which is available in Debian experimental but I'll try hunting down the commit for 2.26.

Thanks.


Note You need to log in before you can comment on or make changes to this bug.