For example this creates 1 partition on /dev/sda, as /dev/sda1, which is turned into a LUKS container, which is further partitioned into 2 sub partitions:
sgdisk -Z /dev/sda
sgdisk -n 1:0:0 -t 1:8300 -c 1:"Test Partition" /dev/sda
cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 1000 --use-urandom luksFormat /dev/sda1
cryptsetup luksOpen --allow-discards "test_encrypted"
sgdisk -Z /dev/mapper/test_encrypted
sgdisk -n 1:0:+6GB -t 1:8300 -c 1:"sub_test_1" /dev/mapper/test_encrypted
sgdisk -n 2:0:0 -t 2:8300 -c 2:"sub_test_2" /dev/mapper/test_encrypted
partprobe -s /dev/mapper/test_encrypted
lsblk
cryptsetup luksClose test_encrypted
Trying to do so, gives back: device-mapper: remove ioctl on test_encrypted failed: Device or resource busy, then Device test_encrypted is still in use.
The sub partitioning works, but one cannot close it anymore once partprobe has reported to the kernel about the sub partitions.
kpartxallows deletion of partition mappings with the-dargument. I recommend using it instead ifpartprobeis unable to support this.