TASK ERROR: lvremove 'pve/vm-111-disk-0' error: Logical volume pve/vm-111-disk-0 contains a filesystem in use

gusto

Member
Feb 10, 2018
16
0
6
20
I use Proxmox 5.4-13, just one node. Today I installed LXC Centos 7. I want to use NFS server in LXC. I did this:
I installed NFS on the node
Code:
apt-get install nfs-kernel-server
Then I installed LXC centos 7 (ID 111)
Code:
nano /etc/pve/lxc/111.conf
Code:
lxc.apparmor.profile = unconfined
I Now start the LXC Centos 7 and install NFS.

Code:
yum -y install nfs-utils
systemctl enable nfs-server.service
systemctl start nfs-server.service
Code:
mkdir -p /nfs/abc
chown nfsnobody:nfsnobody /nfs/abc
chmod 755 /nfs/abc
Code:
nano /etc/exports
Code:
/nfs/abc  *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)
Code:
exportfs -a
Everything seems to be all right. I want now to destroy the LXC. I can't destroy the LXC because

Code:
TASK ERROR: lvremove 'pve/vm-111-disk-0' error:   Logical volume pve/vm-111-disk-0 contains a filesystem in use.
Can anyone advise me how to destroy the LXC?
 

tim

Proxmox Staff Member
Staff member
Oct 1, 2018
287
29
28
I guess there is still something running related to your container.
 

tim

Proxmox Staff Member
Staff member
Oct 1, 2018
287
29
28
probably rebooting your host is enough
 

gusto

Member
Feb 10, 2018
16
0
6
20
After restart I can destroy the LXC. How to do without restarting of the host.
 
May 17, 2019
45
2
8
You need to find out what is accessing the filesystem with lsof for example. If i would have to take a guess whats accessing the filesystem: you did not stop the nfs server.
 

gusto

Member
Feb 10, 2018
16
0
6
20
When I run a command on a host
Code:
lsof | grep vm-111-disk
the output is
Code:
....
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
lsof: no pwd entry for UID 48
....
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!