Shrink a Volume Group in LVM / Linux in order to install Windows on the freed space
- by Stephan Kristyn
I have a Volume Group with Unused space. This 40Gig should become an entidy in order to install Microsoft windows 7 on it. I do not have extra space on the drive - that is why I want to shrink the VG!
LVG berta resides on sda2 and consists of
lv_root
lv_swap
unused_space
I want it to become
lv_root
lv_swap
and have a seperate entidy made out of unused_space. Microsoft Windows 7 has to get installed on this entidy. I do not understand why Linux made simple things complicated. I utterly hate LVM and think its absolute bollocks.
Useful Sources:
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-system-config-lvm.html
Edit: I found the answer. The necessary steps depict how complicated LVM really is. In my opinion it is best to avoiding LVM until pvresize matures as promised in its man pages.
Answer:
http://fedorasolved.org/Members/zcat/shrink-lvm-for-new-partition
If you run into problems when you want to remove lvswap even if in resuce mode, then try
swapoff /dev/vg_1/lv_swap
lvchange -an /dev/vg_1/lv_swap