Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LVM volume won't be removed , no process running #49

Closed
Whisper40 opened this issue Apr 11, 2021 · 2 comments
Closed

LVM volume won't be removed , no process running #49

Whisper40 opened this issue Apr 11, 2021 · 2 comments

Comments

@Whisper40
Copy link

Whisper40 commented Apr 11, 2021

I will try to explain the problem as best I can.
I want to delete the volume of a user.
To do this I use a script that takes care of the operation.
Unfortunately, each time the script performs its task, the error reported by lvm is "contains a filesystem in use".
When I run the same script again, this time the lvm is deleted.

My manual tests :

sudo umount /home/whisper40/data/test -> OK
sudo lvremove --yes "/dev/vg_home/test"
  Logical volume vg_home/test contains a filesystem in use.

sudo dmsetup info -c | grep test
-> vg_home-test                 254  10 L--w    1    1      0 LVM-dA5m1HXcQcRHMKuSYfcLtwA0sUUEUN3XmVYkf2wZfBXPKqcexFNGfHAyefTZ2XqH
sudo lsof | grep "254,10" -> No result at all ! so no process

sudo lvremove --yes "/dev/vg_home/test"
  Logical volume vg_home/test contains a filesystem in use.

LVS result : test vg_home Vwi-aotz-- 100.00g pool_0_vg_home 2.34

The umount runs without indicating that a process was using the disk. LVM therefore should not block the deletion because there is no process using the disk.

This problem caused me many trouble on many servers ( Debian 9 and 10 on my side ).
Thanks if you have any idea..

@Whisper40
Copy link
Author

Answer : The volume has to be deleted from the fstab before lvremove command. After that, working without problem !

@zkabelac
Copy link

I'd guess this is some sort of problem with Debian udev rules - which deviates from upstream. As it looks like some automounting is going behind the scene - but upon normal situation mounting shall happen only when the disk appears for in the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants