Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 entity. 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 
share|improve this question

closed as off-topic by kce, Ward, Falcon Momot, Michael Hampton Jul 25 '13 at 5:05

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about hardware or software used in a home setting are off-topic because they require answers that may not be practical for the business and support professionals here. You should try asking on Super User instead." – kce, Ward, Falcon Momot, Michael Hampton
If this question can be reworded to fit the rules in the help center, please edit the question.

    
LVM is a good thing, but it's also true that the process to shrink the partition is quite freaky. But it's more easy to do it with LVM than other utility, and it's more secure. Well, thanks posting you solution and link to help people that will encounter the same problem. –  Anarko_Bizounours Jun 15 '11 at 7:19
1  
Why do you blame LVM? It's really handy for normal partition management in Linux. It's true that resizing the whole LVM isn't fun, but it still beats having to resize the whole root partition. If you wouldn't have used LVM, you would 've ended up with one big root partition, you had to resize it and then had to start with step 8 of your link. Still not quite a fun exorcize. –  blauwblaatje Jun 15 '11 at 7:27
    
@blauwblaatje Respectfully, I compeletely disagree, Sir. In my case it wasnt about the root partition, so I have to buy a new drive now to temporarily store the contents of the 400G logical volume in question until pvresize matures. Would I have used normal partitions I would be golden now. –  Achmed Durangi Jun 15 '11 at 18:45
    
If you're buying a new drive, just install Windows there. Then you won't need to resize anything. –  Joe Internet Jun 15 '11 at 20:53
    
I'm sorry, I misunderstood your lvm setup. But... I'd still prefer LVM over traditional. Adding an lv is very easy, so is resizing an lv on-the-fly. I wouldn't want to try that with with traditional partitions on a live-server. Your problem however sounds more like a workstationproblem and in that case, I'd think your complaint should be on poweruser, not serverfault. For a workstation that you're not sure of if you ever want to have something else other than linux, I'd suggest leaving a free partition. –  blauwblaatje Jun 23 '11 at 12:51

2 Answers 2

For the lack of pvresize to compact blocks, do it yourself. From the pvmove man page:

If the source and destination are on the same disk, the anywhere allocation policy would be needed, like this:

        pvmove --alloc anywhere /dev/sdb1:1000-1999 /dev/sdb1:0-999

You can check where blocks are with "lvdisplay --map" and do a little math, you don't have to move your whole lvs to another disk.

share|improve this answer

IF it's on the same disk, this old post documents exactly that. Though might want to read fully first before you try:

share|improve this answer
    
Welcome to Server Fault! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. –  slm Jul 25 '13 at 2:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.