User Tools

Site Tools


ubuntu:lvm:create_a_logical_volume_using_lvm

Ubuntu - LVM - Create a logical volume using LVM

Logical volumes are created using the lvcreate command:

lvcreate --size 256M --name foo /dev/vg01

The volume will be accessible as either /dev/vg01/foo or /dev/mapper/vg01-foo. It may be used in much the same way as a hard drive partition.


Testing

Verify the existence of the logical volume using the lvdisplay command:

lvdisplay /dev/vg01/foo

This should give a response of the form:

--- Logical volume ---
LV Name                /dev/vg01/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

Next steps

Having created a new logical volume you may want to:

  • Create a filesystem on it
  • Use it as a swap device

Troubleshooting

See also

ubuntu/lvm/create_a_logical_volume_using_lvm.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki