LVREMOVE problem

J

jonathanb

Guest
Hello everyone,

I found out that if I want to delete a VM that I would need to use lvremove vm-101-disk-1. The problem is that I would get a "Volume group "vm-101-disk-2" not found". I'm a beginner with Linux. What am I doing wrong? Do I need to get in a directory before I can use lvremove? If there is another way to delete these VM's I would gladly hear about it.

Please help me :confused:
 
Hello everyone,

I found out that if I want to delete a VM that I would need to use lvremove vm-101-disk-1. The problem is that I would get a "Volume group "vm-101-disk-2" not found". I'm a beginner with Linux. What am I doing wrong? Do I need to get in a directory before I can use lvremove? If there is another way to delete these VM's I would gladly hear about it.

Please help me :confused:
Hi,
look at the console which logical volumes and volumegroups do you have:
Code:
vgdisplay
lvdisplay
If you haven't the lv yet (because you remove the lvm-storage) you can also remove the vm-config at /etc/qemu-server/ (take a look inside the config-file).

Udo
 
Hello Udo and thank you for your fast reply!

vgdisplay output:
Code:
xenhead:/dev/hdd_sda1# vgdisplay
  --- Volume group ---
  VG Name               hdd_sde1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  16
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.36 TB
  PE Size               4.00 MB
  Total PE              357699
  Alloc PE / Size       345856 / 1.32 TB
  Free  PE / Size       11843 / 46.26 GB
  VG UUID               KaCVeo-vnHf-jq2P-uZaP-Yutp-8abV-4FYYAY

  --- Volume group ---
  VG Name               pve
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               148.55 GB
  PE Size               4.00 MB
  Total PE              38028
  Alloc PE / Size       37005 / 144.55 GB
  Free  PE / Size       1023 / 4.00 GB
  VG UUID               3XSnlc-9vnU-0eJL-taq6-1UMX-9BLq-ex8JI8

  --- Volume group ---
  VG Name               hdd_sdc1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.36 TB
  PE Size               4.00 MB
  Total PE              357699
  Alloc PE / Size       0 / 0
  Free  PE / Size       357699 / 1.36 TB
  VG UUID               bUQgkH-q4gI-LlAf-NvHT-ipD8-Nhop-y4mVDP

  --- Volume group ---
  VG Name               hdd_sdb1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.36 TB
  PE Size               4.00 MB
  Total PE              357699
  Alloc PE / Size       0 / 0
  Free  PE / Size       357699 / 1.36 TB
  VG UUID               O2D8cn-aPLE-COXa-gVYB-qMUI-DLRX-ez3obq

  --- Volume group ---
  VG Name               hdd_sda1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  21
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                7
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.36 TB
  PE Size               4.00 MB
  Total PE              357699
  Alloc PE / Size       110853 / 433.02 GB
  Free  PE / Size       246846 / 964.24 GB
  VG UUID               OllYXB-zdWq-3pgm-GhyI-5NOG-YlvE-FhL2rk

lvdisplay output:
Code:
xenhead:/dev/hdd_sda1# lvdisplay
  --- Logical volume ---
  LV Name                /dev/hdd_sde1/vm-102-disk-1
  VG Name                hdd_sde1
  LV UUID                BwHeo4-OwYA-spnF-LHaT-B1JS-A7UO-26lLik
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

  --- Logical volume ---
  LV Name                /dev/hdd_sde1/vm-102-disk-2
  VG Name                hdd_sde1
  LV UUID                XJiERo-dwrv-lgLb-mdWZ-pvlR-dYh6-HwUWVv
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                900.00 GB
  Current LE             230400
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:4

  --- Logical volume ---
  LV Name                /dev/hdd_sde1/vm-102-disk-3
  VG Name                hdd_sde1
  LV UUID                3zyI4f-2l0X-ABhe-J2WS-95Aq-tXaG-WI7je2
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                450.00 GB
  Current LE             115200
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:5

  --- Logical volume ---
  LV Name                /dev/pve/swap
  VG Name                pve
  LV UUID                06fqSX-VYSB-XIo6-SPTB-opLg-ttOf-sHjL5T
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Logical volume ---
  LV Name                /dev/pve/root
  VG Name                pve
  LV UUID                dy8c0M-PHuf-itPV-mEDY-VUK1-Ws1H-h1QN2O
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                37.25 GB
  Current LE             9536
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

  --- Logical volume ---
  LV Name                /dev/pve/data
  VG Name                pve
  LV UUID                cAsMyx-um6t-zHGw-IFtO-ce9d-BzjU-qFX7gc
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                103.30 GB
  Current LE             26445
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2

  --- Logical volume ---
  LV Name                /dev/hdd_sda1/vm-500-disk-1
  VG Name                hdd_sda1
  LV UUID                m246ZN-Poc3-0s9j-oEBa-Glar-7tLN-fk3Roo
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20481
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:6

  --- Logical volume ---
  LV Name                /dev/hdd_sda1/vm-500-disk-2
  VG Name                hdd_sda1
  LV UUID                TR2f0i-CSsV-4fzJ-Vawo-2V4T-RR9C-KNeO5y
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20481
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:7

  --- Logical volume ---
  LV Name                /dev/hdd_sda1/vm-500-disk-3
  VG Name                hdd_sda1
  LV UUID                BXwF8K-F7c4-09x8-cl5K-UfDw-jdAT-sCR3HX
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20481
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:8

  --- Logical volume ---
  LV Name                /dev/hdd_sda1/vm-166-disk-1
  VG Name                hdd_sda1
  LV UUID                gdp2OM-fRuQ-fRUI-n3KI-eSbI-QdOj-mDqegM
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                80.00 GB
  Current LE             20481
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:9

  --- Logical volume ---
  LV Name                /dev/hdd_sda1/vzsnap-xenhead-0
  VG Name                hdd_sda1
  LV UUID                zhf7cU-Z08k-EOvR-LeL5-pHwf-2n6R-pE171O
  LV Write Access        read/write
  LV snapshot status     active destination for /dev/hdd_sda1/vm-101-disk-2
  LV Status              available
  # open                 0
  LV Size                32.00 GB
  Current LE             8192
  COW-table size         1.00 GB
  COW-table LE           256
  Allocated to snapshot  1.35%
  Snapshot chunk size    4.00 KB
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:14

I have one config file from my VM and that is 102.conf.
Code:
xenhead:/dev/hdd_sda1# cd /etc/qemu-server/
xenhead:/etc/qemu-server# ls
102.conf


As far as I can see, there is no conf file of the other VM's. Those other VM's where failed qmrestore's which I can't delete from the WebGUI. I tried to delete some files in the /dev/hdd_sda1/ but when I looked in the directory again, those files came back. I don't really understand Proxmox and thought that when I removed these files I would also remove the bad VM's.

Code:
xenhead:/etc/qemu-server# cd /dev/hdd_sda1/
xenhead:/dev/hdd_sda1# ls
vm-101-disk-2  vm-201-disk-1  vm-500-disk-2  vzsnap-xenhead-0
vm-166-disk-1  vm-500-disk-1  vm-500-disk-3

Is there another way to remove it and did I used lvremove the right way?

---
Jonathanb
 
Hello Udo and thank you for your fast reply!


lvdisplay output:
Code:
...
  --- Logical volume ---
  LV Name                /dev/hdd_sda1/vzsnap-xenhead-0
  VG Name                hdd_sda1
  LV UUID                zhf7cU-Z08k-EOvR-LeL5-pHwf-2n6R-pE171O
  LV Write Access        read/write
  LV snapshot status     active destination for /dev/hdd_sda1/vm-101-disk-2
  LV Status              available
  # open                 0
  LV Size                32.00 GB
  Current LE             8192
  COW-table size         1.00 GB
  COW-table LE           256
  Allocated to snapshot  1.35%
  Snapshot chunk size    4.00 KB
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:14
...
Jonathanb
Hi,
is your pve configured as cluster? and the vm 101 on the other node?
Anyway, your vm-101-disk-2 has an active snapshot (something goes wrong during backup?)! So you must first remove the snapshot, than should the remove work.

Udo
 
Hello Udo,

I have only one Proxmox server and no clusters. I tried to delete those backups or snapshots or whatever people call it, but I don't know how. I only want to delete those backups that went wrong and the people that I'm asking don't know how either. It's very frustrating and I have this problem for more then a half year.

storage.pngbrowse.pngproblem.png
Here are some screenshots that hopefully will help explain what I want.

I just need to delete those VM disks manually one way or another, but without a reinstall. :confused:
 
Hi,
to delete an unsused logical volume you can do something like this (be sure to know what you are doing and have valid backups):
Code:
lvchange -a n /dev/hdd_sda1/vm-500-disk-1
lvremove /dev/hdd_sda1/vm-500-disk-1     # perhaps you need the option " -f "
You should also be able to delete the snapshot in the same manner.

Udo
 
  • Like
Reactions: 00th00
I didn't say thank you so thank you Udo for this! You helped me a lot with this so again .. thank you and the same for you Dietmar.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!