Bug 633766 - virt-resize --shrink fails
Summary: virt-resize --shrink fails
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
: 635298 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-14 11:12 UTC by Matthew Booth
Modified: 2011-07-14 19:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-14 19:15:11 UTC
Embargoed:


Attachments (Terms of Use)

Description Matthew Booth 2010-09-14 11:12:19 UTC
Description of problem:
$ ls -l foo 
-rw-r--r--. 1 mbooth mbooth 3670016000 Sep 14 12:07 foo
$ LIBGUESTFS_DEBUG=1 virt-resize --debug --shrink /dev/vda2 RHEL-4.8-32.raw foo
new guestfs handle 0x10e7e60
looking for supermin appliance in /usr/lib64/guestfs
[00000ms] begin building supermin appliance
[00000ms] umask 0002; febootstrap-supermin-helper --verbose -k '/usr/lib64/guestfs/kmod.whitelist' '/usr/lib64/guestfs/supermin.d' x86_64 /tmp/libguestfsbTfzfl/kernel /tmp/libguestfsbTfzfl/initrd
supermin helper [00000ms] whitelist = /usr/lib64/guestfs/kmod.whitelist, host_cpu = x86_64, kernel = /tmp/libguestfsbTfzfl/kernel, initrd = /tmp/libguestfsbTfzfl/initrd, appliance = /tmp/libguestfsbTfzfl/initrd
supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/2.6.32.11-105.fc12.x86_64 is a directory
checking modpath /lib/modules/2.6.34.6-47.fc13.x86_64 is a directory
picked vmlinuz-2.6.34.6-47.fc13.x86_64 because modpath /lib/modules/2.6.34.6-47.fc13.x86_64 exists
checking modpath /lib/modules/2.6.34.6-54.fc13.x86_64 is a directory
picked vmlinuz-2.6.34.6-54.fc13.x86_64 because modpath /lib/modules/2.6.34.6-54.fc13.x86_64 exists
checking modpath /lib/modules/2.6.32.11-104.fc12.x86_64 is a directory
checking modpath /lib/modules/2.6.32.12-115.fc12.x86_64 is a directory
checking modpath /lib/modules/2.6.30.8-64.fc11.x86_64 is a directory
checking modpath /lib/modules/2.6.30.9-90.fc11.x86_64 is a directory
checking modpath /lib/modules/2.6.30.9-96.fc11.x86_64 is a directory
checking modpath /lib/modules/2.6.34.3-37.fc13.x86_64 is a directory
picked vmlinuz-2.6.34.3-37.fc13.x86_64 because modpath /lib/modules/2.6.34.3-37.fc13.x86_64 exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00001ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00002ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [00180ms] finished creating appliance
[00184ms] finished building supermin appliance
[00184ms] begin testing qemu features
null_vmchannel_sock = 35496
[00198ms] finished testing qemu features
/usr/bin/qemu-kvm \
   accept_from_daemon: 0x10e7e60 g->state = 0
 -drive file=RHEL-4.8-32.raw,snapshot=on,if=virtio \
    -drive file=foo,cache=off,if=virtio \
    -enable-kvm \
    -nodefaults \
    -nographic \
    -serial stdio \
    -m 500 \
    -no-reboot \
    -no-hpet \
    -net user,vlan=0,net=169.254.0.0/16 \
    -net nic,model=virtio,vlan=0 \
    -kernel /tmp/libguestfsbTfzfl/kernel \
    -initrd /tmp/libguestfsbTfzfl/initrd \
    -append 'panic=1 console=ttyS0 udevtimeout=300 noapic acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_vmchannel=tcp:169.254.2.2:35496 guestfs_verbose=1 TERM=xterm '
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.34.6-54.fc13.x86_64 (mockbuild.fedoraproject.org) (gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) ) #1 SMP Sun Sep 5 17:16:27 UTC 2010
Command line: panic=1 console=ttyS0 udevtimeout=300 noapic acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_vmchannel=tcp:169.254.2.2:35496 guestfs_verbose=1 TERM=xterm 
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009f400 (usable)
 BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001f3fd000 (usable)
 BIOS-e820: 000000001f3fd000 - 000000001f400000 (reserved)
 BIOS-e820: 00000000fffbc000 - 0000000100000000 (reserved)
