Check if disk is in use before partitioning?

I all.

I’ve used parted and lvm (lvg & lvol) to set up machines, but I recently broke a system when I repartitioned a disk that was already in use. (Wooops!)

Does anyone have a good idea how to determine if a block device is already in use? By “in use” I mean, mounted in some way.

Thanks!
-Dylan

you can see what is mounted with ansible facts.

Might be environment/company specific, but in my company we make a partition on each disk so I usually only operate on a disk where the number of partitions is {}.
I’ve heard discussions of folks using the entire disk, but that isn’t something we do, so isn’t an issue/concern.

You can use df - h Linux command to check mounted disks