I have an LVM logical volume (LV) and would like to create partitions within this LV to provide an ext3 partition and a swap partition. This LV would then get mounted as a disk to a virtual machine (Using Xen).
How would I go about this?
I've just done this to refresh my memory. It's on a RHEL 5.6 system but should work anywhere fairly modern. I've done it a few times and it's been slap-your-forehead simple for me once I learned it:
fdisk throws and error at first:
but you just do a "w" to write the new partition table and exit. Then go back in with fdisk again and create your partitions as you like. Here's what "sfdisk -l" shows after I made a single partition as a demo.
Best of luck!
I think you may be confusing terms. Partitions are done on physical disks, you can't partition a logical volume.
With LVM, you have volume groups (made up of physical volumes) that you can further chunk into logical volumes, but if you have all of your space allocated to a single logical volume, you can't further "partition" it. You'd have to shrink your disk, shrink your LV and then create a new logical volume.
I'm assuming this is on Linux. Certain distros have GUIs available for doing this, so look at your documentation to see if that's available to you which should simplify things.
Failing that, tools for working with LVMs are
Here's an example of starting from a blank disk: