The way of resizing root LVMs on LUKS that is in the middle of the PV

I have LVM on LUKS and after upgrade from 512GB to 1TB I resized my home partition by using this guide. I would like to resize my root volume as well. I’ve read different articles on this and I’ve doubts on how to achieve this in best way.

The disk layout is

Before resizing the borabora-home was smaller to fit 512GB disk. I have the old drive and able to dd its content again to the target disk as maybe from the scratch where the home volume was smaller it’s easier to start (I don’t know actually). As it’s not necessary to shrink home.

So what would be the way to extend borabora-root to 200GB e.g.?

As I think

  1. I have to copy borabora-home somewhere (I have an external disk).
  2. Delete it
  3. Resize borabora-root
  4. Create new lvm after it
  5. Copy content of borabora-home to this newly created lvm

I’m reading about pvmove and looks like it actually moves as it updates metadata. So, what should I use to perform this. Or maybe the above list is wrong and there is another way you may suggest, please.

1 Like

shrink borabora-home by ~200GB
grow borabora-root by the same amount afterwards

nothing in what you said or posted supports this :man_shrugging:

There is only so much space to go around …
it can’t be grown - just redistributed

I can only shrink borabora-home at the end of volume (maybe I’m wrong). I can’t shrink it at the beginning (from left side). So I have to move it by 200GB farther to provide room for borabora-root.

Schematically the step are as follows

1. [|swap|, |root|, |home-------------|]
2. [|swap|, |root|, |home----------|   ]  
3. [|swap|, |root|,    |home----------|]  
4. [|swap|, |root----|,|home----------|]  

in this case: you are

One of the supposed advantages of LVM is,
that you don’t have to move around the all the data in case you want to resize the “partition”.

… if you can shrink home (the data still needs to fit …)
then you can - and then give that space to … root, in this case

Thank you for the response, could you please elaborate on this. What would be the commands to achieve this?

no no no no
You chose to use LVM.
You had a reason to do so - presumably.

Presumably you knew how to shrink one (logical) partition in favour of another, where the space was needed …
for instance …

I did actually use a setup involving LVM in the past - but I never utilized it’s features.
resizing one (logical) partition - and re-allocating the space to another partition
without the need to actually having to move data around or resize (physical) partitions.

It’s in the name:
LVM (logical volume manager) - the “partitions” are not physical …

LVM - ArchWiki

I cannot and will not explain your chosen use case to you. :man_shrugging:

with LVM, it does not matter what is “in the middle” or “on one side”

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.