linux - How to close a luks container that has sub partitions -


for example creates 1 partition on /dev/sda, /dev/sda1, turned luks container, further partitioned 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 so, gives back: device-mapper: remove ioctl on test_encrypted failed: device or resource busy, device test_encrypted still in use.

the sub partitioning works, 1 cannot close anymore once partprobe has reported kernel sub partitions.

kpartx allows deletion of partition mappings -d argument. recommend using instead if partprobe unable support this.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -