S
S
syxoi2016-10-08 14:59:02
linux
syxoi, 2016-10-08 14:59:02

How to extend encrypted LVM?

Hello!
Available:
sofa 8 (latest)
/dev/sda1 - boot
/dev/sda2 - encrypted container
in the encrypted container has two LVM volumes - root and swap.
there is a lot of unallocated area at the end of the disk
Task: it is necessary to expand the swap, expand the root.
I read different instructions and everywhere there is such a sequence: first we reduce the root, then lvm, then the container itself, for the expansion you need, it turns out, do everything in the reverse order, i.e. first expand the cryptocontainer, then lvm and then lvm volumes?
I also noticed a parameter indicating a specific size, but is it possible to specify the maximum size, and not manually "Get" information about the available space, etc.?
And if the swap was created first, and then the root, is it possible to expand them? Knowing the MBR, it is impossible to do this in it, that is, it was necessary to move partitions, etc., is there the same with lvm? Or is it different here?
Thank you)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-10-08
@syxoi

Important information before starting such actions must be backed up!
First, expand the /dev/sda2 partition , resize2fs
then the cryptocontainer , then the lvm cryptsetup
physical device, pvresize
then resize that partition inside the cryptocontainer , inside the lvresizelvm, which needs to be increased later
for the disk inside the lv (logical volume) if you use it, then it is not necessary to reboot https://help.ubuntu.com/community/ResizeEncryptedP... lvm splits pv into chunks, and then makes you lv from a set of chunksresize2fs
lv can consist of chunks in different parts of pv and, accordingly, in different parts of the real device (or devices)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question