Unmount/unmap LVM volumes

What commands can be used to unmount or unmap an LVM volume, or otherwise prepare the physical media containing it to be ejected?

I confess, despite using the command line for many years, I still primarily use graphical tools to mount and unmount filesystems or LUKS partitions; therefore, I am not as knowledgeable about mounts/mappings as I perhaps should be.

With that in mind,
I was inspecting a removable drive that used LVM, and while I was able to use a GUI to map to a location in /dev/mapper/ and mount the filesystem within, I am not familiar with how to unmap the LVM volume now that I have unmounted the filesystem via umount.

Everything I have been able to find documenting LVM treats both PVs and LVs as if they are only able to be created or destroyed.

Any forum or Q&A post I could find while searching the web for unmounting or unmapping LVM likewise only gave instructions for migrating data away from a drive/partition in preparation for it to be permanently removed from the VG, or simply deleting the LVM setup entirely.

A rough diagram for the anyone unfamiliar with LVM:
LV (Logical Volume; /dev/mapper/__) → VG (Volume Group) → PV (Physical Volume; an actual partition on-disk)

If you run lvs you’ll see the Attr column, this is a bunch of flags showing stats per LV. If the Attr column shows “a”, then the LV is “active” and can be mounted. To fully unmount a drive you need to deactivate the LV, usually with lvchange -an vg/lv and/or the entire VG with vgchange -an vg/lv. A deactivated LV will not show “a” in the Attr column.

Once the LV and VG have been deactivated it’s safe to remove the disk. Though in general I don’t bother deactivating LVs/VGs for removable drives, simply unplugging it is fine.

After umount

I find that

vgchange -a no

Then a

Vgexport

Is usually safe

There’s also an eject cmd