Bug 991830 - virt-resize throws ambiguous error when /dev/mapper/VG-LV path is used
virt-resize throws ambiguous error when /dev/mapper/VG-LV path is used
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
Depends On:
  Show dependency treegraph
Reported: 2013-08-04 15:13 EDT by Kashyap Chamarthy
Modified: 2015-01-19 07:24 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kashyap Chamarthy 2013-08-04 15:13:49 EDT
Description of problem:

When attepmting to resize an LVM inside a Fedora guest, and presented
with device mapper LVM ID:

    $ virt-resize -d --expand /dev/sda3 --lv-expand \
      /dev/mapper/VolGroup00-LogVol00 f19ostk.dsk f19ostk.dsk.new

It fails saying no logical volume is present.

However, from inside the guest, /dev/mapper/VolGroup00-LogVol00 is a symbolic
link to block device /dev/dm-0:

    $ file /dev/mapper/VolGroup00-LogVol00
   /dev/mapper/VolGroup00-LogVol00: symbolic link to `../dm-0'
    $ ls -al /dev/mapper/VolGroup00-LogVol00 
    lrwxrwxrwx. 1 root root 7 Aug  4 14:52 /dev/mapper/VolGroup00-LogVol00 -> ../dm-0


    $ uname -r ; rpm -q qemu-kvm libvirt-daemon-kvm libguestfs \

How reproducible:

Steps to Reproduce:

1. Ensure the guest (Fedora 19 in this case) to be resized is OFFLINE.

2. Get the disk info from *inside* the guest

    $ df -hT
    Filesystem                      Type      Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00 ext4      8.1G  785M  6.9G  11% /
    devtmpfs                        devtmpfs  491M     0  491M   0% /dev
    tmpfs                           tmpfs     498M     0  498M   0% /dev/shm
    tmpfs                           tmpfs     498M  300K  498M   1% /run
    tmpfs                           tmpfs     498M     0  498M   0% /sys/fs/cgroup
    tmpfs                           tmpfs     498M   12K  498M   1% /tmp
    /dev/vda2                       ext4      190M   61M  119M  34% /boot:

3. Extend the the guest to desired size using truncate(1)

    $ truncate -r f19ostk.raw f19ostk.raw.new
    $ truncate -s +15G f19ostk.raw.new

4. Try to resize the guest using the device mapper id:

    $ virt-resize -d --expand /dev/sda3 --lv-expand \
    /dev/mapper/VolGroup00-LogVol00 f19ostk.dsk f19ostk.dsk.new

Actual results:

Resize fails with the below message:

  virt-resize: error: /dev/mapper/VolGroup00-LogVol00: logical volume not 
  found in the source disk image (this error came from '--lv-expand' 
  option on the command line).  Try running this command: 
  virt-filesystems --logical-volumes --long -a f19ostk.dsk

Expected results:

Throw a reasonable error message at-least.

Additional info:

The test succeeds, when you present the actual Logical Volume (/dev/VG/LV).

List the filesystems inside the guest:

    $ virt-filesystems --long -h -a /var/lib/libvirt/images/f19ostk.dsk
    Name                      Type        VFS   Label  Size  Parent
    /dev/sda2                 filesystem  ext4  -      200M  -
    /dev/VolGroup00/LogVol00  filesystem  ext4  -      8.3G  -

Perform the re-size by presenting path to the Logical Volume (to the --lv-expand parameter:

    $ virt-resize -d --expand /dev/sda3 --lv-expand \
    /dev/mapper/VolGroup00/LogVol00 f19ostk.dsk f19ostk.dsk.new
Comment 1 Richard W.M. Jones 2013-08-04 15:20:23 EDT
The problem is use of /dev/mapper/VG-LV instead of /dev/VG/LV.
We should at least produce a decent error message about this.
Comment 2 Fedora End Of Life 2015-01-09 14:17:03 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

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