You are not logged in.
I have a logical partition that contains LUKS which holds an LVM2 schema. My goal is to resize the existing logical partition so I can create other partitions in their own LUKS-encrypted container. So far, the LVM2 PV is resized and I'm looking for advice on how to handle shrinking the LUKS container and the logical partition it lives on.
I heard rumors that LUKS containers don't need to be resized and that I can change the size of the block device it lives on without problems. Is this true? If so, it seems like I should be able to delete the logical partition and replace it with a smaller one as usual. How can I calculate the blocks/sectors/etc for the new partition with the LUKS & LVM2 data on there?
Last edited by synthead (2013-02-16 07:42:02)
Offline
We would need more information about your partitions and volumes. If the entire partition is encrypted, then you should only need to change the sizes of the logical volumes, the LUKS container shouldn't require resizing...
Offline
Yeah, the entire logical partition is formatted as LUKS. So I should be able to delete the partition and create a replacement with a smaller size? How can I calculate the new size I'd need for the logical partition?
Offline
Once again, without any specific information (despite having asked for it); you don't need to delete the partition-- that is the entire point of LVM on LUKS, you just resize your volumes.
Unless, and I am guessing (see first point), you want to resize the entire partition, in which case the above advice does not apply, and your thread title is completely misleading.
For someone who has been around these boards a long time, you haven't learned much about How To Ask Questions The Smart Way...
Offline
Sorry about that, I edited my original post
Yes, I will not be using the existing LVM2 structure for the new partitions; I'm going to create another partition, LUKS container, and whatever else when this is sorted.
Offline
Running into a new problem:
# fdisk /dev/sda
Welcome to fdisk (util-linux 2.22.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005c24e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 250068991 124783617 5 Extended
/dev/sda5 501760 250068991 124783616 83 Linux
Command (m for help): d
Partition number (1-5): 5
Partition 5 is deleted
Command (m for help): p
Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005c24e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 250068991 124783617 5 Extended
Command (m for help): n
Partition type:
p primary (1 primary, 1 extended, 2 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (503806-250068991, default 503808): 501760
Value out of range.Why can't I create a partition on the same starting sector as before?
Offline