NX (Execute Disable) protection: active
DMI 2.4 present.
No AGP bridge found
last_pfn = 0x1f3fd max_arch_pfn = 0x400000000
PAT not supported by CPU.
found SMP MP-table at [ffff8800000f7ff0] f7ff0
init_memory_mapping: 0000000000000000-000000001f3fd000
RAMDISK: 19306000 - 1f3ef000
No NUMA configuration found
Faking a node at 0000000000000000-000000001f3fd000
Initmem setup node 0 0000000000000000-000000001f3fd000
  NODE_DATA [0000000001e0b080 - 0000000001e1f07f]
  bootmap [0000000001e20000 -  0000000001e23e7f] pages 4
(12/32 early reservations) ==> bootmem [0000000000 - 001f3fd000]
  #0 [0001000000 - 0001e0ae88]    TEXT DATA BSS ==> [0001000000 - 0001e0ae88]
  #1 [0019306000 - 001f3ef000]          RAMDISK ==> [0019306000 - 001f3ef000]
  #2 [0001e0b000 - 0001e0b049]              BRK ==> [0001e0b000 - 0001e0b049]
  #3 [000009f400 - 00000f7ff0]    BIOS reserved ==> [000009f400 - 00000f7ff0]
  #4 [00000f7ff0 - 00000f8000]     MP-table mpf ==> [00000f7ff0 - 00000f8000]
  #5 [00000f80e8 - 0000100000]    BIOS reserved ==> [00000f80e8 - 0000100000]
  #6 [00000f8000 - 00000f80e8]     MP-table mpc ==> [00000f8000 - 00000f80e8]
  #7 [0000001000 - 0000003000]       TRAMPOLINE ==> [0000001000 - 0000003000]
  #8 [0000003000 - 0000007000]      ACPI WAKEUP ==> [0000003000 - 0000007000]
  #9 [0000008000 - 0000009000]          PGTABLE ==> [0000008000 - 0000009000]
  #10 [0001e0b080 - 0001e1f080]        NODE_DATA ==> [0001e0b080 - 0001e1f080]
  #11 [0001e20000 - 0001e24000]          BOOTMAP ==> [0001e20000 - 0001e24000]
kvm-clock: cpu 0, msr 0:1bad341, boot clock
Zone PFN ranges:
  DMA      0x00000001 -> 0x00001000
  DMA32    0x00001000 -> 0x00100000
  Normal   empty
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    0: 0x00000001 -> 0x0000009f
    0: 0x00000100 -> 0x0001f3fd
SFI: Simple Firmware Interface v0.7 http://simplefirmware.org
Intel MultiProcessor Specification v1.4
MPTABLE: OEM ID: BOCHSCPU
MPTABLE: Product ID: 0.1         
MPTABLE: APIC at: 0xFEE00000
Processor #0 (Bootup-CPU)
I/O APIC #1 Version 17 at 0xFEC00000.
Processors: 1
SMP: Allowing 1 CPUs, 0 hotplug CPUs
PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
PM: Registered nosave memory: 00000000000a0000 - 00000000000f0000
PM: Registered nosave memory: 00000000000f0000 - 0000000000100000
Allocating PCI resources starting at 1f400000 (gap: 1f400000:e0bbc000)
Booting paravirtualized kernel on KVM
setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:1 nr_node_ids:1
PERCPU: Embedded 29 pages/cpu @ffff880002000000 s89768 r8192 d20824 u2097152
pcpu-alloc: s89768 r8192 d20824 u2097152 alloc=1*2097152
pcpu-alloc: [0] 0 
kvm-clock: cpu 0, msr 0:2015341, primary cpu clock
Built 1 zonelists in Node order, mobility grouping on.  Total pages: 126047
Policy zone: DMA32
Kernel command line: panic=1 console=ttyS0 udevtimeout=300 noapic acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_vmchannel=tcp:169.254.2.2:35496 guestfs_verbose=1 TERM=xterm 
[    0.000000] Disabling memory control group subsystem
[    0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[    0.000000] Checking aperture...
[    0.000000] No AGP bridge found
[    0.000000] Memory: 389312k/511988k available (4435k kernel code, 392k absent, 122284k reserved, 7432k data, 920k init)
[    0.000000] SLUB: Genslabs=14, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:16640 nr_irqs:256
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [ttyS0] enabled
[    0.000000] Detected 2792.830 MHz processor.
[    0.002999] Calibrating delay loop (skipped) preset value.. 5585.66 BogoMIPS (lpj=2792830)
[    0.004043] Security Framework initialized
[    0.005022] SELinux:  Disabled at boot.
[    0.006114] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.011169] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[    0.014307] Mount-cache hash table entries: 256
[    0.016413] Initializing cgroup subsys ns
[    0.018016] Initializing cgroup subsys cpuacct
[    0.020006] Initializing cgroup subsys memory
[    0.021039] Initializing cgroup subsys devices
[    0.023016] Initializing cgroup subsys freezer
[    0.025009] Initializing cgroup subsys net_cls
[    0.027009] Initializing cgroup subsys blkio
[    0.029137] mce: CPU supports 10 MCE banks
[    0.031009] Performance Events: unsupported p6 CPU model 2 no PMU driver, software events only.
[    0.034194] SMP alternatives: switching to UP code
[    0.122008] Freeing SMP alternatives: 36k freed
[    0.122971] ftrace: converting mcount calls to 0f 1f 44 00 00
[    0.123011] ftrace: allocating 20499 entries in 81 pages
[    0.159167] Setting APIC routing to flat
[    0.160134] CPU0: Intel QEMU Virtual CPU version 0.13.50 stepping 03
[    0.264356] Brought up 1 CPUs
[    0.265003] Total of 1 processors activated (5585.66 BogoMIPS).
[    0.266286] devtmpfs: initialized
[    0.271527] Time: 11:07:34  Date: 09/14/10
[    0.272058] NET: Registered protocol family 16
[    0.273273] PCI: Using configuration type 1 for base access
[    0.276340] bio: create slab <bio-0> at 0
[    0.277122] ACPI: Interpreter disabled.
[    0.278063] vgaarb: loaded
[    0.279152] SCSI subsystem initialized
[    0.280209] usbcore: registered new interface driver usbfs
[    0.281015] usbcore: registered new interface driver hub
[    0.283038] usbcore: registered new device driver usb
[    0.285115] PCI: Probing PCI hardware
[    0.288174] pci 0000:00:01.3: quirk: [io  0xb000-0xb03f] claimed by PIIX4 ACPI
[    0.290013] pci 0000:00:01.3: quirk: [io  0xb100-0xb10f] claimed by PIIX4 SMB
[    0.294942] pci 0000:00:01.0: PIIX/ICH IRQ router [8086:7000]
[    0.296328] NetLabel: Initializing
[    0.297001] NetLabel:  domain hash size = 128
[    0.298001] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.299075] NetLabel:  unlabeled traffic allowed by default
[    0.301131] Switching to clocksource kvm-clock
[    0.321785] pnp: PnP ACPI: disabled
[    0.323058] NET: Registered protocol family 2
[    0.324241] IP route cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.326246] TCP established hash table entries: 16384 (order: 6, 262144 bytes)
[    0.328346] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    0.330305] TCP: Hash tables configured (established 16384 bind 16384)
[    0.331903] TCP reno registered
[    0.332794] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.335121] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.337649] NET: Registered protocol family 1
[    0.339412] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    0.341593] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    0.343049] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    0.344703] Trying to unpack rootfs image as initramfs...
[    0.666702] Freeing initrd memory: 99236k freed
[    0.726111] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.728760] audit: initializing netlink socket (disabled)
[    0.730667] type=2000 audit(1284462455.730:1): initialized
[    0.743188] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.746114] VFS: Disk quotas dquot_6.5.2
[    0.747140] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.749378] msgmni has been set to 954
[    0.750680] alg: No test for stdrng (krng)
[    0.752038] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.754127] io scheduler noop registered
[    0.755312] io scheduler deadline registered
[    0.756625] io scheduler cfq registered (default)
[    0.758496] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.760666] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.762785] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.764335] pci-stub: invalid id string ""
[    0.767070] Non-volatile memory driver v1.3
[    0.768097] Linux agpgart interface v0.103
[    0.769174] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
<FF>[    1.016542] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    1.024184] brd: module loaded
[    1.026895] loop: module loaded
[    1.028038] scsi0 : ata_piix
[    1.029245] scsi1 : ata_piix
[    1.029945] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc000 irq 14
[    1.032265] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc008 irq 15
[    1.034506] Fixed MDIO Bus: probed
[    1.035493] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.037242] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.038850] uhci_hcd: USB Universal Host Controller Interface driver
[    1.040442] PNP: No PS/2 controller found. Probing ports directly.
[    1.042603] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.044524] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.046644] mice: PS/2 mouse device common for all mice
[    1.048943] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[    1.052325] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    1.053929] rtc0: alarms up to one day, 114 bytes nvram
[    1.058575] device-mapper: uevent: version 1.0.3
[    1.059798] device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: dm-devel
[    1.061914] cpuidle: using governor ladder
[    1.062916] cpuidle: using governor menu
[    1.064227] usbcore: registered new interface driver hiddev
[    1.065648] usbcore: registered new interface driver usbhid
[    1.067057] usbhid: USB HID core driver
[    1.068003] nf_conntrack version 0.5.0 (3817 buckets, 15268 max)
[    1.069627] CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
[    1.071474] nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
[    1.073543] sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
[    1.075100] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.076884] TCP cubic registered
[    1.078227] Initializing XFRM netlink socket
[    1.080469] NET: Registered protocol family 17
[    1.082335] registered taskstats version 1
[    1.083915] No TPM chip found, activating TPM-bypass!
[    1.086299]   Magic number: 10:300:125
[    1.087349] rtc_cmos rtc_cmos: setting system clock to 2010-09-14 11:07:35 UTC (1284462455)
[    1.089357] Initalizing network drop monitor service
[    1.186179] Freeing unused kernel memory: 920k freed
[    1.190175] Write protecting the kernel read-only data: 10240k
[    1.196622] Freeing unused kernel memory: 1688k freed
[    1.200109] Freeing unused kernel memory: 1944k freed
Starting /init script ...
Starting udev: [    1.350223] udev: starting version 153
[    1.489403] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input1
[    1.513219] virtio-pci 0000:00:02.0: found PCI INT A -> IRQ 10
[    1.570317] piix4_smbus 0000:00:01.3: SMBus Host Controller at 0xb100, revision 0
[    1.590273] virtio-pci 0000:00:03.0: found PCI INT A -> IRQ 11
[    1.591975] virtio-pci 0000:00:04.0: found PCI INT A -> IRQ 11
[    1.669276]  vda: vda1 vda2
[    1.694252]  vdb: vdb1 vdb2
[    1.697932] vdb: p2 size 41720805 exceeds device capacity, limited to end of disk
[  OK  ]^M
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup00" using metadata type lvm2
  1 logical volume(s) in volume group "VolGroup00" now active
