[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to shrink a LVM partition



On Sunday 24 January 2010 11:25:19 vitaminx wrote:
> I'd like to shrink a LVM partition on my harddisk.
> 
> Is it possible without any data loss?

Yes, but it is tricky.

Check your file systems.  Make sure they are clean before the process starts.

Take backups.

First make sure you have enough free space in your LVs.  Then use a 
combination of pvmove and pvresize to shrink your PE that corresponds to that 
partition.  Then shrink the partition in the partition table.

Check your file systems.  You may be able to revert any damage done at this 
point.

(Optional)  Grow the PE to match the new partition size (e.g. if there's lack 
at the end you left.)  Grow LVs based on newly available space.

Check your file systems.  This should be very quick.  Growing is a lot less 
tricky that shrinking, but it still has to be done in the right order.
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: