How to resize a Volme Group ?
Dear Gurus !
I installed F10 in a new 500G disk using the defaults. Bad move :(
Now I have a big partition with a big Volume Group on it, with a big logical group on it with a big filesystem on it. Bad, bad move, indeed...
Using a Live CD, I manage to resize the filesystem using resize2fs and then, using lvreduce, I shrink the Logical Volume too.
Next step: Resize the Volume Group and after that, reduce the LVM(8e) partition and free space on disk for other partitions.
The big question is: How to reduce a Volume Group ? I already extended a VG adding another PV to it, but this VG has only one PV as big the underlying partition.
I don want't to start over again. I already put my system up to date adn installed a lot of additional software online.
Please, tell me dear Gurus there are light in the darkness ! Enlight me! Show me the TRUE !
PS: BTW, I tried "pvresize --setphysicalvolumesize n" but it says /dev/sda2: cannot resize to n extents as later ones are allocated." no matter how BIG is n. What I am doing wrong ?
If you look at the output of "pvdisplay --maps" on your PVdevice you'll probably find that one or more of the LVs are using PEs above the cutoff point you're trying to shrink it to. Mine is like this too:
I've never tried this, but looking at the pvmove man page it looks like its possible to explicitly specify the PE numbers when you move, so assuming pvmove will allow you to move using the same PV for source and destination it may be able to move the PEs down below the point you want to resize too.
DISCLAIMER: THIS IS JUST THEORY, I'VE NEVER TRIED THIS, SO MAKE SURE YOU HAVE A GOOD BACKUP IF YOU DECIDE TO HAVE A GO. YOU COULD LOSE IT ALL
Anyway, hopefully that has given you some ideas.
Thank you GazL,
You right !
My LVM setup is such it is using PE all around the PV, so I couldn't resize it.
I didn't try to move PE because they are so many and as you said, there are a big risk to lose my data.
If I have to backup my data first, I decide it is better (in fact, is is more simple, easy) to remove the entire partition and re-create it using a reasonable size and initialize LVM on this partition again and restore the data from the backup.
So, this is what I did do. And it worked !
LVM is good to expand, but not so good to shrink, isn't ?
I can't wait for ZFS or other more advanced FS to come.
ZFS sounds quite nice, but from what I've read it's not perfect and has its own restrictions and management issues. It also appears that it requires a serious amount of free system memory to stop it running out of buffers and panicking the kernel. According to the FreeBSD guys who have played with it, it's not really recommended for a 32bit system. In contrast, my LVM setup runs nicely on this antique Pentium3 800Mhz with 128MB ram, and that's with the PVs all on LUKS encrypted partitions too.
Anyway, I'm glad you've got it all sorted now.
|All times are GMT -5. The time now is 07:21 PM.|