total 0
lrwxrwxrwx 1 root root          13 Sep 14 12:07 MAKEDEV -> /sbin/MAKEDEV
drwxr-xr-x 2 root root          60 Sep 14 12:07 VolGroup00
drwxr-xr-x 2 root root         660 Sep 14 12:07 block
drwxr-xr-x 2 root root        2060 Sep 14 11:07 char
crw------- 1 root root      5,   1 Sep 14 11:07 console
lrwxrwxrwx 1 root root          11 Sep 14 12:07 core -> /proc/kcore
drwxr-xr-x 3 root root          60 Sep 14 12:07 cpu
crw-rw---- 1 root root     10,  61 Sep 14 11:07 cpu_dma_latency
drwxr-xr-x 5 root root         100 Sep 14 12:07 disk
brw-rw---- 1 root disk    253,   0 Sep 14 12:07 dm-0
lrwxrwxrwx 1 root root          13 Sep 14 12:07 fd -> /proc/self/fd
crw-rw-rw- 1 root root      1,   7 Sep 14 11:07 full
crw-rw-rw- 1 root root     10, 229 Sep 14 12:07 fuse
drwxr-xr-x 2 root root          40 Sep 14 12:07 hugepages
drwxr-xr-x 3 root root         140 Sep 14 11:07 input
crw-rw---- 1 root root      1,  11 Sep 14 11:07 kmsg
brw-rw---- 1 root disk      7,   0 Sep 14 11:07 loop0
brw-rw---- 1 root disk      7,   1 Sep 14 11:07 loop1
brw-rw---- 1 root disk      7,   2 Sep 14 11:07 loop2
brw-rw---- 1 root disk      7,   3 Sep 14 11:07 loop3
brw-rw---- 1 root disk      7,   4 Sep 14 11:07 loop4
brw-rw---- 1 root disk      7,   5 Sep 14 11:07 loop5
brw-rw---- 1 root disk      7,   6 Sep 14 11:07 loop6
brw-rw---- 1 root disk      7,   7 Sep 14 11:07 loop7
crw-rw---- 1 root lp        6,   0 Sep 14 12:07 lp0
crw-rw---- 1 root lp        6,   1 Sep 14 12:07 lp1
crw-rw---- 1 root lp        6,   2 Sep 14 12:07 lp2
crw-rw---- 1 root lp        6,   3 Sep 14 12:07 lp3
drwxr-xr-x 2 root root          80 Sep 14 12:07 mapper
crw-rw---- 1 root root     10, 227 Sep 14 11:07 mcelog
crw-r----- 1 root kmem      1,   1 Sep 14 11:07 mem
drwxr-xr-x 2 root root          60 Sep 14 12:07 net
crw-rw---- 1 root root     10,  60 Sep 14 11:07 network_latency
crw-rw---- 1 root root     10,  59 Sep 14 11:07 network_throughput
crw-rw-rw- 1 root root      1,   3 Sep 14 11:07 null
crw-r----- 1 root kmem     10, 144 Sep 14 11:07 nvram
crw-rw---- 1 root root      1,  12 Sep 14 11:07 oldmem
crw-r----- 1 root kmem      1,   4 Sep 14 11:07 port
crw------- 1 root root    108,   0 Sep 14 12:07 ppp
crw-rw-rw- 1 root tty       5,   2 Sep 14 11:07 ptmx
drwxr-xr-x 2 root root          40 Sep 14 12:07 pts
brw-rw---- 1 root disk      1,   0 Sep 14 11:07 ram0
brw-rw---- 1 root disk      1,   1 Sep 14 11:07 ram1
brw-rw---- 1 root disk      1,  10 Sep 14 11:07 ram10
brw-rw---- 1 root disk      1,  11 Sep 14 11:07 ram11
brw-rw---- 1 root disk      1,  12 Sep 14 11:07 ram12
brw-rw---- 1 root disk      1,  13 Sep 14 11:07 ram13
brw-rw---- 1 root disk      1,  14 Sep 14 11:07 ram14
brw-rw---- 1 root disk      1,  15 Sep 14 11:07 ram15
brw-rw---- 1 root disk      1,   2 Sep 14 11:07 ram2
brw-rw---- 1 root disk      1,   3 Sep 14 11:07 ram3
brw-rw---- 1 root disk      1,   4 Sep 14 11:07 ram4
brw-rw---- 1 root disk      1,   5 Sep 14 11:07 ram5
brw-rw---- 1 root disk      1,   6 Sep 14 11:07 ram6
brw-rw---- 1 root disk      1,   7 Sep 14 11:07 ram7
brw-rw---- 1 root disk      1,   8 Sep 14 11:07 ram8
brw-rw---- 1 root disk      1,   9 Sep 14 11:07 ram9
crw-rw-rw- 1 root root      1,   8 Sep 14 11:07 random
drwxr-xr-x 2 root root          60 Sep 14 12:07 raw
lrwxrwxrwx 1 root root           4 Sep 14 12:07 rtc -> rtc0
crw-rw---- 1 root root    254,   0 Sep 14 12:07 rtc0
drwxr-xr-x 2 root root          40 Sep 14 12:07 shm
crw-rw---- 1 root root     10, 231 Sep 14 11:07 snapshot
lrwxrwxrwx 1 root root          15 Sep 14 12:07 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root          15 Sep 14 12:07 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root          15 Sep 14 12:07 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root tty       5,   0 Sep 14 11:07 tty
crw--w---- 1 root tty       4,   0 Sep 14 11:07 tty0
crw--w---- 1 root tty       4,   1 Sep 14 11:07 tty1
crw--w---- 1 root tty       4,  10 Sep 14 11:07 tty10
crw--w---- 1 root tty       4,  11 Sep 14 11:07 tty11
crw--w---- 1 root tty       4,  12 Sep 14 11:07 tty12
crw--w---- 1 root tty       4,  13 Sep 14 11:07 tty13
crw--w---- 1 root tty       4,  14 Sep 14 11:07 tty14
crw--w---- 1 root tty       4,  15 Sep 14 11:07 tty15
crw--w---- 1 root tty       4,  16 Sep 14 11:07 tty16
crw--w---- 1 root tty       4,  17 Sep 14 11:07 tty17
crw--w---- 1 root tty       4,  18 Sep 14 11:07 tty18
crw--w---- 1 root tty       4,  19 Sep 14 11:07 tty19
crw--w---- 1 root tty       4,   2 Sep 14 11:07 tty2
crw--w---- 1 root tty       4,  20 Sep 14 11:07 tty20
crw--w---- 1 root tty       4,  21 Sep 14 11:07 tty21
crw--w---- 1 root tty       4,  22 Sep 14 11:07 tty22
crw--w---- 1 root tty       4,  23 Sep 14 11:07 tty23
crw--w---- 1 root tty       4,  24 Sep 14 11:07 tty24
crw--w---- 1 root tty       4,  25 Sep 14 11:07 tty25
crw--w---- 1 root tty       4,  26 Sep 14 11:07 tty26
crw--w---- 1 root tty       4,  27 Sep 14 11:07 tty27
crw--w---- 1 root tty       4,  28 Sep 14 11:07 tty28
crw--w---- 1 root tty       4,  29 Sep 14 11:07 tty29
crw--w---- 1 root tty       4,   3 Sep 14 11:07 tty3
crw--w---- 1 root tty       4,  30 Sep 14 11:07 tty30
crw--w---- 1 root tty       4,  31 Sep 14 11:07 tty31
crw--w---- 1 root tty       4,  32 Sep 14 11:07 tty32
crw--w---- 1 root tty       4,  33 Sep 14 11:07 tty33
crw--w---- 1 root tty       4,  34 Sep 14 11:07 tty34
crw--w---- 1 root tty       4,  35 Sep 14 11:07 tty35
crw--w---- 1 root tty       4,  36 Sep 14 11:07 tty36
crw--w---- 1 root tty       4,  37 Sep 14 11:07 tty37
crw--w---- 1 root tty       4,  38 Sep 14 11:07 tty38
crw--w---- 1 root tty       4,  39 Sep 14 11:07 tty39
crw--w---- 1 root tty       4,   4 Sep 14 11:07 tty4
crw--w---- 1 root tty       4,  40 Sep 14 11:07 tty40
crw--w---- 1 root tty       4,  41 Sep 14 11:07 tty41
crw--w---- 1 root tty       4,  42 Sep 14 11:07 tty42
crw--w---- 1 root tty       4,  43 Sep 14 11:07 tty43
crw--w---- 1 root tty       4,  44 Sep 14 11:07 tty44
crw--w---- 1 root tty       4,  45 Sep 14 11:07 tty45
crw--w---- 1 root tty       4,  46 Sep 14 11:07 tty46
crw--w---- 1 root tty       4,  47 Sep 14 11:07 tty47
crw--w---- 1 root tty       4,  48 Sep 14 11:07 tty48
crw--w---- 1 root tty       4,  49 Sep 14 11:07 tty49
crw--w---- 1 root tty       4,   5 Sep 14 11:07 tty5
crw--w---- 1 root tty       4,  50 Sep 14 11:07 tty50
crw--w---- 1 root tty       4,  51 Sep 14 11:07 tty51
crw--w---- 1 root tty       4,  52 Sep 14 11:07 tty52
crw--w---- 1 root tty       4,  53 Sep 14 11:07 tty53
crw--w---- 1 root tty       4,  54 Sep 14 11:07 tty54
crw--w---- 1 root tty       4,  55 Sep 14 11:07 tty55
crw--w---- 1 root tty       4,  56 Sep 14 11:07 tty56
crw--w---- 1 root tty       4,  57 Sep 14 11:07 tty57
crw--w---- 1 root tty       4,  58 Sep 14 11:07 tty58
crw--w---- 1 root tty       4,  59 Sep 14 11:07 tty59
crw--w---- 1 root tty       4,   6 Sep 14 11:07 tty6
crw--w---- 1 root tty       4,  60 Sep 14 11:07 tty60
crw--w---- 1 root tty       4,  61 Sep 14 11:07 tty61
crw--w---- 1 root tty       4,  62 Sep 14 11:07 tty62
crw--w---- 1 root tty       4,  63 Sep 14 11:07 tty63
crw--w---- 1 root tty       4,   7 Sep 14 11:07 tty7
crw--w---- 1 root tty       4,   8 Sep 14 11:07 tty8
crw--w---- 1 root tty       4,   9 Sep 14 11:07 tty9
crw-rw---- 1 root dialout   4,  64 Sep 14 12:07 ttyS0
crw-rw---- 1 root dialout   4,  65 Sep 14 12:07 ttyS1
crw-rw---- 1 root dialout   4,  66 Sep 14 12:07 ttyS2
crw-rw---- 1 root dialout   4,  67 Sep 14 12:07 ttyS3
crw-rw-rw- 1 root root      1,   9 Sep 14 11:07 urandom
crw-rw---- 1 root root    252,   0 Sep 14 11:07 usbmon0
crw-rw---- 1 vcsa tty       7,   0 Sep 14 11:07 vcs
crw-rw---- 1 vcsa tty       7,   1 Sep 14 11:07 vcs1
crw-rw---- 1 vcsa tty       7, 128 Sep 14 11:07 vcsa
crw-rw---- 1 vcsa tty       7, 129 Sep 14 11:07 vcsa1
brw-rw---- 1 root disk    252,   0 Sep 14 11:07 vda
brw-rw---- 1 root disk    252,   1 Sep 14 11:07 vda1
brw-rw---- 1 root disk    252,   2 Sep 14 11:07 vda2
brw-rw---- 1 root disk    252,  16 Sep 14 11:07 vdb
brw-rw---- 1 root disk    252,  17 Sep 14 11:07 vdb1
brw-rw---- 1 root disk    252,  18 Sep 14 11:07 vdb2
crw-rw---- 1 root root     10,  63 Sep 14 11:07 vga_arbiter
crw-rw-rw- 1 root root      1,   5 Sep 14 11:07 zero
rootfs / rootfs rw 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
none /dev devtmpfs rw,relatime,size=194672k,nr_inodes=48668,mode=755 0 0
  PV         VG         Fmt  Attr PSize PFree
  /dev/vda2  VolGroup00 lvm2 a-   3.19g    0 
  VG         #PV #LV #SN Attr   VSize VFree
  VolGroup00   1   1   0 wz--n- 3.19g    0 
  LV       VG         Attr   LSize Origin Snap%  Move Log Copy%  Convert
  LogVol00 VolGroup00 -wi-a- 3.19g                                      
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          inet addr:169.254.2.10  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         169.254.2.2     0.0.0.0         UG        0 0          0 eth0
Module                  Size  Used by
virtio_blk              4647  2 
virtio_net             13773  0 
i2c_piix4              11942  0 
i2c_core               25709  1 i2c_piix4
virtio_pci              6235  0 
virtio_ring             6178  3 virtio_blk,virtio_net,virtio_pci
virtio                  4290  3 virtio_blk,virtio_net,virtio_pci
Tue Sep 14 12:07:37 BST 2010
uptime: 3.43 1.43
verbose daemon enabled
linux commmand line: panic=1 console=ttyS0 udevtimeout=300 noapic acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_vmchannel=tcp:169.254.2.2:35496 guestfs_verbose=1 TERM=xterm 

