Logical Volume Manager

From Christoph's Personal Wiki
Revision as of 19:42, 27 February 2014 by Christoph (Talk | contribs) (New page: This article will explain how to use the '''Logical Volume Manager''' ('''LVM''') in Linux. ==Examples== *Prepare a physical volume: fdisk -cu /dev/xvde pvcreate /dev/xvde1 pvs *Cr...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article will explain how to use the Logical Volume Manager (LVM) in Linux.

Examples

  • Prepare a physical volume:
fdisk -cu /dev/xvde
pvcreate /dev/xvde1
pvs
  • Create a volume group:
vgcreate vgname /dev/xvde1
vgs
  • Create and use a new logical volume:
lvcreate -n lvname -L 1G vgname
lvs
ls -l /dev/vgname/lvname
#~OR~
ls -l /dev/mapper/vgname-lvname
mkfs.ext4 /dev/vgname/lvname
mkdir /data
  • Make it persistent by adding the following line to your /etc/fstab file:
/dev/mapper/vgname-lvname  /data  ext4  defaults  1 2
mount -a