Difference between revisions of "Logical Volume Manager"

From Christoph's Personal Wiki
Jump to: navigation, search
(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...)
(No difference)

Revision as of 19:42, 27 February 2014

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