Some Warnings
Since I’m a quiet crazy guy I worked this guide out without a backup of my data.
!!! DONT’T BE SO STUPID LIKE ME !!!
Anyway everything went smooth. But don’t cry if you are trashing all your data!
The initial position
I have the following disk:
Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 26 204819+ ee EFI GPT
/dev/sda2 26 662 5111808 af Unknown
/dev/sda3 * 662 675 102400 83 Linux
/dev/sda4 675 12161 92264204+ 8e Linux LVM
What I like to archive
Do the resize
lvm vgchange -a y
e2fsck -f /dev/VolGroup00/LogVol00
resize2fs -f /dev/VolGroup00/LogVol00 10G
e2fsck -f /dev/VolGroup00/LogVol00
Now display the the Logical Volume (it is still 86.00 GB) lets reduce it also to 40G
lvm lvdisplay /dev/VolGroup00/LogVol00
lvm lvreduce -L10G /dev/VolGroup00/LogVol00
lvm lvdisplay /dev/VolGroup00/LogVol00
Now it is 40.00 GB
Try to mount the volume
mount /dev/VolGroup00/LogVol00 /mnt/source
umount /mnt/source
lvm lvdisplay
as you can see we have now two logical volumes (LogVol00 40.00 GB and LogVol01 1.94GB)
lvm vgdisplay
we have free PE 46.03 GB and allocated PE 41.94 GB
First find the LVM-Partition with
fdisk /dev/sda
Note: our partition is sda4
lvm pvresize --setphysicalvolumesize 41.94G /dev/sda4