Shrink LVM to make new partition?

der.hans PLUGd at LuftHans.com
Tue Feb 27 17:14:04 MST 2007


Am 27. Feb, 2007 schwätzte Alan Dayley so:

> I have a system with a SCSI hardware RAID 5.  It has a boot partition
> and all the rest, 34+ GB, as a single volume using LVM.  I want to
> shrink the large partition to about 6GB so I can create a separate ext3
> partition.  I have never "messed" with LVM before, preferring to leave
> them running once installed.

I've resized live partitions several times. Most have been increases, but
there have been a couple of decreases as well. I go months between looking
at it, so I won't try to claim specifics.

> OS: CentOS 4.3
> HD device: /dev/c0d0
> Boot partition: /dev/c0d0p1
> LVM partition: /dev/c0d0p2

Unmount the partition. I actually increased the size of at least one
partition after forgetting to unmount it and everything worked, but I
recommend unmounting it until someone more knowledgeable says we don't
need to.

Decrease the size of the filesystem using the tool for that particular fs.

resize2fs
resize_reiserfs -s -5G /dev/yourdev

Next mount it and make sure it's still intact, then unmount it again.

lvresize -L -5G /dev/yourdev

I think that's what I did. It's been a year, so I could easily have
forgotten something.

ciao,

der.hans
-- 
#  https://www.LuftHans.com/        http://www.CiscoLearning.org/
#  C'est la Net - der.hans


More information about the PLUG-discuss mailing list