Bug 633766
Summary: | virt-resize --shrink fails | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Matthew Booth <mbooth> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED UPSTREAM | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | unspecified | CC: | mbooth, seandarcy, virt-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-07-14 19:15:11 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Matthew Booth
2010-09-14 11:12:19 UTC
Looking at the report, I think the error is a Red Herring. In fact what is happening is: (a) we blindly copy the bootloader from /dev/sda to /dev/sdb (b) we then check the partition table type on /dev/sdb but (b) fails because of parted which gets horribly confused that /dev/sdb now contains a partition table which is outside the disk (/dev/sdb is much smaller than /dev/sda, but we copied the first sector which contains the partition table). Now, we don't care about the partiition table that we just copied over, because we only wanted to copy the bootloader, and we're going to write a completely different partition table later. Bootloader and partition table occupy the same sector, so it's not possible to copy one and not the other. (parted should really just STFU about the problem -- it's not the business of parted to complain about whether the partition table is sensible. I'll add it to the very long list of problems with parted. Anyway ...) The problem comes down to this code: sub repartition { local $_; if ($copy_boot_loader) { $parttype = $g->part_get_parttype ("/dev/sdb"); } else { $parttype = "efi"; } print "partition table type: $parttype\n" if $debug; Matt, can you remove the call to part_get_parttype there and just hard-code "mbr" to see if that fixes the problem? As discussed on IRC, I changed $parttype = $g->part_get_parttype ("/dev/sdb"); to $parttype = $g->part_get_parttype ("/dev/sda"); which I think is more correct in any case. I also changed the section below which does part-del to unconditionally part-init the drive. However, this resulted in the boot loader also being blown away. *** Bug 635298 has been marked as a duplicate of this bug. *** |