Description of problem: virt-resize tools failed to resize the raw format virtual disk image file. it fails with these outputs: virt-resize --expand /dev/sda1 ./centos6u5_64_20G_20140926.raw newdisk.raw Examining centos6u5_64_20G_20140926.raw ... 100% [################################################################################################################################################] --:-- Fatal error: exception Guestfs.Error("part_get_parttype: parted print: /dev/vda: parted: No such file or directory") Version-Release number of selected component (if applicable): RHEL 5.7 x86_64 libguestfs 1.20.8 libguestfs-tools 1.20.8 How reproducible: every times i try. Steps to Reproduce: # 1. list source disk info: # command: virt-filesystems -a ./centos6u5_64_20G_20140926.raw --all -l # outputs: Name Type VFS Label MBR Size Parent /dev/sda1 filesystem ext4 - - 21473787904 - /dev/sda1 partition - - - 21473787904 /dev/sda /dev/sda device - - - 32212254720 - # 2. make a new disk: # command: truncate -s 40G newdisk.raw # 3. try to resize the disk # command: virt-resize --expand /dev/sda1 ./centos6u5_64_20G_20140926.raw newdisk.raw -d # outputs: command line: virt-resize --expand /dev/sda1 ./centos6u5_64_20G_20140926.raw newdisk.raw -d Examining ./centos6u5_64_20G_20140926.raw ... libguestfs: trace: add_drive "./centos6u5_64_20G_20140926.raw" "readonly:true" libguestfs: trace: add_drive = 0 libguestfs: trace: add_drive "newdisk.raw" "readonly:false" libguestfs: trace: add_drive = 0 libguestfs: trace: launch libguestfs: trace: get_tmpdir libguestfs: trace: get_tmpdir = "/tmp" libguestfs: trace: get_cachedir libguestfs: trace: get_cachedir = "/var/tmp" 100% [################################################################################################################################################] --:-- libguestfs: trace: launch = 0 libguestfs: trace: lvm_set_filter "/dev/sda" libguestfs: trace: lvm_set_filter = 0 libguestfs: trace: available "ntfsprogs ntfs3g" libguestfs: trace: available = 0 libguestfs: trace: available "btrfs" libguestfs: trace: available = -1 (error) libguestfs: trace: blockdev_getss "/dev/sdb" libguestfs: trace: blockdev_getss = 512 libguestfs: trace: blockdev_getsize64 "/dev/sda" libguestfs: trace: blockdev_getsize64 = 32212254720 libguestfs: trace: blockdev_getsize64 "/dev/sdb" libguestfs: trace: blockdev_getsize64 = 42949672960 libguestfs: trace: part_get_parttype "/dev/sda" libguestfs: trace: part_get_parttype = NULL (error) ./centos6u5_64_20G_20140926.raw size 32212254720 bytes newdisk.raw size 42949672960 bytes Fatal error: exception Guestfs.Error("part_get_parttype: parted print: /dev/vda: parted: No such file or directory") libguestfs: trace: close libguestfs: trace: internal_autosync libguestfs: trace: internal_autosync = 0 Actual results: Expected results: Additional info:
boot from the original raw image (centos6u5_64_20G_20140926.raw) and check disk: # 1. [root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 30G 0 disk `-sda1 8:1 0 20G 0 part / # 2. [root@localhost ~]# blkid /dev/sda1: UUID="94e4e384-0ace-437f-bc96-057dd64f42ee" TYPE="ext4" # 3. [root@localhost ~]# fdisk /dev/sda -l Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00078f9c Device Boot Start End Blocks Id System /dev/sda1 * 1 2611 20970496 83 Linux # 4. [root@localhost ~]# parted /dev/sda p Model: ATA QEMU HARDDISK (scsi) Disk /dev/sda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 1049kB 21.5GB 21.5GB primary ext4 boot
Hi, and sorry for the late reply. The versions of both RHEL and libguestfs you are using are quite old, and they are not really supported anymore as combination. Is there any chance you can try again with a recent version of libguestfs?