Unable to remove LVM disk image

timonoj

Active Member
Apr 19, 2017
20
0
41
44
Hi guys,

I'm a bit new to proxmox and LVM troubleshooting yet. I'll try to be concise. I removed the HDD from a VM, as I was considering to start with a new HDD. However the HDD storage image remained on my Storage tab. Buttons are greyed out there, so I can't just remove it. I tried:
Code:
lvremove pve/vm-104-disk-1
Do you really want to remove and DISCARD logical volume vm-104-disk-1? [y/n]: Y
  device-mapper: message ioctl on  failed: Operation not supported
  Failed to resume data.
  Failed to update pool pve/data.

Also, I guess this might help:
Code:
lvdisplay
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                Qjhcna-eOek-McSo-lyTG-etK0-c20G-Lc608O
  LV Write Access        read/write
  LV Creation host, time proxmox, 2016-11-19 09:23:44 +0800
  LV Status              available
  # open                 2
  LV Size                7.00 GiB
  Current LE             1792
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:1

  --- Logical volume ---
  LV Path                /dev/pve/root
  LV Name                root
  VG Name                pve
  LV UUID                Sokeqp-fcw8-Mo36-Xm5p-rahM-P9dg-Akv2Tk
  LV Write Access        read/write
  LV Creation host, time proxmox, 2016-11-19 09:23:44 +0800
  LV Status              available
  # open                 1
  LV Size                14.75 GiB
  Current LE             3776
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:0

  --- Logical volume ---
  LV Name                data
  VG Name                pve
  LV UUID                vhdc0K-q9hj-NxAs-mQos-RWD9-TDAG-MdZJ03
  LV Write Access        read/write
  LV Creation host, time proxmox, 2016-11-19 09:23:45 +0800
  LV Pool metadata       data_tmeta
  LV Pool data           data_tdata
  LV Status              available
  # open                 3
  LV Size                128.00 GiB
  Allocated pool data    48.94%
  Allocated metadata     99.90%
  Current LE             32768
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:4

  --- Logical volume ---
  LV Path                /dev/pve/vm-100-disk-1
  LV Name                vm-100-disk-1
  VG Name                pve
  LV UUID                cS24Ni-Wibk-uFX0-nrcx-TyLj-SzkQ-cxpPBn
  LV Write Access        read/write
  LV Creation host, time timoserver, 2017-05-25 16:57:03 +0800
  LV Pool name           data
  LV Status              available
  # open                 0
  LV Size                32.00 GiB
  Current LE             8192
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:6

  --- Logical volume ---
  LV Path                /dev/pve/vm-102-disk-1
  LV Name                vm-102-disk-1
  VG Name                pve
  LV UUID                sarjKe-LtgT-37D0-0t1e-GpSE-iDuy-pD2wNG
  LV Write Access        read/write
  LV Creation host, time timoserver, 2017-05-25 17:07:34 +0800
  LV Pool name           data
  LV Status              available
  # open                 0
  LV Size                30.00 GiB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:7

  --- Logical volume ---
  LV Path                /dev/pve/vm-104-disk-1
  LV Name                vm-104-disk-1
  VG Name                pve
  LV UUID                fX3xDm-Fkct-puCy-vL33-9tmM-33O2-fGihrv
  LV Write Access        read/write
  LV Creation host, time timoserver, 2017-07-26 18:56:44 +0800
  LV Pool name           data
  LV Status              NOT available
  LV Size                32.00 GiB
  Current LE             8192
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

So...how should I proceed? I just want to get rid of the dead storage this image takes. Additionally, why are the storage buttons grayed out? And how should I remove HDD images in the future?

Thanks a lot!


EDIT: Uhhh seems the problems might be greater than I thought...I can't create any new VM.
Code:
device-mapper: message ioctl on failed: Operation not supported
TASK ERROR: create failed - lvcreate 'pve/vm-103-disk-1' error: Failed to resume data.

...and also I can't boot existing VMs
Code:
kvm: -drive file=/dev/pve/vm-100-disk-1,if=none,id=drive-virtio0,format=raw,cache=none,aio=native,detect-zeroes=on: Could not open '/dev/pve/vm-100-disk-1': No such file or directory
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=59cd5c12-57c7-48cb-b729-9a2f95b8c233' -name SeafileServer -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga vmware -vnc unix:/var/run/qemu-server/100.vnc,x509,password -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 4096 -k en-us -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:68718e30fdb7' -drive 'if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/dev/pve/vm-100-disk-1,if=none,id=drive-virtio0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=100' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=AA:02:E8:03:06:93,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1
 
Last edited:
Anyone? All my VMs stopped booting...
Code:
root:~# lvremove pve/vm-104-disk-1
Do you really want to remove and DISCARD active logical volume vm-104-disk-1? [y/n]: y
  Device pve-data-tpool (251:4) is used by another device.
  Unable to deactivate logical volume pve/vm-104-disk-1.
root:~# lvscan
  ACTIVE            '/dev/pve/swap' [7.00 GiB] inherit
  ACTIVE            '/dev/pve/root' [14.75 GiB] inherit
  ACTIVE            '/dev/pve/data' [128.00 GiB] inherit
  ACTIVE            '/dev/pve/vm-100-disk-1' [32.00 GiB] inherit
  ACTIVE            '/dev/pve/vm-102-disk-1' [30.00 GiB] inherit
  inactive          '/dev/pve/vm-104-disk-1' [32.00 GiB] inherit

root:~# dmsetup ls
pve-vm--100--disk--1    (251:6)
pve-data-tpool  (251:4)
pve-data_tdata  (251:3)
pve-data_tmeta  (251:2)
pve-swap        (251:1)
pve-root        (251:0)
pve-data        (251:5)
pve-vm--102--disk--1    (251:7)


And here, what happens if I try to start a VM:
Code:
root:~# qm start 100
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "en_GB.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
kvm: -drive file=/dev/pve/vm-100-disk-1,if=none,id=drive-virtio0,format=raw,cache=none,aio=native,detect-zeroes=on: Could not open '/dev/pve/vm-100-disk-1': No such file or directory
start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=59cd5c12-57c7-48cb-b729-9a2f95b8c233' -name SeafileServer -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga vmware -vnc unix:/var/run/qemu-server/100.vnc,x509,password -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce -m 4096 -k en-us -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:68718e30fdb7' -drive 'if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/dev/pve/vm-100-disk-1,if=none,id=drive-virtio0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=100' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=AA:02:E8:03:06:93,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1


....and indeed, there's no data to be found where it tries to boot them from. Where did it go??
Code:
root:/dev/pve# ls -l
total 0
lrwxrwxrwx 1 root root 7 Jul 27 10:28 root -> ../dm-0
lrwxrwxrwx 1 root root 7 Jul 27 10:28 swap -> ../dm-1
 
Last edited: