# LUKS: multiple partitions on one encrypted Volume

## MalleRIM

Hi,

It's hard to tell the search what I want.

So this is what I've got: I am setting up a friends computer (with Ubuntu, but this question is not actually Ubuntu specific and I thought I'll reach more experienced users here) with /home, swap and several Data partitions encrypted. I had the Idea to create one volume, encrypt it and set up all the required partitions in it, it would save time when unlocking the partitions. I created  these partitions using gparted and they were available on /dev/mapper/cryptp1 /dev/mapper/cryptp2 (while /dev/mapper/crypt being the encrypted volume). I restarted to test whether the password is asked for. It worked, the volume was unlocked, but the partitions are missing (cryptp1, cryptp2 etc.). What am I to do do make these partitions appear on boot (gparted still recognizes them but complains about the missing device file)?

----------

## Hu

As far as I know, a LUKS encrypted volume can only produce one decrypted device node, so you must have put some sort of intermediate container on the decrypted device node, and stored the individual filesystems within it.  I suspect that you placed an LVM in the LUKS container, and then each of your partitions is a volume in the LVM.  If so, you will need to manually change the volume group to active and rescan for logical volumes.

----------

## MalleRIM

Well, I found a sollution after just by trying some random commands that seemed to be fitting. partprobe scans for devices. I put the partprobe command in /etc/init.d/cryptdisks (like dm-crypt in Gentoo) at the end of the start part.

The encrypted partition behaves almost like a seperate disk. It can contain 4 primary partitions, one of them may be an extended partition containing logical partitions.

I unlocked the encrypted partition under the name "crypt". /dev/mapper/cryptp1 is the first primary partition. cryptp4 is the extended partition, the logical partitions in it are called crpyptp4p1, cryptp4p2 and so on.

If you don't need the advantages of lvm2, you'd be better off with this setup as it just does not require lvm2.

----------

