Create a logical volume using LVM
|Debian (Etch, Lenny, Squeeze)|
|Ubuntu (Hardy, Intrepid, Jaunty, Karmic, Lucid, Maverick, Natty)|
To create a new logical volume within an existing LVM volume group.
- 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 --size 256M --name foo /dev/vg0
The volume will be accessible as either
/dev/mapper/vg0-foo. It may be used in much the same way as a hard drive partition.
Verify the existence of the logical volume using the
This should give a response of the form:
--- Logical volume --- LV Name /dev/vg0/foo 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.
See Troubleshooting LVM.