How to Create a Logical Volume Using LVM on Linux Systems
In this article, I’ll show you how to create a new logical volume within an existing LVM volume group. It’s a simple and straight froward task which you will face a lot when managing Linux Systems.
- a working installation of LVM2, and
- an existing LVM volume group with sufficient free space for the new logical volume.
Suppose that the new logical volume to be 256 megabytes in size and named
foo. Volume group
vg0 has sufficient free space to accommodate it.
Logical volumes are created using the lvcreate command:
# lvcreate --size 256M --name mimastech /dev/vg0
The volume will be accessible as either
/dev/mapper/vg0-mimastech. It may be used in much the same way as a hard drive partition.
Verify the existence of the logical volume using the lvdisplay command:
# lvdisplay /dev/vg0/mimastech
This should give a response of the form:
--- Logical volume --- LV Name /dev/vg0/mimastech VG Name vg0 LV UUID afaHxF-nZrA-S1eo-kjsY-mt6C-p04e-IU8Bqu LV Write Access read/write LV Status available # open 0 LV Size 256.00 MB Current LE 64 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:64
Having created a new logical volume you may want to:
- create a filesystem on it, or
- use it as a swap device.
If You Appreciate What We Do Here On Mimastech, You Should Consider:
- Stay Connected to: Facebook | Twitter | Google+
- Support us via PayPal Donation
- Subscribe to our email newsletters.
- Tell other sysadmins / friends about Us - Share and Like our posts and services
We are thankful for your never ending support.