[CentOS] Convert from LVM

Fri Jun 8 21:54:37 UTC 2018
Nataraj <incoming-centos at rjl.com>

On 06/08/2018 02:36 PM, Nataraj wrote:
> On 06/08/2018 12:34 PM, Ulf Volmer wrote:
>> On 08.06.2018 19:11, Matt wrote:
>>> I have a Centos 7 install using EXT4 on LVM.  Its running as a VM
>>> inside KVM.  Issue I have run into is that fstrim does not work due to
>>> the LVM.  Without fstrim snapshots have gotten huge.  Is there a way
>>> convert it from LVM to non-LVM without a complete reinstall?

I think that what your dealing with is an issue of file systems in a
virtual machine.  I don't think you can shrink a filesystem in a virtual
machine just by deleting files from it.  Here's one explanation of how
to do this.  I'm not sure about zeroing out the free space on the
partition (might be necessary, I don't know), but you do need to recover
space from the qemu image using something similar to what is show in
this post.  It is the "qemu-img convert" that actually recovers the
space, but only after you have reduced the usage in the VM.

 This has nothing to do with trim (though still a good idea to enable
trim for your SSD for other reasons).