Shrink LVM partition & create new Linux Primary partition

Hello All,

I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows,

/boot - Linux Partition & another is
LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc).

Here my requirement is to take out 1GB of space from LVM ( Any logical partition & OK with data loss as well) & create a separate new primary Linux partition of that 1 GB space. I am not sure whether it is possible OR not, if possible can you help me provide the steps/commands how to do that.

So far I have tried doing following things after googling & got information from other forums, but so far not got success,

1] Booted in single user mode
2] Unmounted the logical partition which need to shrink
3] Run e2fsck -f /opt
4] resize2fs -p /opt
5] lvreduce -L 1G /opt
6] Saw after mounting, size got reduced

After doing above step, I tried creating partition with fdisk, but it wont allow, moreover I can't see this 1GB free space also in fdisk.

Please help.

After resizing the file system, you need to shrink the partition as well before creating a new one.

I guess you can re-use the 1GB only within the volume manager i.e. lvcreate.

Thanks RudiC & MadeInGermany for your replies, sorry for responding late.

While googling around I got a really nice article which helped me to achieve my goal.

How to shrink a default install LVM PV to create another partition

However, in my scenario I used this link as a reference because I used my swap partition to shrink, hence didn't required to boot system in rescue. Just did swapoff & shrink partition & carried out remaining steps from above link.

Thanks,
gr8_usk

After shrinking the swap partition,
I would run mkswap before the swapon .

Thanks MadeInGermany.

I did carried out those steps, however I forgot to mention in my earlier post.