vmchannel: tcp:169.254.2.2:35496
recv_from_daemon: 0x10e7e60 g->state = 1, size_rtn = 0x7fff867db5ec, buf_rtn = 0x7fff867db588
[09713ms] appliance is up
send_to_daemon: 0x10e7e60 g->state = 3, n = 40
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db55c, buf_rtn = 0x7fff867db550
blockdev --getss /dev/vdb
proc 59 (blockdev_getss) took 0.00 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 40
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db53c, buf_rtn = 0x7fff867db530
Testing if this parted supports '-m' option.
parted -s -m /dev/null
parted -m -- /dev/vda unit b print
parted output:
BYT;
/dev/vda:21474836480B:virtblk:512:512:msdos:Virtio Block Device;
1:32256B:106928639B:106896384B:ext3::boot;
2:106928640B:21467980799B:21361052160B:::lvm;
<END>
proc 213 (part_list) took 0.03 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 44
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db55c, buf_rtn = 0x7fff867db550
parted -m -- /dev/vda unit b print
parted output:
BYT;
/dev/vda:21474836480B:virtblk:512:512:msdos:Virtio Block Device;
1:32256B:106928639B:106896384B:ext3::boot;
2:106928640B:21467980799B:21361052160B:::lvm;
<END>
proc 234 (part_get_bootable) took 0.02 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 44
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db55c, buf_rtn = 0x7fff867db550
sfdisk --print-id /dev/vda 1
proc 235 (part_get_mbr_id) took 0.01 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 44
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db55c, buf_rtn = 0x7fff867db550
parted -m -- /dev/vda unit b print
parted output:
BYT;
/dev/vda:21474836480B:virtblk:512:512:msdos:Virtio Block Device;
1:32256B:106928639B:106896384B:ext3::boot;
2:106928640B:21467980799B:21361052160B:::lvm;
<END>
proc 234 (part_get_bootable) took 0.03 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 44
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db55c, buf_rtn = 0x7fff867db550
sfdisk --print-id /dev/vda 2
proc 235 (part_get_mbr_id) took 0.01 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 28
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db55c, buf_rtn = 0x7fff867db550
lvm pvs -o pv_name,pv_uuid,pv_fmt,pv_size,dev_size,pv_free,pv_used,pv_attr,pv_pe_count,pv_pe_alloc_count,pv_tags,pe_start,pv_mda_count,pv_mda_free --unbuffered --noheadings --nosuffix --separator , --units b
File descriptor 3 (socket:[9162]) leaked on lvm invocation. Parent PID 1: guestfsd
proc 12 (pvs_full) took 0.02 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 44
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db56c, buf_rtn = 0x7fff867db560
blkid -o value -s TYPE /dev/vda1
proc 198 (vfs_type) took 0.00 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 52
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db56c, buf_rtn = 0x7fff867db560
mount -o ro /dev/vda1 /sysroot/
[    3.949302] kjournald starting.  Commit interval 5 seconds
[    3.950549] EXT3-fs (vda1): mounted filesystem with ordered data mode
proc 73 (mount_ro) took 0.01 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 36
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db50c, buf_rtn = 0x7fff867db500
proc 54 (statvfs) took 0.00 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 28
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db58c, buf_rtn = 0x7fff867db580
mount
umount /sysroot
proc 47 (umount_all) took 0.01 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 44
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db56c, buf_rtn = 0x7fff867db560
blkid -o value -s TYPE /dev/vda2
proc 198 (vfs_type) took 0.00 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 28
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db57c, buf_rtn = 0x7fff867db570
lvm lvs -o vg_name,lv_name --noheadings --separator /
File descriptor 3 (socket:[9162]) leaked on lvm invocation. Parent PID 1: guestfsd
proc 11 (lvs) took 0.02 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 56
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db56c, buf_rtn = 0x7fff867db560
blkid -o value -s TYPE /dev/VolGroup00/LogVol00
proc 198 (vfs_type) took 0.01 seconds
send_to_daemon: 0x10e7e60 g->state = 3, n = 40
recv_from_daemon: 0x10e7e60 g->state = 3, size_rtn = 0x7fff867db56c, buf_rtn = 0x7fff867db560
parted -m -- /dev/vdb unit b print
guestfsd: error: parted print: /dev/vdb: ^M                                                                          ^MError: Can't have a partition outside the disk!

proc 214 (part_get_parttype) took 0.17 seconds
part_get_parttype: parted print: /dev/vdb: ^M                                                                          ^MError: Can't have a partition outside the disk!
RHEL-4.8-32.raw size 21474836480 bytes
foo size 3670016000 bytes
copying boot loader ...
partitions found: /dev/sda1, /dev/sda2
/dev/sda1:
        bootable = 1
        can_expand_content = 1
        expand_content_method = resize2fs
        fssize = 103512064
        mbr_id = 131
        name = /dev/sda1
        part_end = 106928639
        part_num = 1
        part_size = 106896384
        part_start = 32256
        type = ext3
/dev/sda2:
        bootable = 0
        can_expand_content = 1
        expand_content_method = pvresize
        fssize = 3422552064
        mbr_id = 142
        name = /dev/sda2
        part_end = 21467980799
        part_num = 2
        part_size = 21361052160
        part_start = 106928640
        type = LVM2_member
surplus before --expand or --shrink: -17800160768 (-16.6G)
Summary of changes:
/dev/sda1: partition will be left alone
/dev/sda2: partition will be resized from 19.9G to 3.3G
closing guestfs handle 0x10e7e60 (state 2)
sending SIGTERM to process 12293
add_drive_ro "RHEL-4.8-32.raw"
add_drive "foo"
launch
blockdev_getss "/dev/sdb"
part_list "/dev/sda"
part_get_bootable "/dev/sda" 1
part_get_mbr_id "/dev/sda" 1
part_get_bootable "/dev/sda" 2
part_get_mbr_id "/dev/sda" 2
pvs_full
vfs_type "/dev/sda1"
mount_ro "/dev/sda1" "/"
statvfs "/"
umount_all
vfs_type "/dev/sda2"
lvs
vfs_type "/dev/VolGroup00/LogVol00"
part_get_parttype "/dev/sdb"
kill_subprocess

Version-Release number of selected component (if applicable):
libguestfs-tools-1.5.2-7.fc13.x86_64

Comment 1 Richard W.M. Jones 2010-09-14 12:10:40 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?

Comment 2 Matthew Booth 2010-09-14 13:42:55 UTC
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.

Comment 3 Richard W.M. Jones 2010-09-18 20:56:02 UTC
*** Bug 635298 has been marked as a duplicate of this bug. ***

Comment 4 Richard W.M. Jones 2010-09-27 16:21:44 UTC
Patch posted:

https://www.redhat.com/archives/libguestfs/2010-September/msg00054.html


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