Create LVM Group

REF

CLI

Check Disk Space

df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 4.0M  8.0K  4.0M   1% /dev
tmpfs                    1.7G  4.0K  1.7G   1% /dev/shm
tmpfs                    688M  9.2M  679M   2% /run
tmpfs                    4.0M     0  4.0M   0% /sys/fs/cgroup
/dev/mapper/system-root   36G  8.6G   27G  25% / # /dev/sdb

Check Disk

  • pvcreate _DEVICE_ Initializes a device (such as /dev/sdb1) for use by LVM as a physical volume. If there is any file system on the specified device, a warning appears. Bear in mind that pvcreate checks for existing file systems only if blkid is installed (which is done by default). If blkid is not available, pvcreate will not produce any warning and you may lose your file system without any warning.

  • pvdisplay _DEVICE_ Displays information about the LVM physical volume, such as whether it is currently being used in a logical volume.

sudo hwinfo --disk --short
disk:                                                           
  /dev/sdd             VMware Virtual S
  /dev/sdb             VMware Virtual S
  /dev/sdc             VMware Virtual S
  /dev/sda             VMware Virtual S

Create PV

Create VG

  • vgcreate -c y VG_NAME DEV1 [DEV2...] Creates a clustered volume group with one or more specified devices.

Create LV

  • lvcreate -L _SIZE_ -n _LV_NAME_ _VG_NAME_ Creates a logical volume of the specified size.

Format disk

Change fstab

Mount

Unmount and remove

Last updated