On Wed, 22 May 2024 15:07:27 -0400
Steve Litt <sl...@troubleshooters.com> wrote:

> Unless you're encrypting the root partition, I can't think of any use
> of LVM that can't be done other ways. I view LVM as yet another layer
> of abstraction and yet another way to lose your data.

My most common use case at work:

Add vDisk to VM in vCenter.
Create partition on vDisk with gdisk.
pvcreate /dev/${DEV}1
vgextend ${VG} /dev/${DEV}1
lvextend -r -l 100%VG /dev/mapper/${LV}

Where VG = volume group and LV = logical volume. We're running with
large monolithic database files. Bind mounts cannot expand the
filesystem where these files are stored. The filesystem itself has to
be extended. LVM makes this possible on live systems. And it took me
longer to type this out than to actually do it on a live VM.

I could do this without LVM, and I have done so on VMs using basic
partitions: shut down the VM, increase the size of the vDisk, boot a GNU
Parted Live image, extend the partition to the new vDisk size and
extend the filesystem, shut down the VM, and then boot normally.

A much less common use but something we do on our product soak testing
machines with pools of NVMe storage is to use LVM to stripe across the
volume group:

lvcreate -i $N -I $X -n $VG
where N = number of stripe devices, X = stripe size (typically 128KB)

Simpler and less overhead than using mdadm where we don't need device
redundancy but we do want to distribute writes across the entire pool
to balance wear. Simple concatenation or bind mounts would cluster
writes to one device leading to it aging faster than the other devices
in the pool. Plus we get ludicrous I/O performance which is beneficial
for soak testing.

I have seen filesystems (notably XFS and early ext4) lose or damage
data. I have seen the VFS layer damage data. But not LVM. Maybe it has
happened to others. But in 25+ years and somewhere on the order of
three thousand Linux machines that I have previously managed and
currently manage as part of my job or used/use personally, I have never
seen LVM lose or damage data.

-- 
\m/ (--) \m/
_______________________________________________
Discuss mailing list
Discuss@driftwood.blu.org
https://driftwood.blu.org/mailman/listinfo/discuss

Reply via email to