I have two disk partitions, say sda1 and sda2, each containing a VG.
- sda1 -> VG_SYS
- sda2 -> VG_GUESTS
VG_SYS has a number of LV, one for every partition I needed.
The problem is that VG_SYS has gone out of space (or better, partitions made on its LVs are out of space), while VG_GUESTS has a lot of free space.
Is it possible, and how, to shrink VG_GUESTS (and eventually sda2 too) and reallocate the free space to sda1/VG_SYS?
Thanks in advance
Assuming one LV on each VG, your process would like this:
Scared yet? If you are, I've managed to create the correct impression. Because this is playing with fire. I can bet $5 against your single that something will go wrong, and you'll lose your data.
Instead of trying to shrink the volume, which is always difficult and dangerous, the safest approach is actually something a bit more destructive:
I've intentionally omitted the exact commands, since you should be doing this kind of thing with complete understanding of what each command does, so RTFM and good luck.
You probably want something like this. However, keep in mind that it assumes you're just going to fully remove a PV from your VG, not try and shrink it down. I suspect to do what you want, you'll need a third partition (possibly on a removable USB drive) to use as temporary storage. Assuming it's /dev/sdb1, you could do something like this:
That'd be about the safest. And make sure you have backups!